This is a pretty basic "autocomplete" like functionality wrapped into a little script for toy purposes. It can be initialized via either a dictionary of words (file with 1 word per line) or empty and manually added to.
Autocomplete functionality is provided via a Multi-way Trie data structure. Another option would have been to use a ternary search trie but I find multiway tries to be easier to implement despite being less memory efficient.
You can use the provided dictionary files in the data
directory to initialize by passing the filename as a command line argument, or initialize from scratch by not passing a filename.