Skip to content

Instantly share code, notes, and snippets.

@andrewtremblay
Created December 22, 2015 00:35
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 andrewtremblay/65538b9d6828672c17b7 to your computer and use it in GitHub Desktop.
Save andrewtremblay/65538b9d6828672c17b7 to your computer and use it in GitHub Desktop.
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