Created
June 17, 2009 07:14
-
-
Save lopnor/131117 to your computer and use it in GitHub Desktop.
This file contains 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
#!perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Text::MeCab; | |
use Encode (); | |
my $input = Encode::decode('utf-8', $ARGV[0]); | |
my $mecab = Text::MeCab->new({ | |
userdic => 'mydic.dic', | |
node_format => '%f[9]', | |
}); | |
for (my $node = $mecab->parse($input); $node; $node = $node->next) { | |
Encode::decode('utf-8', $node->format($mecab)) eq '俺専用' or next; | |
warn $node->surface; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment