trietool

NAME

trietool - trie manipulation tool

SYNOPSIS

trietool [options] trie command arg...

DESCRIPTION

trietool is the command-line tool for manipulating double-array trie data. It can be used to query, add and remove words in trie data.
Available commands are:
add word data ...
Add word to trie, associated with integer data. Arbitrary number of words-data pairs can be given. Two arguments will be read at a time, the first will be treated as word, and the second as data.
add-list list-file
Add words with associated data listed in list-file to trie. The list-file must be a text file listing one word per line. The associated data can be put after the word in the same line, separated with tab (`\t') character. If the data field is omitted, a default value (-1) will be used instead.
delete word ...
Delete word from trie. Arbitrary number of words to delete can be given.
delete-list list-file
Delete words listed in list-file from trie. The list-file must be a text file listing one word per line.
query word
Search for word in trie. If word exists, its associated data is printed to standard output. Otherwise, error message is printed to standard error, with nothing printed to standard output.
list
List all words in trie to standard output. The output lists one word-data pair per line, separated with tab (`\t') character, the format appropriate for being list-file for the add-list command.

OPTIONS

This program follows the usual GNU command line syntax, with long options starting with two dashes (`--'). A summary of options is included below.
-p, --path dir
Set trie directory to "dir" [default=.]
-h, --help
Show summary of options.
-V, --version
Show version of program.

AUTHOR

libdatrie was written by Theppitak Karoonboonyanan.
This manual page was written by Theppitak Karoonboonyanan <thep@linux.thai.net>.