Skip to content

Instantly share code, notes, and snippets.

@rocapp
Created January 16, 2017 15:57
Show Gist options
  • Save rocapp/3aeb4dfac79b072c3dd9ab233bc87f40 to your computer and use it in GitHub Desktop.
Save rocapp/3aeb4dfac79b072c3dd9ab233bc87f40 to your computer and use it in GitHub Desktop.
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