Created
October 29, 2014 05:56
-
-
Save rhwlo/9c1f382df3e729576753 to your computer and use it in GitHub Desktop.
This file contains 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
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