Changeset 4336 for lang/perl/Text-MeCab
- Timestamp:
- 01/10/08 11:14:41 (5 years ago)
- Files:
-
- 1 modified
-
lang/perl/Text-MeCab/trunk/lib/Text/MeCab/Dict.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Text-MeCab/trunk/lib/Text/MeCab/Dict.pm
r4335 r4336 8 8 use warnings; 9 9 use base qw(Class::Accessor::Fast); 10 use Text::MeCab; 10 11 use Path::Class::Dir; 11 12 use Path::Class::File; … … 18 19 { 19 20 my $class = shift; 21 my %args = @_; 20 22 21 my ($dict_source, $libexecdir);23 my $libexecdir; 22 24 my $config = $args{mecab_config} || &Text::MeCab::MECAB_CONFIG; 23 25 my $dict_source = $args{dict_source}; … … 40 42 dict_source => $dict_source, 41 43 libexecdir => $libexecdir, 42 input_encoding => $i nput_encoding,43 output_encoding => $o utput_encoding,44 input_encoding => $ie, 45 output_encoding => $oe, 44 46 }, $class; 45 47 } … … 48 50 { 49 51 my $self = shift; 52 53 my $entry; 50 54 if (scalar @_ == 1) { 51 55 $entry = shift @_; … … 90 94 my $dict_index = $self->libexecdir->file('mecab-dict-index'); 91 95 92 my $curdir = Path::Class::Dir->new->absolute 96 my $curdir = Path::Class::Dir->new->absolute; 93 97 eval { 94 98 chdir $dict_source; … … 101 105 foreach my $cmd (@cmds) { 102 106 if (system(@$cmd) != 0) { 103 die "Failed to execute '@ cmd'";107 die "Failed to execute '@$cmd'"; 104 108 } 105 109 } … … 146 150 147 151 my $dict = Text::MeCab::Dict->new(); 148 $dict->add( {152 $dict->add( 149 153 surface => $surface, # 表層形 150 154 left_id => $left_id, # 左文脈ID … … 165 169 pronounce => $pronounce, # 発音 166 170 extra => \@extras, # ユーザー設定 167 });171 ); 168 172 $dict->write('foo.csv'); 169 173 $dict->build();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)