MCPcopy Index your code
hub / github.com/clips/pattern / count_syllables

Function count_syllables

pattern/metrics.py:306–313  ·  view source on GitHub ↗
(word, vowels="aeiouy")

Source from the content-addressed store, hash-verified

304 0.30-0.50 (difficult) => 0.60-0.70 (standard) => 0.90-1.00 (very easy).
305 """
306 def count_syllables(word, vowels="aeiouy"):
307 n = 0
308 p = False # True if the previous character was a vowel.
309 for ch in word.endswith("e") and word[:-1] or word:
310 v = ch in vowels
311 n += int(v and not p)
312 p = v
313 return n
314 if len(string) < 3:
315 return 1.0
316 string = string.strip()

Callers 1

flesch_reading_easeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…