I have already gone through this post which uses
cmudict for counting the number of syllables in a word:
from nltk.corpus import cmudict d = cmudict.dict() def nsyl(word): return [len(list(y for y in x if y[-1].isdigit())) for x in d[word.lower()]]
However, for words outside the cmu's dictionary like names for example:
Rohit, it doesn't give a result.
So, is there any other/better way to count syllables for a word?