Update package version to 1.0.4
[platform/core/uifw/ise-engine-sunpinyin.git] / doc / ids2ngram.pod
1 =head1 NAME
2
3 ids2ngram - generate n-gram data file from ids file
4
5 =head1 SYNOPSIS
6
7 ids2ngram [I<option>]... I<ids_file>...
8
9 =head1 DESCRIPTION
10
11 B<ids2ngram> generates idngram file, which is a sorted [id1,..,idN,freq] array, from binary id stream files. Here, the id stream files are always generated by B<mmseg> or B<slmseg>. Basically, it finds all occurrence of n-words tuples (i.e. the tuple of (id1,..,idN)), and sorts these tuples by the lexicographic order of the ids make up the tuples, then write them to specified output file.
12
13 =head1 INPUT
14
15 The input file is presented as a binary id stream, which looks like:
16     [id0,...,idX]
17
18 =head1 OPTIONS
19
20 All the following options are mandatory.
21
22 =over 4
23
24 =item B<-n>,B<--NMax> I<N>
25
26 Generates I<N>-gram result. B<ids2ngram> does only support uni-gram, bi-gram, and trigram, so any number not in the range of 1..3 is not valid.
27
28 =item B<-s>,B<--swap> I<swap-file>
29
30 Specify the temporary intermediate file.
31
32
33 =item B<-o>, B<--out> I<output-file>
34
35 Specify the result idngram file, e.g. the array of [id1, ..., idN, freq]
36
37
38 =item B<-p>, B<--para> I<N>
39
40 Specify the maximum n-gram items per paragraph. B<ids2ngram> writes to the temporary file on a per-paragraph basis. Every time it writes a paragraph out, it frees the corresponding memory allocated for it. When your computer system permits, a higher I<N> is suggested. This can speed up the processing speed because of less I/O.
41
42
43 =back
44
45
46 =head1 EXAMPLE
47
48 Following example will use three input idstream file idsfile[1,2,3] to generate the idngram file all.id3gram. Each para (internal map size or hash size) would be 1024000, using swap file for temp result. All temp para result would eventually be merged to got the final result.
49
50 B<ids2ngram -n 3 -s /tmp/swap -o all.id3gram -p 1024000 idsfile1 idsfile2 idsfile3>
51
52 =head1 AUTHOR
53
54 Originally written by Phill.Zhang E<lt>phill.zhang@sun.comE<gt>.
55 Currently maintained by Kov.Chai E<lt>tchaikov@gmail.comE<gt>.
56
57 =head1 SEE ALSO
58
59 B<mmseg>(1), B<slmseg>(1), B<slmbuild> (1).
60