I have a function who takes a single string as argument and returns the number of syllables of some string e.g. str = "I eat pancakes"
But i do not get the correct number of syllables what do I do wrong here?
I use regular expression module and already got a pattern that describes the syllables in some text
But i do not get the correct number of syllables what do I do wrong here?
I use regular expression module and already got a pattern that describes the syllables in some text
def count_syllables(str): pattern = re.compile("[aiouy]+e*|e(?!d\b|ly)[aiouye]?|[td]ed|le\b") match_new = pattern.match(str.lower()) if match_new: print len(string)