def match_word(word, meter): if meter and meter[0] and word in unstressables: return None, None if True: if word == '<S>': return meter, None return match_phones(pronounce.pronounce(word), meter)
def get_beats(word): try: phones = pronounce.pronounce(word) except KeyError: try: return guesses[word] except KeyError: return None return segment_beats(phones)
def match_word(word, meter): if meter and meter[0] and word in unstressables: return None, None if True: if word == '<S>': return meter, None try: phones = pronounce.pronounce(word) except KeyError: return try_guess(word, meter) else: return match_phones(phones, meter)
def first_consonant_entropy(words): return entropy(Counter(first_consonant(pronounce.pronounce(word)) for word in words))
def test(s): return score(s.split(), lambda word: first_consonant(pronounce.pronounce(word)))