Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Created June 7, 2011 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChimeraCoder/1012459 to your computer and use it in GitHub Desktop.
Save ChimeraCoder/1012459 to your computer and use it in GitHub Desktop.
Syllable Counter
import curses
from curses.ascii import isdigit
import nltk
from nltk.corpus import cmudict
d = cmudict.dict()
def nsyl(word):
return [len(list(y for y in x if isdigit(y[-1]))) for x in d[word.lower()]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment