Created
May 22, 2009 09:52
-
-
Save kyanny/116041 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Lingua::JA::Summarize; | |
use Perl6::Say; | |
use Encode; | |
my $in = do { local $/; <>; }; | |
my $s = Lingua::JA::Summarize->new({ | |
charset => 'utf8', | |
mecab_charset => 'utf8', | |
default_cost => 1.8, | |
singlechar_factor => 0.2, | |
}); | |
$s->analyze($in); | |
my @keywords = $s->keywords({ | |
threshold => 4, | |
maxwords => 10, | |
minwords => 3, | |
}); | |
for my $keyword (@keywords) { | |
say $keyword; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment