Abstract: nwc-toolkit-ngram-counter は分かち書きされたテキストに含まれる N-gram の頻度を計数するツールです.N-gram の異なり数が大きい場合,出力される N-gram コーパスは複数のファイルに分割されるので,nwc-toolkit-ngram-merger によるマージが必要になります.
nwc-toolkit-ngram-counter は nwc-toolkit を構成するツールの一つです.分かち書きされたテキストを入力として,N-gram の頻度を計数するようになっています.すべての N-gram をメモリ上に展開できないときは,複数のファイルに分割して出力します.出力ファイルは nwc-toolkit-ngram-merger を使ってマージすることができます.
ヘルプを表示するオプションは -h, --help です.いずれかを指定することにより,オプションのリストを確認できます.入力ファイルはオプション以外のコマンドライン引数により指定できます.指定がなければ標準入力を使用します.拡張子が gz, bz2, xz のいずれかであれば,入力ファイルを自動的に伸長します.出力ファイルは -p, --prefix と -e, --extension により指定できます.拡張子が gz, bz2, xz のいずれかであれば,出力ファイルを自動的に圧縮します.
$ nwc-toolkit-ngram-counter -h
Usage: nwc-toolkit-ngram-counter [OPTION]... [FILE]...
Options:
-n, --tokens=[N: 1-32]
limit the length of n-grams to N (default: 5)
-l, --memory=[N: 2-262144]
limit the memory usage to N MiB (default: 1024)
-w, --wakati input wakati-formatted text (default)
-m, --mecab input mecab-formatted text
-c, --chasen input chasen-formatted text
-b, --boundary count sentence boundaries as <S> and </S>
-s, --sort sort result
-p, --prefix=[S] set the prefix of output files
(default: ngms-%Y%m%d-%H%M%S)
-e, --extension=[S] set the extension of output files (default: gz)
gz, bz2, or xz forces compression of result
-f, --files=[N: 0-9999]
limit the number of output files to N + 1 (default: 99)
-h, --help print this help
$ nwc-toolkit-ngram-counter -n 7 -mbs mecabs/*.xz
HTML アーカイブの作成に用いたオプションは -n 7 -mbs です.入力するファイルが mecabs/*.xz であれば,コマンドライン引数として mecabs/*.xz も指定することになります.
特にありません.