Skip to main content

Dictionary optimised for progressive lookup

Project description

Efficient lookup of next possible character(s) given a starting word fragment. This is intended for use in word game strategies (Boggle, Scrabble, Anagram).

To use:

>>> 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.

Files for word-tree, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size word_tree-1.0-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size word_tree-1.0.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page