Branch Coverage

blib/lib/Lingua/EN/Tagger.pm
Criterion Covered Total %
branch 95 134 70.9


line true false branch
28 0 120 unless defined $tag
158 10 0 if (-f $self->{'word_path'} and -f $self->{'tag_path'}) { }
159 0 0 if $self->{'debug'}
208 8 28 unless $self->_valid_text($text)
243 0 2 unless $self->_valid_text($text)
247 0 2 if ($self->{'longest_noun_phrase'} <= 1) { }
268 0 15 unless $self->_valid_text($text)
288 0 1 unless $self->_valid_text($text)
318 4 444 if (not defined $text) { }
0 444 elsif (ref $text) { }
4 440 elsif ($text =~ /^\s*$/) { }
320 0 4 if $self->{'debug'}
324 0 0 if $self->{'debug'}
338 0 0 if ($lc) { }
352 0 355 unless $self->_valid_text($text)
358 347 8 if ($self->{'lc'}) { }
374 0 30 unless $self->_valid_text($text)
419 79 1937 if (defined $tokenized[$_ + 1] and $tokenized[$_ + 1] =~ /[\p{IsUpper}\W]/ and $tokenized[$_] =~ /^(.+)\.$/)
428 59 2 unless (defined $ABBR{lc $1} or $1 =~ /^\p{IsLower}$/i or $1 =~ /^\p{IsLower}(?:\.\p{IsLower})+$/i)
439 7 29 if (defined $words[$#words] and $words[$#words] =~ /^(.*\p{IsWord})\.$/)
458 1427 372 if /^\p{IsWord}+$/
498 0 1966 if ($self->{'unknown_word_tag'} and $word eq '-unknown-') { }
8 1958 elsif ($word eq '-sym-') { }
523 4799 74365 if (defined ${$$w{$tag};}) { }
2119 72246 elsif ($self->{'relax'} and $tag =~ /^(?:jj|nn|rb|vb)/) { }
536 3196 3722 if ($probability > $best_so_far)
568 1823 143 if (defined $_LEXICON{$word}) { }
0 143 elsif (defined $_LEXICON{lcfirst $word}) { }
595 14 129 if (/[\(\{\[]/) { }
14 115 elsif (/[\)\]\}]/o) { }
6 109 elsif (/^-?(?:\p{IsDigit}+(?:\.\p{IsDigit}*)?|\.\p{IsDigit}+)$/) { }
0 109 elsif (m[^\p{IsDigit}+[\p{IsDigit}/:-]+\p{IsDigit}$]) { }
0 109 elsif (/^-?\p{IsDigit}+\p{IsWord}+$/o) { }
0 109 elsif (/^\p{IsUpper}[\p{IsUpper}\.-]*$/o) { }
21 88 elsif (/\p{IsWord}-\p{IsWord}/o) { }
8 80 elsif (/^\W+$/o) { }
20 60 elsif ($_ eq ucfirst $_) { }
10 50 elsif (/ing$/o) { }
16 34 elsif (/s$/o) { }
0 34 elsif (/tion$/o) { }
0 34 elsif (/ly$/o) { }
0 34 elsif (/ed$/o) { }
616 10 11 if ($h_suffix and defined ${$_LEXICON{$h_suffix}{'jj'};}) { }
661 232 4 unless $self->{'stem'}
704 0 1 unless $self->_valid_text($text)
710 0 4 unless length $n < 100
711 4 0 unless $n =~ /^\s*$/
722 1 3 if (scalar @words > 2)
725 0 1 if (defined $nnp{$acronym})
752 0 2 unless $self->_valid_text($text)
760 0 80 unless length $n < 100
761 80 0 unless $n =~ /^\s*$/
781 0 2 unless $self->_valid_text($text)
788 16 26 unless $p =~ /\s/
790 42 0 unless $p =~ /^\s*$/
809 0 4 unless $self->_valid_text($text)
816 20 64 if /$phrase_ext/
827 64 124 if scalar @words > 1
829 160 28 if $w =~ /$NN/
843 0 220 if $word_count > $self->{'longest_noun_phrase'}
845 136 84 unless $word_count > 1
847 110 110 if $self->{'weight_noun_phrases'}
869 0 0 if $self->{'debug'}
891 0 1 unless my $fh = 'FileHandle'->new($path)
893 1 44 unless my($key, $data) = /^"?([^\{"]+)"?: \{ (.*) \}/
917 0 2 unless my $fh = 'FileHandle'->new($path)
919 2 43828 unless my($key, $data) = /^"?([^\{"]+)"?: \{ (.*) \}/