Skip to content

Melkor-1/trie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trie

Auto-completion & Graph Visualization Tool

License

trie is a program that combines auto-completion and trie-based graph visualization. It enables users to suggest auto-completions for a given prefix and generates a visual representation of the underlying trie structure.

Table of Contents

Trie

A trie, or a prefix tree, is a tree-like data structure used to store a dynamic set or associative array where the keys are usually strings.

Trie

Building

To build the project, clone the repository and run the following commands:

git clone --depth 1 https://github.com/Melkor-1/Prefix-Tree
cd Prefix-Tree
make

Installing

The executable can be installed to /usr/local/bin directory by running:

# Note that this require root priveleges
make install

To uninstall, run:

make install

Usage

The program is designed to be used from the command line:

./auto-complete [OPTIONS] [filename]

Options:

  • -k, --keep: Keep the transient .DOT file.
  • -h, --help: Display the help message and exit.
  • -s, --svg: Generate an .SVG file for graph visualization.
  • -c, --complete PREFIX: Suggests autocompletions for a given prefix.
  • -p, --prefix PREFIX: Specify a prefix for the .DOT file. (used and required for graph generation)

Examples:

# Keep the transient .DOT file and generate an SVG file from input.txt
./auto-complete -k -s input.txt

# Specify a prefix for the .DOT file and generate an SVG file from input.txt
./auto-complete -p prefix -s input.txt

# Suggest autocompletions for a given 'prefix' (read for stdin)
./auto-complete -c prefix 

# Display the help message
./auto-complete -h

Acknowledgements

The core concepts and code structure of this library were adapted from the youtube video: This Data Structure could be used for Autocomplete.

About

Auto-completion & Graph Visualization Tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published