Returns the estimated number of syllables in the word by counting vowel-groups.
(word)
| 753 | SUPERLATIVE = "est" |
| 754 | |
| 755 | def _count_syllables(word): |
| 756 | """ Returns the estimated number of syllables in the word by counting vowel-groups. |
| 757 | """ |
| 758 | n = 0 |
| 759 | p = False # True if the previous character was a vowel. |
| 760 | for ch in word.endswith("e") and word[:-1] or word: |
| 761 | v = ch in VOWELS |
| 762 | n += int(v and not p) |
| 763 | p = v |
| 764 | return n |
| 765 | |
| 766 | def grade(adjective, suffix=COMPARATIVE): |
| 767 | """ Returns the comparative or superlative form of the given adjective. |
no outgoing calls
no test coverage detected
searching dependent graphs…