> Attached is a port of MeCab, a Japanese morphological analyzer engine
> and the IPA dictionary for MeCab.

I didn't have any experience with mecab, but I tried to make and install
the package on amd64-current, no problem.

-- yozo.
$ mecab --version
mecab of 0.993

$ mecab --help
MeCab: Yet Another Part-of-Speech and Morphological Analyzer

Copyright(C) 2001-2011 Taku Kudo 
Copyright(C) 2004-2008 Nippon Telegraph and Telephone Corporation

Usage: mecab [options] files
 -r, --rcfile=FILE              use FILE as resource file
 -d, --dicdir=DIR               set DIR  as a system dicdir
 -u, --userdic=FILE             use FILE as a user dictionary
 -l, --lattice-level=INT        lattice information level (DEPRECATED)
 -D, --dictionary-info          show dictionary information and exit
 -O, --output-format-type=TYPE  set output format type (wakati,none,...)
 -a, --all-morphs               output all morphs(default false)
 -N, --nbest=INT                output N best results (default 1)
 -p, --partial                  partial parsing mode (default false)
 -m, --marginal                 output marginal probability (default false)
 -F, --node-format=STR          use STR as the user-defined node format
 -U, --unk-format=STR           use STR as the user-defined unknown node format
 -B, --bos-format=STR           use STR as the user-defined 
beginning-of-sentence format
 -E, --eos-format=STR           use STR as the user-defined end-of-sentence 
format
 -S, --eon-format=STR           use STR as the user-defined end-of-NBest format
 -x, --unk-feature=STR          use STR as the feature for unknown word
 -b, --input-buffer-size=INT    set input buffer size (default 8192)
 -P, --dump-config              dump MeCab parameters
 -M, --open-mutable-dictionary  open dictioanry with mutable mode (experimental)
 -C, --allocate-sentence        allocate new memory for input sentence
 -t, --theta=FLOAT              set temparature parameter theta (default 0.75)
 -c, --cost-factor=INT          set cost factor (default 700)
 -o, --output=FILE              set the output file name
 -v, --version                  show the version and exit.
 -h, --help                     show this help and exit.


$ mecab --dictionary-info
filename:       /usr/local/share/mecab/dic/ipadic/sys.dic
version:        102
charset:        utf-8
type:   0
size:   392126
left size:      1316
right size:     1316

$ ls -al /tmp/testfile
-rw-r--r--  1 yozo  wheel  80 Mar 18 13:48 /tmp/testfile
$ cat /tmp/testfile
すもももももももものうち
わたしのなまえはなかのです。
$ hexdump -xc < /tmp/testfile
0000000    81e3    e399    8282    82e3    e382    8282    82e3    e382
0000000 343 201 231 343 202 202 343 202 202 343 202 202 343 202 202 343
0000010    8282    82e3    e382    8282    82e3    e382    ae81    81e3
0000010 202 202 343 202 202 343 202 202 343 202 202 343 201 256 343 201
0000020    e386    a181    e30a    8f82    81e3    e39f    9781    81e3
0000020 206 343 201 241  \n 343 202 217 343 201 237 343 201 227 343 201
0000030    e3ae    aa81    81e3    e3be    8881    81e3    e3af    aa81
0000030 256 343 201 252 343 201 276 343 201 210 343 201 257 343 201 252
0000040    81e3    e38b    ae81    81e3    e3a7    9981    80e3    0a82
0000040 343 201 213 343 201 256 343 201 247 343 201 231 343 200 202  \n
0000050
$ mecab /tmp/testfile
すもも     名詞,一般,*,*,*,*,すもも,スモモ,スモモ
も       助詞,係助詞,*,*,*,*,も,モ,モ
もも      名詞,一般,*,*,*,*,もも,モモ,モモ
も       助詞,係助詞,*,*,*,*,も,モ,モ
もも      名詞,一般,*,*,*,*,もも,モモ,モモ
の       助詞,連体化,*,*,*,*,の,ノ,ノ
うち      名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ
EOS
わたし     名詞,代名詞,一般,*,*,*,わたし,ワタシ,ワタシ
の       助詞,連体化,*,*,*,*,の,ノ,ノ
な       助詞,終助詞,*,*,*,*,な,ナ,ナ
まえ      動詞,自立,*,*,一段,連用形,まえる,マエ,マエ
は       助詞,係助詞,*,*,*,*,は,ハ,ワ
なか      名詞,一般,*,*,*,*,なか,ナカ,ナカ
の       名詞,非自立,一般,*,*,*,の,ノ,ノ
です      助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
。       記号,句点,*,*,*,*,。,。,。
EOS
$ mecab -O wakati < /tmp/testfile
すもも も もも も もも の うち 
わたし の な まえ は なか の です 。 
$ tail -1 /tmp/testfile | mecab -N 2
tail -1 /tmp/testfile | mecab -N 2
わたし     名詞,代名詞,一般,*,*,*,わたし,ワタシ,ワタシ
の       助詞,連体化,*,*,*,*,の,ノ,ノ
な       助詞,終助詞,*,*,*,*,な,ナ,ナ
まえ      動詞,自立,*,*,一段,連用形,まえる,マエ,マエ
は       助詞,係助詞,*,*,*,*,は,ハ,ワ
なか      名詞,一般,*,*,*,*,なか,ナカ,ナカ
の       名詞,非自立,一般,*,*,*,の,ノ,ノ
です      助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
。       記号,句点,*,*,*,*,。,。,。
EOS
わたし     名詞,代名詞,一般,*,*,*,わたし,ワタシ,ワタシ
の       助詞,連体化,*,*,*,*,の,ノ,ノ
な       助詞,終助詞,*,*,*,*,な,ナ,ナ
ま       フィラー,*,*,*,*,*,ま,マ,マ
え       フィラー,*,*,*,*,*,え,エ,エ
は       助詞,係助詞,*,*,*,*,は,ハ,ワ
なか      名詞,一般,*,*,*,*,なか,ナカ,ナカ
の       名詞,非自立,一般,*,*,*,の,ノ,ノ
です      助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
。       記号,句点,*,*,*,*,。,。,。
EOS
$ 

Reply via email to