Created
January 16, 2017 15:57
-
-
Save rocapp/3aeb4dfac79b072c3dd9ab233bc87f40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment