Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Created June 7, 2011 15:18
Show Gist options
  • Select an option

  • Save ChimeraCoder/1012459 to your computer and use it in GitHub Desktop.

Select an option

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