implementation of a Trie/Prefix Tree
Use the build script ./build-example.sh
to create example binaries with SBCL:
$ ./build-example.sh graph # build the executable 'graph' in the repository root.
Loads a dictionary file and presents a list of autocomplete suggestions using the user input as the prefix to search for.
$ ./build-example.sh prediction # build 'prediction' executable
$ ./prediction --dict dict/long.txt # run the demo using 'dict/long.txt' as the dictionary
Then, type to see autocomplete suggestions for the current input.
Use Escape to exit, and Enter to reset input.
- Graphviz
Prints a DOT language representation of the input dictionary to standard output.
$ ./build-example.sh graph.lisp # build 'graph' executable
$ ./graph $filename > trie.dot # using `filename` as input, save DOT output to 'trie.dot'
$ dot -Tsvg trie.dot -O # create SVG using 'trie.dot' as input
Helper
Helium
Hello
Fry
Barium
Baritone
Bass
Individual words highlighted for clarity