Mecabist/Helper.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 42 CC 5 SCAR 23.0
CC
5
Cov
0%
readable
20.0
is
6.0
BEGIN
2.0
CRAP 10.0
1 package Text::Mecabist::Helper;
2 use strict;
3 use warnings;
4 use utf8;
5 use Moo::Role;
6  
7 sub readable {
8 my $node = shift;
9  
10 return 0 if not defined $node->stat;
11 return 0 if $node->stat == Text::MeCab::MECAB_BOS_NODE;
12 return 0 if $node->stat == Text::MeCab::MECAB_EOS_NODE;
13
14 return 1;
15 }
16  
17 sub is {
18 my ($node, $type) = @_;
19 for ($node->pos, $node->pos1, $node->inflection_type, $node->inflection_form) {
20 return 1 if $_ && $_ eq $type;
21 }
22
23 return 0;
24 }
25  
26 1;