def demo():
    from nltk_lite.corpora import words
    wordlist = list(words.raw())
    random.shuffle(wordlist)
    wordlist = wordlist[:200]
    wordlist = [w for w in wordlist if 3 <= len(w) <= 12]
    grid, used = wordfinder(wordlist)

    print "Word Finder\n"
    for i in range(len(grid)):
        for j in range(len(grid[i])):
            print grid[i][j],
        print
    print
    
    for i in range(len(used)):
        print "%d:" % (i+1), used[i]
Пример #2
0
def demo():
    from nltk_lite.corpora import words
    from itertools import islice
    from pprint import pprint

    pprint(list(islice(words.raw(), 0, 20)))