Instantly share code, notes, and snippets.

Embed
What would you like to do?
import nltk
all_words = nltk.corpus.words.words()
print len(all_words), "total words loaded"
jumbled_letters = "andrewtremblay"
letter_distribution = nltk.FreqDist(jumbled_letters)
matching_wordlist = [w.lower() for w in all_words if nltk.FreqDist(w) <= letter_distribution]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment