I'm a little bit confused about how to count morphemes when we talk about contractions such as "I'm" or "don't". I need to calculate the ratio of morphemes to words.
First, you have to have a theory of morphemes, whereby you can answer the question "how many morphemes are there in do, does, did, is, am?". If you think that "am" has two morphemes, then "do" probably does as well, which can affect your count of morphemes in don't. In a writing-based analysis, you would not notice that the root of do is different from the root of don't. Most contemporary theories of morphosyntax have numerous phonologically empty or nearly-empty morphemes, corresponding to agreement features. So it ultimately depends on why you are counting morphemes, rather than counting something else. Also incidentally, you have to have a theory that tells you that "I'm" is one word and not two.