.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Text::MeCab::Dict 3pm" .TH Text::MeCab::Dict 3pm "2014-01-10" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::MeCab::Dict \- Utility To Work With MeCab Dictionary .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Text::MeCab::Dict; \& \& my $dict = Text::MeCab::Dict\->new( \& dict_source => "/path/to/mecab\-ipadic\-source" \& ); \& $dict\->add( \& surface => $surface, # 表層形 \& left_id => $left_id, # 左文脈ID \& right_id => $right_id, # 右文脈ID \& cost => $cost, # コスト \& pos => $part_of_speech, # 品詞 \& category1 => $category1, # 品詞細分類1 \& category2 => $category2, # 品詞細分類2 \& category3 => $category3, # 品詞細分類3 \& \& # XXX this below two parameter names need blessing from a knowing \& # expert, and is subject to change \& inflect => $inflect, # 活用形 \& inflect_type => $inflect_type, # 活用型 \& \& original => $original, # 原形 \& yomi => $yomi, # 読み \& pronounce => $pronounce, # 発音 \& extra => \e@extras, # ユーザー設定 \& ); \& $dict\->write(\*(Aqfoo.csv\*(Aq); \& $dict\->rebuild(); .Ve .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Creates a new instance of Text::MeCab::Dict. .PP The path to the source of mecab-ipadic is required: .PP .Vb 3 \& my $dict = Text::MeCab::Dict\->new( \& dict_source => "/path/to/mecab\-ipadic\-source" \& ); .Ve .PP If you are in an environment where mecab-config is \s-1NOT\s0 available, you must also specify libexecdir, which is where mecab-dict-index is installed: .PP .Vb 4 \& my $dict = Text::MeCab::Dict\->new( \& dict_source => "/path/to/mecab\-ipadic\-source", \& libexecdir => "/path/to/mecab/libexec/", \& ); .Ve .SS "add" .IX Subsection "add" Adds a new entry to be appended to the dictionary. Please see \s-1SYNOPSIS\s0 for arguments. .SS "write" .IX Subsection "write" Writes out the entries that were added via \fIadd()\fR to the specified file location. If the file name does not look like an absolute path, the name will be treated relatively from dict_source .SS "rebuild" .IX Subsection "rebuild" Rebuilds the index. This usually requires that you are have root privileges .SH "SEE ALSO" .IX Header "SEE ALSO" http://mecab.sourceforge.net/dic.html