Skip to content

Instantly share code, notes, and snippets.

@nqounet nqounet/
Created Jan 28, 2017

What would you like to do?
#Perl鍋 #14(2017-01-26)
#!/usr/bin/env perl
use utf8;
use v5.16;
use strict;
use warnings;
use feature 'say';
use Data::Printer {deparse => 1, caller_info => 1};
use Web::Query;
use Text::Shirasu;
sub {
my $text = $_->text;
my $ts = Text::Shirasu->new(dicdir => '/usr/local/lib/mecab/dic/ipadic');
my $normalize = $ts->normalize($text);
$ts->filter(type => [qw/名詞/]);
for my $node (@{$ts->nodes}) {
say $node->surface;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.