Branch Coverage

blib/lib/Lingua/EN/Inflect/Phrase.pm
Criterion Covered Total %
branch 66 68 97.0


line true false branch
101 391 3 unless defined $is_plural
105 4 390 if ($noun =~ /^(?:people|person)\z/i) { }
4 386 elsif ($noun =~ /^hero(?:es)?\z/i) { }
1 385 elsif ($want_singular and lc $noun eq 'aliases') { }
1 384 elsif ($want_singular and lc $noun eq 'statuses') { }
4 380 elsif (lc $noun eq 'belongs') { }
2 536 elsif ($want_plural and lc $noun eq 'two') { }
106 2 2 $want_singular ? :
109 2 2 $want_singular ? :
124 60 318 if ($want_plural and not $is_plural) { }
42 436 elsif ($want_singular and $is_plural) { }
139 2 363 if ($phrase eq 'a')
140 1 1 $want_singular ? :
154 854 235 if defined $_
112 251 if (grep({length $_ if defined $_;} $number, $pad, $rest) == 3) { }
159 32 80 if ($number =~ /^\s*1(?:\.0*[Ee]?0*)?\z/ and not $tagged_rest =~ m[^(?:\S+/CC|\d)]) { }
175 72 291 if (my($det, $number, $conj, $and_zero, $pad, $rest) = $tagged =~ m[ ^ (\s* \S+/DET)? (\s* (?:one|single))/(?:JJ|NN|CD)\b (\s*\S+/CC\b)? (?:(\s* (?:no|zero))/(?:DET|CD))? (\s*) (.*) ]x) { }
68 223 elsif ($tagged =~ m[^\s*(?:(\S+)/DET)?] and substr($phrase, $+[1] || 0) =~ /^\s*$Lingua::EN::Inflect::Phrase::number_re/) { }
188 4 68 if (length $conj and not $and_zero) { }
64 4 elsif (length $rest) { }
204 56 12 unless (is_ordinal($number))
215 44 12 if (length $rest)
227 357 6 if (($noun) = $tagged =~ /$MAYBE_NOUN (?! .* $MAYBE_NOUN_TAG .* $PREPOSITION_OR_CONJUNCTION_TAG) .* $PREPOSITION_OR_CONJUNCTION_TAG/x or ($noun) = $tagged =~ /$MAYBE_NOUN (?!.*$MAYBE_NOUN_TAG)/x or ($noun) = $tagged =~ /$NOUN_OR_VERB (?!.*$NOUN_OR_VERB_TAG .* $PREPOSITION_OR_CONJUNCTION_TAG) .* $PREPOSITION_OR_CONJUNCTION_TAG/x or ($noun) = $tagged =~ /$NOUN_OR_VERB (?! .* $NOUN_OR_VERB_TAG)/x) { }
250 2 355 if (not $verb || $prefer_nouns and $tagger->get_readable(_inflect_noun($noun, 1, 0)) =~ /$VERB_TAG/)
254 2 0 if (my($preceding_noun) = substr($tagged, 0, $pos[0]) =~ /$MAYBE_NOUN\s*\z/)
265 35 322 if ($verb)
268 31 4 if ($prefer_nouns) { }
2 2 elsif ($inflected_noun) { }
269 7 24 if ($tagger->get_readable($plural_verb) =~ /$MAYBE_NOUN/ or $verb eq $plural_verb and $tagger->get_readable(_inflect_noun($verb, 1)) =~ /$MAYBE_NOUN/ and substr($tagged, $verb_pos[1]) =~ m[^\s*/VB\s*$])
282 1 1 if ($want_plural) { }
1 0 elsif ($want_singular) { }
294 81 276 if $inflected_noun
302 2 4 if ($want_plural and $number ne 'p') { }
1 4 elsif ($want_singular and $number ne 's') { }