| 1 | package Acme::Ikamusume::MAParser; | ||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use Encode; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 3 | ▶ | use base 'Text::MeCab'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | my $encoding = Encode::find_encoding( Text::MeCab::ENCODING ); | ||||||||||||
| 9 | |||||||||||||
| 10 | sub parse { | ||||||||||||
| 11 | 0 | ▶ | shift->SUPER::parse($encoding->encode(@_)); | ||||||||||
|
Subroutine
parse: not called CC=1 SCAR=6.9
| |||||||||||||
| 12 | } | ||||||||||||
| 13 | |||||||||||||
| 14 | package # hide from the PAUSE indexer | ||||||||||||
| 15 | Text::MeCab::Node; | ||||||||||||
| 16 | |||||||||||||
| 17 | { | ||||||||||||
| 18 | 2 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 2 | ▶ | no warnings 'redefine'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | for my $method (qw( surface feature )) { | ||||||||||||
| 21 | my $original = \&$method; | ||||||||||||
| 22 | *{$method} = sub { | ||||||||||||
| 23 | my $val = $original->(@_); | ||||||||||||
| 24 | defined $val ? $encoding->decode($val) : ""; | ||||||||||||
| 25 | }; | ||||||||||||
| 26 | } | ||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | sub features { | ||||||||||||
| 30 | 0 | ▶ | my %f; | ||||||||||
|
Subroutine
features: not called CC=2 SCAR=17.9
| |||||||||||||
| 31 | |||||||||||||
| 32 | 0 | @f{qw( | |||||||||||
| 33 | pos category1 category2 category3 | ||||||||||||
| 34 | inflect inflect_type original yomi pronounse | ||||||||||||
| 35 | extra | ||||||||||||
| 36 | )} = split(/,/, shift->feature, 10); | ||||||||||||
| 37 | |||||||||||||
| 38 | 0 | ▶ | $f{extra} = [ split /,/, $f{extra} || "" ]; | ||||||||||
|
Condition0%0/2
$f{'extra'} || ''
MC/DC0%0/1
$f{'extra'} || ''
$f{'extra'}
Truth table0%0/2
A
A= $f{'extra'}
| |||||||||||||
| 39 | |||||||||||||
| 40 | 0 | \%f; | |||||||||||
| 41 | }; | ||||||||||||
| 42 | |||||||||||||
| 43 | 1; | ||||||||||||
| 44 | __END__ | ||||||||||||