A dictionary optimised for progressive lookup
Project description
Word Tree
Efficient lookup of next possible character(s) given a starting word fragment.
This is intended for use in word game strategies (Boggle, Scrabble, Anagram).
Usage:
>>> import word_tree
>>> with open('words.lst') as wl:
... wt = word_tree.make_word_tree([w.strip() for w in wl])
...
>>> word_tree.next_char(wt, 'do')
['c', 'e', 'd', 'g', 'i', 'm', 'l', 'o', 'n', 'p', 's', 'r', 'u', 't', 'w', 'v', 'z', None]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
word_tree-2.0.0.tar.gz
(14.7 kB
view hashes)
Built Distribution
word_tree-2.0.0-py3-none-any.whl
(14.9 kB
view hashes)
Close
Hashes for word_tree-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db4c28ccafc6fb9444b4fede73bdbaf9e8273fde9851a0480d55ec6d4a17de0c |
|
MD5 | 10f63de1c1345e9d856fe55f9fffe569 |
|
BLAKE2b-256 | 3d24ea43d9348a86b3821daaa4365ac00e19c24d38f458e288e138d3b6993ff3 |