Branch Coverage

blib/lib/Lingua/ENG/Inflect.pm
Criterion Covered Total %
branch 359 440 81.5


line true false branch
71 1 1711 unless (@_)
75 5 1706 if (@_ == 1 and not $_[0] =~ /$classical_mode/)
76 2 3 $_[0] ? :
81 0 2552 unless ($arg =~ /$classical_mode/)
84 2546 6 if (@_ and not $_[0] =~ /$classical_mode/) { }
87 1695 857 if ($arg eq "all")
88 848 847 $classical{'all'} ? :
97 0 0 if (defined $_[0]) { }
100 0 0 if not defined $_[1] or $_[1]
122 0 0 unless (s/NUM\(\s*?(?:([^),]*)(?:,([^)]*))?)?\)/NUM($1, $2);/ex)
710 0 6 if (not eval "'' =~ m/$_[0]/; 1;" or $@)
719 6 0 if (defined $_[1])
722 0 6 if (not eval "qq{$_[1]}; 1;" or $@)
771 8 36 if ($word =~ /^(?:$_[$i])$/i)
773 0 8 unless defined $_[$i + 1]
798 96 77 if ($classical{'all'}) { }
799 1148 9115 $orig =~ /^[A-Z]/ ? :
12 10263 $orig =~ /^[A-Z]+$/ ? :
10 10275 $orig =~ /^I$/ ? :
810 0 1704 unless $word
822 0 6553 unless $word
832 0 2028 unless $word
843 0 0 unless $word
849 60 3324 unless _PL_eq(@_, \&Lingua::ENG::Inflect::PL_N) or _PL_eq(@_, \&Lingua::ENG::Inflect::PL_V)
860 894 2610 if not $result and $word1 eq $word2
861 1043 2461 if not $result and $word1 eq &$PL($word2)
862 1043 2461 if not $result and &$PL($word1) eq $word2
864 172 3332 if not $result and $word1 eq &$PL($word2)
865 172 3332 if not $result and &$PL($word1) eq $word2
868 3384 120 if ($PL == \&Lingua::ENG::Inflect::PL or $PL == \&Lingua::ENG::Inflect::PL_N)
870 0 3384 if not $result and _PL_check_plurals_N($word1, $word2)
872 0 3384 if not $result and _PL_check_plurals_N($word2, $word1)
875 0 3504 if ($PL == \&Lingua::ENG::Inflect::PL or $PL == \&Lingua::ENG::Inflect::PL_ADJ)
877 0 0 if not $result and _PL_check_plurals_ADJ($word1, $word2, $PL)
892 0 1920 if $_ eq $pair
893 0 10320 if $_ eq $pair
895 0 240 if _PL_reg_plurals($pair, $PL_sb_C_a_ata, "as", "ata") or _PL_reg_plurals($pair, $PL_sb_C_is_ides, "is", "ides") or _PL_reg_plurals($pair, $PL_sb_C_a_ae, "s", "e") or _PL_reg_plurals($pair, $PL_sb_C_en_ina, "ens", "ina") or _PL_reg_plurals($pair, $PL_sb_C_um_a, "ums", "a") or _PL_reg_plurals($pair, $PL_sb_C_us_i, "uses", "i") or _PL_reg_plurals($pair, $PL_sb_C_on_a, "ons", "a") or _PL_reg_plurals($pair, $PL_sb_C_o_i, "os", "i") or _PL_reg_plurals($pair, $PL_sb_C_ex_ices, "exes", "ices") or _PL_reg_plurals($pair, $PL_sb_C_ix_ices, "ixes", "ices") or _PL_reg_plurals($pair, $PL_sb_C_i, "s", "i") or _PL_reg_plurals($pair, $PL_sb_C_im, "s", "im") or _PL_reg_plurals($pair, ".*eau", "s", "x") or _PL_reg_plurals($pair, ".*ieu", "s", "x") or _PL_reg_plurals($pair, ".*tri", "xes", "ces") or _PL_reg_plurals($pair, ".{2,}[yia]n", "xes", "ges")
922 0 0 unless $word1a =~ s/'s?$//
923 0 0 unless $word2a =~ s/'s?$//
924 0 0 unless $word1b =~ s/s'$//
925 0 0 unless $word2b =~ s/s'$//
927 0 0 if ($word1a)
929 0 0 if $word2a and _PL_check_plurals_N($word1a, $word2a) || _PL_check_plurals_N($word2a, $word1a)
931 0 0 if $word2b and _PL_check_plurals_N($word1a, $word2b) || _PL_check_plurals_N($word2b, $word1a)
934 0 0 if ($word1b)
936 0 0 if $word2a and _PL_check_plurals_N($word1b, $word2a) || _PL_check_plurals_N($word2a, $word1b)
938 0 0 if $word2b and _PL_check_plurals_N($word1b, $word2b) || _PL_check_plurals_N($word2b, $word1b)
953 0 8256 if not defined $count and defined $persistent_count
958 6 8250 defined $count && $count =~ /^($PL_count_one)$/io || defined $count && $classical{'zero'} && $count =~ /^($PL_count_zero)$/io ? :
962 6 8250 if $count == 1
966 3 8247 if defined($value = ud_match($word, @PL_sb_user_defined))
971 0 8247 if $word eq ""
973 714 7533 if $word =~ /^($PL_sb_uninflected)$/i
976 42 7491 if $classical{'herd'} and $word =~ /^($PL_sb_uninflected_herd)$/i
982 58 7433 if $word =~ /^(?:$PL_sb_postfix_adj)$/i and $value = $2
987 8 7425 if $word =~ /^(?:$PL_sb_prep_dual_compound)$/i and $value = [$2, $3]
993 122 7303 if $word =~ /^(?:$PL_sb_prep_compound)$/i and $value = $2
1001 184 7119 if $word =~ /^((?:$PL_prep)\s+)($PL_pron_acc)$/i
1003 130 6989 if $value = $PL_pron_nom{lc $word}
1007 28 6961 if $word =~ /^($PL_pron_acc)$/i
1013 332 6629 if $word =~ /(.*)\b($PL_sb_irregular)$/i
1014 264 6365 if $word =~ /($PL_sb_U_man_mans)$/i
1016 8 6357 if $word =~ /(\S*)quy$/i
1018 18 22 $classical{'persons'} ? :
40 6317 if $word =~ /(\S*)(person)$/i
1022 162 6155 if $word =~ /(.*)man$/i
1023 48 6107 if $word =~ /(.*[ml])ouse$/i
1024 8 6099 if $word =~ /(.*)goose$/i
1025 8 6091 if $word =~ /(.*)tooth$/i
1026 10 6081 if $word =~ /(.*)foot$/i
1030 4 6077 if $word =~ /(.*)ceps$/i
1031 24 6053 if $word =~ /(.*)zoon$/i
1032 32 6021 if $word =~ /(.*[csx])is$/i
1033 24 5997 if $word =~ /($PL_sb_U_ch_chs)ch$/i
1034 24 5973 if $word =~ /($PL_sb_U_ex_ices)ex$/i
1035 16 5957 if $word =~ /($PL_sb_U_ix_ices)ix$/i
1036 72 5885 if $word =~ /($PL_sb_U_um_a)um$/i
1037 72 5813 if $word =~ /($PL_sb_U_us_i)us$/i
1038 72 5741 if $word =~ /($PL_sb_U_on_a)on$/i
1039 32 5709 if $word =~ /($PL_sb_U_a_ae)$/i
1043 4060 1649 if ($classical{'ancient'})
1045 31 4029 if $word =~ /(.*)trix$/i
1046 54 3975 if $word =~ /(.*)eau$/i
1047 12 3963 if $word =~ /(.*)ieu$/i
1048 24 3939 if $word =~ /(.{2,}[yia])nx$/i
1049 24 3915 if $word =~ /($PL_sb_C_en_ina)en$/i
1050 49 3866 if $word =~ /($PL_sb_C_ex_ices)ex$/i
1051 6 3860 if $word =~ /($PL_sb_C_ix_ices)ix$/i
1052 169 3691 if $word =~ /($PL_sb_C_um_a)um$/i
1053 84 3607 if $word =~ /($PL_sb_C_us_i)us$/i
1054 28 3579 if $word =~ /($PL_sb_C_us_us)$/i
1055 102 3477 if $word =~ /($PL_sb_C_a_ae)$/i
1056 132 3345 if $word =~ /($PL_sb_C_a_ata)a$/i
1057 66 3279 if $word =~ /($PL_sb_C_is_ides)is$/i
1058 48 3231 if $word =~ /($PL_sb_C_o_i)o$/i
1059 6 3225 if $word =~ /($PL_sb_C_on_a)on$/i
1060 18 3207 if $word =~ /$PL_sb_C_im$/i
1061 12 3195 if $word =~ /$PL_sb_C_i$/i
1067 1338 3506 if $word =~ /^($PL_sb_singular_s)$/i
1068 60 0 if $word =~ /^([A-Z].*s)$/ and $classical{'names'}
1069 16 3430 if $word =~ /^(.*[^z])(z)$/i
1070 229 3201 if $word =~ /^(.*)([cs]h|x|zz|ss)$/i
1075 56 3145 if $word =~ /(.*[eao])lf$/i
1076 28 3117 if $word =~ /(.*[^d])eaf$/i
1077 44 3073 if $word =~ /(.*[nlw])ife$/i
1078 24 3049 if $word =~ /(.*)arf$/i
1082 60 2989 if $word =~ /(.*[aeiou])y$/i
1083 17 4 if $word =~ /([A-Z].*y)$/ and $classical{'names'}
1084 62 2910 if $word =~ /(.*)y$/i
1088 272 2638 if $word =~ /$PL_sb_U_o_os$/i
1089 72 2566 if $word =~ /[aeiou]o$/i
1090 88 2478 if $word =~ /o$/i
1102 0 3685 if not defined $count and defined $persistent_count
1105 0 3685 defined $count && $count =~ /^($PL_count_one)$/io || defined $count && $classical{'zero'} && $count =~ /^($PL_count_zero)$/io ? :
1108 0 3685 if $count =~ /^($PL_count_one)$/io
1114 2 3683 if defined($value = ud_match($word, @PL_v_user_defined))
1119 128 3555 if $word =~ /^($PL_v_irregular_pres)((\s.*)?)$/i
1123 60 3495 if $word =~ /^($PL_v_irregular_non_pres)((\s.*)?)$/i
1129 30 3465 if $word =~ /^($PL_v_irregular_pres)(n't(\s.*)?)$/i
1131 8 3457 if $word =~ /^\S+n't\b/i
1136 616 2841 if $word =~ /^($PL_v_special_s)$/
1137 152 2689 if $word =~ /\s/
1141 16 2673 if $word =~ /^(.*)([cs]h|[x]|zz|ss)es$/i
1143 9 2664 if $word =~ /^(..+)ies$/i
1145 96 2568 if $word =~ /($PL_v_oes_oe)$/
1146 0 2568 if $word =~ /^(.+)oes$/i
1148 175 2393 if $word =~ /^(.*[^s])s$/i
1158 0 1654 if not defined $count and defined $persistent_count
1161 0 1654 defined $count && $count =~ /^($PL_count_one)$/io || defined $count && $classical{'zero'} && $count =~ /^($PL_count_zero)$/io ? :
1164 0 1654 if $count =~ /^($PL_count_one)$/io
1169 4 1650 if $word =~ /^($PL_v_ambiguous_pres)((\s.*)?)$/i
1173 18 1632 if $word =~ /^($PL_v_ambiguous_non_pres)((\s.*)?)$/i
1185 0 1704 if not defined $count and defined $persistent_count
1188 4 1700 defined $count && $count =~ /^($PL_count_one)$/io || defined $count && $classical{'zero'} && $count =~ /^($PL_count_zero)$/io ? :
1191 4 1700 if $count =~ /^($PL_count_one)$/io
1197 3 1697 if defined($value = ud_match($word, @PL_adj_user_defined))
1202 10 1687 if $word =~ /^($PL_adj_special)$/i
1207 16 1671 if $word =~ /^($PL_adj_poss)$/i
1209 14 1657 if ($word =~ /^(.*)'s?$/)
1210 6 8 $pl =~ /s$/ ? :
1251 0 109 unless $word
1262 0 109 if not defined $count and defined $persistent_count
1265 0 109 if defined $count and not $count =~ /^($PL_count_one)$/io
1271 0 109 if defined($value = ud_match($word, @A_a_user_defined))
1275 0 109 if $word =~ /^($A_explicit_an)/i
1276 0 109 if $word =~ /^[aefhilmnorsx]$/i
1277 0 109 if $word =~ /^[bcdgjkpqtuvwyz]$/i
1282 0 109 if $word =~ /^($A_abbrev)/ox
1283 0 109 if $word =~ /^[aefhilmnorsx][.-]/i
1284 11 98 if $word =~ /^[a-z][.-]/i
1288 53 45 if $word =~ /^[^aeiouy]/i
1292 6 39 if $word =~ /^e[uw]/i
1293 2 37 if $word =~ /^onc?e\b/i
1294 16 21 if $word =~ /^uni([^nmd]|mo)/i
1295 14 7 if $word =~ /^u[bcfhjkqrst][aeiou]/i
1299 2 5 if $word =~ /^U[NK][AIEO]?/
1303 0 5 if $word =~ /^[aeiou]/i
1307 0 5 if $word =~ /^($A_y_cons)/io
1320 0 4 if not defined $count and defined $persistent_count
1322 2 2 unless $count
1324 2 2 unless $count =~ /^$PL_count_zero$/
1335 4 1 unless s/ie$/y/ or s/ue$/u/ or s/([auy])e$/$1/ or s/ski$/ski/ or s/i$// or s/([^e])e$/$1/ or /er$/
1379 82 82 if ($num =~ /\d/) { }
1408 0 1120 if $ind > $#mill
1409 1120 0 $ind < @mill ? :
1415 179 70 $_[0] && $_[1] ? :
249 377 if $_[0] ne 1
1422 89 15 $_[1] || $_[2] ? :
104 24 if $_[0]
1424 12 12 if $_[1] or $_[2]
1433 85 954 if ($group == 1) { }
63 891 elsif ($group == 2) { }
63 828 elsif ($group == 3) { }
48 780 elsif ($num + 0 == 0) { }
44 736 elsif ($num + 0 == 1) { }
1435 231 45 $1 ? :
45 276 $1 == 1 ? :
1439 3 7 $2 ? :
92 10 $1 ? :
1440 24 6 $1 ? :
1444 30 5 $1 ? :
20 35 $1 == 1 ? :
6 9 $3 ? :
40 15 $2 ? :
1445 0 1 $2 ? :
22 1 $1 ? :
1446 14 7 $1 ? :
2 21 $1 == 1 ? :
1468 55 1226 if (@_ % 2 and require Carp)
1477 230 996 if (exists $arg{'threshold'} and $num > $arg{'threshold'})
1480 220 10 unless $whole =~ s/ (\d) ( \d{3}(?:,|\z) ) /$1,$2/msx
1483 10 220 $frac ? :
1486 0 996 unless $group =~ /\A[0-3]\Z/
1487 0 996 $num =~ /\A\s*\-/ ? :
0 996 $num =~ /\A\s*\+/ ? :
1497 165 831 $group ? :
996 0 $arg{'decimal'} ? :
1502 6 990 if ($chunks[0] eq "")
1507 54 985 unless $_
1509 22 1017 if (not $group || $first) { }
1514 828 211 if not $group and $first
1517 990 49 if $first
1521 6 990 if ($first =~ /0/) { }
1530 51 945 if $ord and @numchunks
1539 0 996 if (wantarray) { }
165 831 elsif ($group) { }
1541 0 0 if $sign
1546 0 165 $sign ? :
1550 0 831 $sign ? :
1554 19 157 if (/\A$arg{'decimal'}\Z/) { }
70 87 elsif ($first) { }
1579 16 45 if (ref $arg eq 'HASH') { }
1587 0 20 if @words == 0
1588 5 15 if @words == 1
1590 6 9 exists $opt{'conj'} ? :
1591 5 10 if (@words == 2)
1597 5 5 grep(/,/, @words) ? :
0 10 exists $opt{'sep'} ? :
1602 2 4 length $opt{'final_sep'} == 0 ? :
4 6 !exists $opt{'final_sep'} ? :