~ubuntu-branches/ubuntu/precise/libdatrie/precise

« back to all changes in this revision

Viewing changes to man/trietool.1

  • Committer: Bazaar Package Importer
  • Author(s): Theppitak Karoonboonyanan
  • Date: 2009-04-29 15:24:31 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090429152431-8zmxgfvir3mrog08
* Use complete sentences in libdatrie1 long description. (Closes: #525806)
* New upstream release, fixing builds on non-GNU systems.
* Remove duplicated field "section" for libdatrie1 [lintian].

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\"                                      Hey, EMACS: -*- nroff -*-
2
 
.\" First parameter, NAME, should be all caps
3
 
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4
 
.\" other parameters are allowed: see man(7), man(1)
5
 
.TH TRIETOOL 1 "OCTOBER 2006"
6
 
.\" Please adjust this date whenever revising the manpage.
7
 
.\"
8
 
.\" Some roff macros, for reference:
9
 
.\" .nh        disable hyphenation
10
 
.\" .hy        enable hyphenation
11
 
.\" .ad l      left justify
12
 
.\" .ad b      justify to both left and right margins
13
 
.\" .nf        disable filling
14
 
.\" .fi        enable filling
15
 
.\" .br        insert line break
16
 
.\" .sp <n>    insert n+1 empty lines
17
 
.\" for manpage-specific macros, see man(7)
18
 
.SH NAME
19
 
trietool \- trie manipulation tool
20
 
.SH SYNOPSIS
21
 
.B trietool
22
 
.RI [ options ] " trie command arg" ...
23
 
.SH DESCRIPTION
24
 
\fBtrietool\fP is the command-line tool for manipulating double-array trie 
25
 
data.  It can be used to query, add and remove words in trie data.
26
 
.PP
27
 
.SH THE TRIE
28
 
The \fItrie\fP argument specifies the name of the trie to manipulate. 
29
 
Tries are stored in a set of files with the same name but different 
30
 
extentions, namely `.sbm', `.br' and `.tl'.
31
 
.PP
32
 
To create a new trie, one need to prepare the file with `.sbm' extension, 
33
 
describing the single-byte alphabet set of the trie.  The SBM defines a 
34
 
vector that maps hexadecimal character encodings to a continuous range of 
35
 
integers. The mapped integers will be used as internal alphabet for the trie. 
36
 
Such mapping can improve the space allocation within the trie data, regardless 
37
 
of non-continuity of the character set being used, as the mapped range is 
38
 
always continuous.
39
 
.PP
40
 
The SBM file is a plain text file, with each line listing a range of 8-bit 
41
 
character encodings to be added to the alphabet set, in the format:
42
 
.PP
43
 
.Vb 1
44
 
    [0xSS,0xTT]
45
 
.Ve
46
 
.PP
47
 
where `0xSS' and `0xTT' are hexadecimal values of starting and ending 
48
 
character code for the range, respectively.
49
 
.PP
50
 
For example, for a dictionary that contains only English words witout any 
51
 
punctuations, one may prepare `\fItrie\fP.sbm' as:
52
 
.PP
53
 
.Vb 2
54
 
    [0x41,0x5a]
55
 
    [0x61,0x7a]
56
 
.Ve
57
 
.PP
58
 
The first line lists the ASCII codes for A-Z, and the second for a-z.
59
 
.SH COMMANDS
60
 
Available commands are:
61
 
.TP
62
 
\fBadd\fP \fIword data\fP ...
63
 
Add \fIword\fP to trie, associated with integer \fIdata\fP.  Arbitrary number of
64
 
words-data pairs can be given.  Two arguments will be read at a time, the first 
65
 
will be treated as \fIword\fP, and the second as \fIdata\fP.
66
 
.TP
67
 
\fBadd-list\fP \fIlist-file\fP
68
 
Add words with associated data listed in \fIlist-file\fP to trie.  The 
69
 
\fIlist-file\fP must be a text file listing one word per line.  The associated
70
 
data can be put after the word in the same line, separated with tab (`\\t')
71
 
character.  If the data field is omitted, a default value (\-1) will be used
72
 
instead.
73
 
.TP
74
 
\fBdelete\fP \fIword\fP ...
75
 
Delete \fIword\fP from trie.  Arbitrary number of words to delete can be given.
76
 
.TP
77
 
\fBdelete-list\fP \fIlist-file\fP
78
 
Delete words listed in \fIlist-file\fP from trie.  The \fIlist-file\fP must be 
79
 
a text file listing one word per line.
80
 
.TP
81
 
\fBquery\fP \fIword\fP
82
 
Search for \fIword\fP in trie.  If \fIword\fP exists, its associated data
83
 
is printed to standard output.  Otherwise, error message is printed to standard
84
 
error, with nothing printed to standard output.
85
 
.TP
86
 
\fBlist\fP
87
 
List all words in trie to standard output.  The output lists one word-data pair
88
 
per line, separated with tab (`\\t') character, the format appropriate for
89
 
being \fIlist-file\fP for the \fBadd-list\fP command.
90
 
.SH OPTIONS
91
 
This program follows the usual GNU command line syntax, with long
92
 
options starting with two dashes (`\-\-').
93
 
A summary of options is included below.
94
 
.TP
95
 
.B \-p, \-\-path \fIdir\fP
96
 
Set trie directory to \fIdir\fP [default=`.']
97
 
.TP
98
 
.B \-h, \-\-help
99
 
Show summary of options.
100
 
.TP
101
 
.B \-V, \-\-version
102
 
Show version of program.
103
 
.br
104
 
.SH AUTHOR
105
 
libdatrie was written by Theppitak Karoonboonyanan.
106
 
.PP
107
 
This manual page was written by Theppitak Karoonboonyanan <thep@linux.thai.net>.