Created
January 22, 2016 10:24
-
-
Save nipotan/e2412eecfdbbf71ca1e5 to your computer and use it in GitHub Desktop.
modified to handle the first mecab node rightly for Acme::Lou
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- Lou.pm.orig 2007-02-01 19:08:45.000000000 +0900 | |
| +++ Lou.pm 2016-01-22 19:18:52.144838848 +0900 | |
| @@ -116,7 +116,7 @@ | |
| $text = encode($self->{mecab_charset}, $text); | |
| my @out; | |
| my $node = $self->mecab->parse($text); | |
| - while ($node = $node->next) { | |
| + while ($node) { | |
| my $n = $self->decode_node($node); | |
| $n->{to} = $self->dic($n->{original}); | |
| @@ -151,6 +151,7 @@ | |
| } else { | |
| push @out, $n->{surface}; | |
| } | |
| + $node = $node->next; | |
| } | |
| $text = join "", @out; | |
| $text =~ s/\r/\n/g; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK!