Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Text::MeCab::Dict(3)  User Contributed Perl Documentation Text::MeCab::Dict(3)

NAME
       Text::MeCab::Dict - Utility To Work With	MeCab Dictionary

SYNOPSIS
	 use Text::MeCab::Dict;

	 my $dict = Text::MeCab::Dict->new(
	   dict_source => "/path/to/mecab-ipadic-source"
	 );
	 $dict->add(
	   surface	=> $surface,	    # e!"a+-xa1/2c
	   left_id	=> $left_id,	    # a.|aeeID
	   right_id	=> $right_id,	    # a^3aeeID
	   cost		=> $cost,	    # a^3a^1a
	   pos		=> $part_of_speech, # ae(C)
	   category1	=> $category1,	    # ae(C)c'<degree>ae!1
	   category2	=> $category2,	    # ae(C)c'<degree>ae!2
	   category3	=> $category3,	    # ae(C)c'<degree>ae!3

	   # XXX this below two	parameter names	need blessing from a knowing
	   # expert, and is subject to change
	   inflect	=> $inflect,	    # ae'>>c"a1/2c
	   inflect_type	=> $inflect_type,   # ae'>>c"a

	   original	=> $original,	    # aa1/2c
	   yomi		=> $yomi,	    # eaa?
	   pronounce	=> $pronounce,	    # coe^3
	   extra	=> \@extras,	    # a|a1/4a<paragraph>a1/4e"a(R)
	 );
	 $dict->write('foo.csv');
	 $dict->build();

METHODS
   new
       Creates a new instance of Text::MeCab::Dict.

       The path	to the source of mecab-ipadic is required:

	 my $dict = Text::MeCab::Dict->new(
	   dict_source => "/path/to/mecab-ipadic-source"
	 );

       If you are in an	environment where mecab-config is NOT available, you
       must also specify libexecdir, which is where mecab-dict-index is
       installed:

	 my $dict = Text::MeCab::Dict->new(
	   dict_source => "/path/to/mecab-ipadic-source",
	   libexecdir  => "/path/to/mecab/libexec/",
	 );

   add
       Adds a new entry	to be appended to the dictionary. Please see SYNOPSIS
       for arguments.

   write
       Writes out the entries that were	added via add()	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

   rebuild
       Rebuilds	the index. This	usually	requires that you are have root
       privileges

SEE ALSO
       http://mecab.sourceforge.net/dic.html

perl v5.32.1			  2010-05-10		  Text::MeCab::Dict(3)

NAME | SYNOPSIS | METHODS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Text::MeCab::Dict&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help