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.

Source Distribution

word_tree-1.0.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

word_tree-1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page