Skip to content

Instantly share code, notes, and snippets.

@rhwlo
Created October 29, 2014 05:56
Show Gist options
  • Save rhwlo/9c1f382df3e729576753 to your computer and use it in GitHub Desktop.
Save rhwlo/9c1f382df3e729576753 to your computer and use it in GitHub Desktop.
import random
from nltk.corpus import cmudict
d = cmudict.dict()
benedicts = [k for (k,v) in d.iteritems() if len([s for s in v[0] if s[-1].isdigit()]) == 3 and v[0][0] == u'B' and '1' in v[0][1]]
cumberbatches = [k for (k,v) in d.iteritems() if len([s for s in v[0] if s[-1].isdigit()]) == 3 and k[0] == 'c' and v[0][0] == u'K' and '1' in v[0][1]]
for i in xrange(200):
print('{} {}'.format(random.choice(benedicts).capitalize(), random.choice(cumberbatches).capitalize()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment