def get_MLUm(tagged_sents, pos_to_ignore=None):
    """Mean length of utterance (MLU) in morphemes"""
    total_utterance_count = 0
    total_morpheme_count = 0
    for tagged_sent in tagged_sents:
        total_utterance_count += 1
        for tagged_word in tagged_sent:
            pos = tagged_word[1]
            morph = tagged_word[2]
            if pos_to_ignore and pos in pos_to_ignore:
                continue
            total_morpheme_count += 1
            total_morpheme_count += morph.count('-')
            total_morpheme_count += morph.count('~')
    if total_utterance_count:
        return total_morpheme_count / total_utterance_count
    else:
        return 0
