import nltkwordlist=nltk.corpus.words.words()if __name__=='__main__': while(True): letters=raw_input('letters:') rs=[w for w in wordlist if len(w)>1 and nltk.FreqDist(w)<=nltk.FreqDist(letters)] print list(set(sorted(rs,key=lambda x:len(x),reverse=True)))
可以用来玩 words with friends 哦