tyler-trie 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/VERSION.yml +4 -0
  2. data/ext/libdatrie/AUTHORS +1 -0
  3. data/ext/libdatrie/COPYING +510 -0
  4. data/ext/libdatrie/ChangeLog +410 -0
  5. data/ext/libdatrie/INSTALL +236 -0
  6. data/ext/libdatrie/Makefile.am +5 -0
  7. data/ext/libdatrie/Makefile.in +661 -0
  8. data/ext/libdatrie/NEWS +27 -0
  9. data/ext/libdatrie/README +32 -0
  10. data/ext/libdatrie/aclocal.m4 +7431 -0
  11. data/ext/libdatrie/config.guess +1516 -0
  12. data/ext/libdatrie/config.h.in +74 -0
  13. data/ext/libdatrie/config.sub +1626 -0
  14. data/ext/libdatrie/configure +22008 -0
  15. data/ext/libdatrie/configure.ac +71 -0
  16. data/ext/libdatrie/datrie.pc.in +11 -0
  17. data/ext/libdatrie/datrie/Makefile.am +35 -0
  18. data/ext/libdatrie/datrie/Makefile.in +522 -0
  19. data/ext/libdatrie/datrie/alpha-map.c +170 -0
  20. data/ext/libdatrie/datrie/alpha-map.h +36 -0
  21. data/ext/libdatrie/datrie/darray.c +674 -0
  22. data/ext/libdatrie/datrie/darray.h +229 -0
  23. data/ext/libdatrie/datrie/fileutils.c +151 -0
  24. data/ext/libdatrie/datrie/fileutils.h +36 -0
  25. data/ext/libdatrie/datrie/libdatrie.def +31 -0
  26. data/ext/libdatrie/datrie/sb-trie.c +331 -0
  27. data/ext/libdatrie/datrie/sb-trie.h +279 -0
  28. data/ext/libdatrie/datrie/tail.c +344 -0
  29. data/ext/libdatrie/datrie/tail.h +200 -0
  30. data/ext/libdatrie/datrie/trie-private.h +31 -0
  31. data/ext/libdatrie/datrie/trie.c +413 -0
  32. data/ext/libdatrie/datrie/trie.h +270 -0
  33. data/ext/libdatrie/datrie/triedefs.h +63 -0
  34. data/ext/libdatrie/datrie/typedefs.h +113 -0
  35. data/ext/libdatrie/depcomp +530 -0
  36. data/ext/libdatrie/doc/Doxyfile.in +244 -0
  37. data/ext/libdatrie/doc/Makefile.am +29 -0
  38. data/ext/libdatrie/doc/Makefile.in +352 -0
  39. data/ext/libdatrie/install-sh +323 -0
  40. data/ext/libdatrie/ltmain.sh +6938 -0
  41. data/ext/libdatrie/man/Makefile.am +4 -0
  42. data/ext/libdatrie/man/Makefile.in +381 -0
  43. data/ext/libdatrie/man/trietool.1 +107 -0
  44. data/ext/libdatrie/missing +360 -0
  45. data/ext/libdatrie/tools/Makefile.am +7 -0
  46. data/ext/libdatrie/tools/Makefile.in +460 -0
  47. data/ext/libdatrie/tools/trietool.c +308 -0
  48. data/ext/trie/extconf.rb +12 -0
  49. data/ext/trie/trie.c +174 -0
  50. data/lib/trie.rb +1 -0
  51. data/spec/test-trie/README +1 -0
  52. data/spec/trie_spec.rb +79 -0
  53. metadata +139 -0
@@ -0,0 +1,4 @@
1
+ EXTRA_DIST = trietool.1
2
+
3
+ man_MANS = trietool.1
4
+
@@ -0,0 +1,381 @@
1
+ # Makefile.in generated by automake 1.9.6 from Makefile.am.
2
+ # @configure_input@
3
+
4
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5
+ # 2003, 2004, 2005 Free Software Foundation, Inc.
6
+ # This Makefile.in is free software; the Free Software Foundation
7
+ # gives unlimited permission to copy and/or distribute it,
8
+ # with or without modifications, as long as this notice is preserved.
9
+
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
+ # PARTICULAR PURPOSE.
14
+
15
+ @SET_MAKE@
16
+ srcdir = @srcdir@
17
+ top_srcdir = @top_srcdir@
18
+ VPATH = @srcdir@
19
+ pkgdatadir = $(datadir)/@PACKAGE@
20
+ pkglibdir = $(libdir)/@PACKAGE@
21
+ pkgincludedir = $(includedir)/@PACKAGE@
22
+ top_builddir = ..
23
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24
+ INSTALL = @INSTALL@
25
+ install_sh_DATA = $(install_sh) -c -m 644
26
+ install_sh_PROGRAM = $(install_sh) -c
27
+ install_sh_SCRIPT = $(install_sh) -c
28
+ INSTALL_HEADER = $(INSTALL_DATA)
29
+ transform = $(program_transform_name)
30
+ NORMAL_INSTALL = :
31
+ PRE_INSTALL = :
32
+ POST_INSTALL = :
33
+ NORMAL_UNINSTALL = :
34
+ PRE_UNINSTALL = :
35
+ POST_UNINSTALL = :
36
+ build_triplet = @build@
37
+ host_triplet = @host@
38
+ subdir = man
39
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
40
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
41
+ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
42
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
43
+ $(ACLOCAL_M4)
44
+ mkinstalldirs = $(install_sh) -d
45
+ CONFIG_HEADER = $(top_builddir)/config.h
46
+ CONFIG_CLEAN_FILES =
47
+ SOURCES =
48
+ DIST_SOURCES =
49
+ man1dir = $(mandir)/man1
50
+ am__installdirs = "$(DESTDIR)$(man1dir)"
51
+ NROFF = nroff
52
+ MANS = $(man_MANS)
53
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
54
+ ACLOCAL = @ACLOCAL@
55
+ AMDEP_FALSE = @AMDEP_FALSE@
56
+ AMDEP_TRUE = @AMDEP_TRUE@
57
+ AMTAR = @AMTAR@
58
+ AR = @AR@
59
+ AS = @AS@
60
+ AUTOCONF = @AUTOCONF@
61
+ AUTOHEADER = @AUTOHEADER@
62
+ AUTOMAKE = @AUTOMAKE@
63
+ AWK = @AWK@
64
+ CC = @CC@
65
+ CCDEPMODE = @CCDEPMODE@
66
+ CFLAGS = @CFLAGS@
67
+ CPP = @CPP@
68
+ CPPFLAGS = @CPPFLAGS@
69
+ CXX = @CXX@
70
+ CXXCPP = @CXXCPP@
71
+ CXXDEPMODE = @CXXDEPMODE@
72
+ CXXFLAGS = @CXXFLAGS@
73
+ CYGPATH_W = @CYGPATH_W@
74
+ DEFS = @DEFS@
75
+ DEPDIR = @DEPDIR@
76
+ DLLTOOL = @DLLTOOL@
77
+ DOXYGEN = @DOXYGEN@
78
+ ECHO = @ECHO@
79
+ ECHO_C = @ECHO_C@
80
+ ECHO_N = @ECHO_N@
81
+ ECHO_T = @ECHO_T@
82
+ EGREP = @EGREP@
83
+ ENABLE_DOXYGEN_DOC_FALSE = @ENABLE_DOXYGEN_DOC_FALSE@
84
+ ENABLE_DOXYGEN_DOC_TRUE = @ENABLE_DOXYGEN_DOC_TRUE@
85
+ EXEEXT = @EXEEXT@
86
+ F77 = @F77@
87
+ FFLAGS = @FFLAGS@
88
+ GREP = @GREP@
89
+ INSTALL_DATA = @INSTALL_DATA@
90
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
91
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
92
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
93
+ LDFLAGS = @LDFLAGS@
94
+ LIBOBJS = @LIBOBJS@
95
+ LIBS = @LIBS@
96
+ LIBTOOL = @LIBTOOL@
97
+ LN_S = @LN_S@
98
+ LTLIBOBJS = @LTLIBOBJS@
99
+ LT_AGE = @LT_AGE@
100
+ LT_CURRENT = @LT_CURRENT@
101
+ LT_REVISION = @LT_REVISION@
102
+ MAKEINFO = @MAKEINFO@
103
+ OBJDUMP = @OBJDUMP@
104
+ OBJEXT = @OBJEXT@
105
+ PACKAGE = @PACKAGE@
106
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
107
+ PACKAGE_NAME = @PACKAGE_NAME@
108
+ PACKAGE_STRING = @PACKAGE_STRING@
109
+ PACKAGE_TARNAME = @PACKAGE_TARNAME@
110
+ PACKAGE_VERSION = @PACKAGE_VERSION@
111
+ PATH_SEPARATOR = @PATH_SEPARATOR@
112
+ RANLIB = @RANLIB@
113
+ SED = @SED@
114
+ SET_MAKE = @SET_MAKE@
115
+ SHELL = @SHELL@
116
+ STRIP = @STRIP@
117
+ VERSION = @VERSION@
118
+ ac_ct_CC = @ac_ct_CC@
119
+ ac_ct_CXX = @ac_ct_CXX@
120
+ ac_ct_F77 = @ac_ct_F77@
121
+ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
122
+ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
123
+ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
124
+ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
125
+ am__include = @am__include@
126
+ am__leading_dot = @am__leading_dot@
127
+ am__quote = @am__quote@
128
+ am__tar = @am__tar@
129
+ am__untar = @am__untar@
130
+ bindir = @bindir@
131
+ build = @build@
132
+ build_alias = @build_alias@
133
+ build_cpu = @build_cpu@
134
+ build_os = @build_os@
135
+ build_vendor = @build_vendor@
136
+ datadir = @datadir@
137
+ datarootdir = @datarootdir@
138
+ docdir = @docdir@
139
+ dvidir = @dvidir@
140
+ exec_prefix = @exec_prefix@
141
+ host = @host@
142
+ host_alias = @host_alias@
143
+ host_cpu = @host_cpu@
144
+ host_os = @host_os@
145
+ host_vendor = @host_vendor@
146
+ htmldir = @htmldir@
147
+ htmldocdir = @htmldocdir@
148
+ includedir = @includedir@
149
+ infodir = @infodir@
150
+ install_sh = @install_sh@
151
+ libdir = @libdir@
152
+ libexecdir = @libexecdir@
153
+ localedir = @localedir@
154
+ localstatedir = @localstatedir@
155
+ mandir = @mandir@
156
+ mkdir_p = @mkdir_p@
157
+ oldincludedir = @oldincludedir@
158
+ pdfdir = @pdfdir@
159
+ prefix = @prefix@
160
+ program_transform_name = @program_transform_name@
161
+ psdir = @psdir@
162
+ sbindir = @sbindir@
163
+ sharedstatedir = @sharedstatedir@
164
+ sysconfdir = @sysconfdir@
165
+ target_alias = @target_alias@
166
+ EXTRA_DIST = trietool.1
167
+ man_MANS = trietool.1
168
+ all: all-am
169
+
170
+ .SUFFIXES:
171
+ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
172
+ @for dep in $?; do \
173
+ case '$(am__configure_deps)' in \
174
+ *$$dep*) \
175
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
176
+ && exit 0; \
177
+ exit 1;; \
178
+ esac; \
179
+ done; \
180
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
181
+ cd $(top_srcdir) && \
182
+ $(AUTOMAKE) --gnu man/Makefile
183
+ .PRECIOUS: Makefile
184
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
185
+ @case '$?' in \
186
+ *config.status*) \
187
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
188
+ *) \
189
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
190
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
191
+ esac;
192
+
193
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
194
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
195
+
196
+ $(top_srcdir)/configure: $(am__configure_deps)
197
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
198
+ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
199
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
200
+
201
+ mostlyclean-libtool:
202
+ -rm -f *.lo
203
+
204
+ clean-libtool:
205
+ -rm -rf .libs _libs
206
+
207
+ distclean-libtool:
208
+ -rm -f libtool
209
+ uninstall-info-am:
210
+ install-man1: $(man1_MANS) $(man_MANS)
211
+ @$(NORMAL_INSTALL)
212
+ test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
213
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
214
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
215
+ for i in $$l2; do \
216
+ case "$$i" in \
217
+ *.1*) list="$$list $$i" ;; \
218
+ esac; \
219
+ done; \
220
+ for i in $$list; do \
221
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
222
+ else file=$$i; fi; \
223
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
224
+ case "$$ext" in \
225
+ 1*) ;; \
226
+ *) ext='1' ;; \
227
+ esac; \
228
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
229
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
230
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
231
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
232
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
233
+ done
234
+ uninstall-man1:
235
+ @$(NORMAL_UNINSTALL)
236
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
237
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
238
+ for i in $$l2; do \
239
+ case "$$i" in \
240
+ *.1*) list="$$list $$i" ;; \
241
+ esac; \
242
+ done; \
243
+ for i in $$list; do \
244
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
245
+ case "$$ext" in \
246
+ 1*) ;; \
247
+ *) ext='1' ;; \
248
+ esac; \
249
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
250
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
251
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
252
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
253
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
254
+ done
255
+ tags: TAGS
256
+ TAGS:
257
+
258
+ ctags: CTAGS
259
+ CTAGS:
260
+
261
+
262
+ distdir: $(DISTFILES)
263
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
264
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
265
+ list='$(DISTFILES)'; for file in $$list; do \
266
+ case $$file in \
267
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
268
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
269
+ esac; \
270
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
271
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
272
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
273
+ dir="/$$dir"; \
274
+ $(mkdir_p) "$(distdir)$$dir"; \
275
+ else \
276
+ dir=''; \
277
+ fi; \
278
+ if test -d $$d/$$file; then \
279
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
280
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
281
+ fi; \
282
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
283
+ else \
284
+ test -f $(distdir)/$$file \
285
+ || cp -p $$d/$$file $(distdir)/$$file \
286
+ || exit 1; \
287
+ fi; \
288
+ done
289
+ check-am: all-am
290
+ check: check-am
291
+ all-am: Makefile $(MANS)
292
+ installdirs:
293
+ for dir in "$(DESTDIR)$(man1dir)"; do \
294
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
295
+ done
296
+ install: install-am
297
+ install-exec: install-exec-am
298
+ install-data: install-data-am
299
+ uninstall: uninstall-am
300
+
301
+ install-am: all-am
302
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
303
+
304
+ installcheck: installcheck-am
305
+ install-strip:
306
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
307
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
308
+ `test -z '$(STRIP)' || \
309
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
310
+ mostlyclean-generic:
311
+
312
+ clean-generic:
313
+
314
+ distclean-generic:
315
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
316
+
317
+ maintainer-clean-generic:
318
+ @echo "This command is intended for maintainers to use"
319
+ @echo "it deletes files that may require special tools to rebuild."
320
+ clean: clean-am
321
+
322
+ clean-am: clean-generic clean-libtool mostlyclean-am
323
+
324
+ distclean: distclean-am
325
+ -rm -f Makefile
326
+ distclean-am: clean-am distclean-generic distclean-libtool
327
+
328
+ dvi: dvi-am
329
+
330
+ dvi-am:
331
+
332
+ html: html-am
333
+
334
+ info: info-am
335
+
336
+ info-am:
337
+
338
+ install-data-am: install-man
339
+
340
+ install-exec-am:
341
+
342
+ install-info: install-info-am
343
+
344
+ install-man: install-man1
345
+
346
+ installcheck-am:
347
+
348
+ maintainer-clean: maintainer-clean-am
349
+ -rm -f Makefile
350
+ maintainer-clean-am: distclean-am maintainer-clean-generic
351
+
352
+ mostlyclean: mostlyclean-am
353
+
354
+ mostlyclean-am: mostlyclean-generic mostlyclean-libtool
355
+
356
+ pdf: pdf-am
357
+
358
+ pdf-am:
359
+
360
+ ps: ps-am
361
+
362
+ ps-am:
363
+
364
+ uninstall-am: uninstall-info-am uninstall-man
365
+
366
+ uninstall-man: uninstall-man1
367
+
368
+ .PHONY: all all-am check check-am clean clean-generic clean-libtool \
369
+ distclean distclean-generic distclean-libtool distdir dvi \
370
+ dvi-am html html-am info info-am install install-am \
371
+ install-data install-data-am install-exec install-exec-am \
372
+ install-info install-info-am install-man install-man1 \
373
+ install-strip installcheck installcheck-am installdirs \
374
+ maintainer-clean maintainer-clean-generic mostlyclean \
375
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
376
+ uninstall uninstall-am uninstall-info-am uninstall-man \
377
+ uninstall-man1
378
+
379
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
380
+ # Otherwise a system limit (for SysV at least) may be exceeded.
381
+ .NOEXPORT:
@@ -0,0 +1,107 @@
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>.