source: trunk/gsdl/src/mgpp/text/mg_compression_dict.1@ 1847

Last change on this file since 1847 was 856, checked in by sjboddie, 24 years ago

Rodgers new C++ mg

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.8 KB
Line 
1.\"------------------------------------------------------------
2.\" Id - set Rv,revision, and Dt, Date using rcs-Id tag.
3.de Id
4.ds Rv \\$3
5.ds Dt \\$4
6..
7.Id $Id: mg_compression_dict.1 856 2000-01-14 02:26:25Z sjboddie $
8.\"------------------------------------------------------------
9.TH mg_compression_dict 1 \*(Dt CITRI
10.SH NAME
11mg_compression_dict \- build a compression dictionary.
12.SH SYNOPSIS
13.B mg_compression_dict
14[
15.B \-h
16]
17[
18.BR \-C " |"
19.BR \-P " |"
20.B \-S
21]
22.if n .ti +9n
23[
24.BR \-0 " |"
25.BR \-1 " |"
26.BR \-2 " |"
27.B \-3
28]
29[
30.BR \-H " |"
31.BR \-B " |"
32.BR \-D " |"
33.BR \-Y " |"
34]
35.if n .ti +9n
36.if t .ti +.5i
37[
38.BI \-l " lookback"
39]
40[
41.BI \-k " mem"
42]
43[
44.BI \-d " directory"
45]
46.BI \-f " name"
47.SH DESCRIPTION
48.B mg_compression_dict
49builds a compression dictionary based on the statistics gathered
50during the first pass over the text. The options to the program are
51mainly concerned with limiting the amount of memory the dictionary
52will use and with how the text compressor will cope with any novel
53words found during the compression phase.
54.SH OPTIONS
55Options may appear in any order.
56.TP "\w'\fB\-d\fP \fIdirectory\fP'u+2n"
57.B \-h
58This displays a usage line on
59.IR stderr .
60.TP
61.B \-C
62Build a complete dictionary from the statistics file. If during the
63text compression phase a novel word is found, then the compressor will
64produce an error message and stop.
65.TP
66.B \-P
67Build a partial dictionary from the statistics file. This dictionary
68assumes that the statistics file are based on the entire text. The
69statistics of words not includes in the dictionary are used to
70calculate the escape probability. If novel words are being coded
71character by character, then there may not be a Huffman code for every
72possible character. This means that the compressor may fail if a novel
73word contains a novel character.
74.TP
75.B \-S
76Build a seed dictionary from the statistics file. This dictionary
77assumes that the statistics file is based on only a portion of the
78text to be compressed. The probability of a novel word is based on the
79number of words that have only occurred once. If novel words are being
80coded character by character, then the Huffman codes for characters are
81based on the frequency of characters in the dictionary.
82.TP
83.B \-0
84All words from the statistics file are included in the built
85dictionary.
86.TP
87.B \-1
88Words are included in the dictionary until the dictionary reaches the
89desired size. Words are selected for the dictionary based on the order
90they occurred in the source text.
91.TP
92.B \-2
93Words are included in the dictionary until the dictionary reaches the
94desired size. The most frequent words are included in the dictionary
95first; where there is a tie for frequency, the shortest word is
96included first.
97.TP
98.B \-3
99Words are included in the dictionary until the dictionary reaches the
100desired size. The most frequent words are included in the dictionary
101first; where there is a tie for frequency, the shortest word is
102included first. Words are the shuffled back and forth between the
103`keep' and `discard' lists to find the `optimal' set of words that
104should be in the dictionary.
105.TP
106.B \-H
107This specifies that novel words will be coded character by character
108using Huffman codes.
109.TP
110.B \-B
111This specifies that an auxiliary dictionary will be built by the
112compressor. Each novel word found will be placed at the end of the
113auxiliary dictionary. Novel words will be coded in the compressed text
114using binary codes. The binary code represents their occurrence
115position in the auxiliary dictionary.
116.TP
117.B \-D
118This specifies that an auxiliary dictionary will be built by the
119compressor. Each novel word found will be placed at the end of the
120auxiliary dictionary. Novel words will be coded in the compressed text
121using delta codes. The delta code represents their occurrence position
122in the auxiliary dictionary.
123.TP
124.B \-Y
125This specifies that an auxiliary dictionary will be built by the
126compressor. Each novel word found will be placed at the end of the
127auxiliary dictionary. Novel words will be coded in the compressed text
128using a combination of gamma and binary codes. The code represents
129their occurrence position in the auxiliary dictionary. This generally
130produces better compression than
131.B \-B
132or
133.BR \-D .
134.TP
135.BI \-l " lookback"
136The generated dictionary is designed to be front coded when it is
137loaded into memory. Under normal circumstances, a front-coded
138dictionary would require scanning from the beginning in order to find
139any particular word. However, every
140.I lookback
141words in the dictionary, the whole word is stored and a pointer to that
142word maintained. E.g., if
143.I lookback
144is 4, then every fourth word is stored in its entirety.
145.TP
146.BI \-k " mem"
147This limits the amount of memory to use for the generated
148dictionary. Words are selected for the dictionary based of the text
149statistics, and whether
150.BR \-0 , " \-1" , " \-2"
151or
152.B \-3
153is specified. The memory is calculated assuming a lookback of 0,
154irrespective of what actual lookback is specified. This means that if
155a non-zero lookback is given, the dictionary will actually occupy
156less space than specified by
157.BR \-k .
158.TP
159.BI \-d " directory"
160This specifies the directory where the document collection can be found.
161.TP
162.BI \-f " name"
163This specifies the base name of the document collection.
164.SH ENVIRONMENT
165.TP "\w'\fBMGDATA\fP'u+2n"
166.SB MGDATA
167If this environment variable exists, then its value is used as the
168default directory where the mg
169collection files are. If this variable does not exist, then the
170directory \*(lq\fB.\fP\*(rq is used by default. The command line
171option
172.BI \-d " directory"
173overrides the directory in
174.BR MGDATA .
175.SH FILES
176.TP 20
177.B *.text.stats
178Statistics about the source text.
179.TP
180.B *.text.dict
181Compression dictionary for the source text.
182.SH "SEE ALSO"
183.na
184.BR mg_fast_comp_dict (1),
185.BR mg_invf_dict (1),
186.BR mg_passes (1),
187.BR mg_perf_hash_build (1),
188.BR mg_stem_idx (1),
189.BR mg_weights_build (1)
Note: See TracBrowser for help on using the repository browser.