Branch Coverage

blib/lib/Lingua/Alignment.pm
Criterion Covered Total %
branch 15 310 4.8


line true false branch
64 0 0 unless ($targetString =~ /^NULL /)
88 0 0 if (length $reverseAlignmentString > 0)
111 10 10 if (defined $sourceSentence)
115 0 10 unless ($sourceSentence =~ /^NULL /)
120 10 10 if (defined $targetSentence)
124 0 10 unless ($targetSentence =~ /^NULL /)
138 0 165 if (@pair > 2)
145 124 28 if (defined $pairs[$i]) { }
154 20 0 if (defined $refToAlignedPairs_ts)
155 0 20 if (@$refToAlignedPairs_ts > 0)
164 0 0 if (@pair > 2)
170 0 0 if (defined $pairs[$i]) { }
185 0 0 if (defined $sourceSentence)
189 0 0 unless ($sourceSentence =~ /^NULL /)
194 0 0 if (defined $targetSentence)
198 0 0 unless ($targetSentence =~ /^NULL /)
205 0 0 if ($st_string ne '')
217 0 0 if ($sep eq 's') { }
0 0 elsif ($sep eq 'p') { }
229 0 0 if (defined $pairs[$i]) { }
241 0 0 if ($ts_string ne '')
252 0 0 if ($sep eq 's') { }
0 0 elsif ($sep eq 'p') { }
263 0 0 if (defined $pairs[$i]) { }
301 0 132 if ($al->isIn($source . 'Al', $j, 0))
304 0 0 if ($$al{$source . 'Al'}[$j][$i] == 0)
325 0 0 if (@{$$al{$source . 'Al'}[$j];} == 0) { }
335 0 0 if (not defined $reverseAl[$i] or @{$reverseAl[$i];} == 0)
336 0 0 unless ($al->isIn($source . 'Al', 0, $i))
348 20 0 unless (defined $side)
354 0 149 if (${$$al{$side . 'Links'};}{"$j $i"}) { }
374 0 0 unless (defined $side)
375 0 0 if ($side eq 'source') { }
402 0 0 unless (defined $side)
408 0 0 if (${$$al{$side . 'Links'};}{"$j $i"}) { }
425 0 0 if ($newFormat eq 'TALP') { }
0 0 elsif ($newFormat eq 'NAACL') { }
0 0 elsif ($newFormat eq 'GIZA') { }
0 0 elsif ($newFormat eq 'BLINKER') { }
426 0 0 if ($$newFH{'source'})
429 0 0 if ($$newFH{'target'})
432 0 0 if ($$newFH{'sourceToTarget'})
435 0 0 if ($$newFH{'targetToSource'})
439 0 0 if ($$newFH{'source'})
442 0 0 if ($$newFH{'target'})
449 0 0 if ($$newFH{'targetToSource'})
456 0 0 if (exists $$newFH{'sourceToTarget'})
459 0 0 if (exists $$newFH{'targetToSource'})
463 0 0 if ($$newFH{'source'})
466 0 0 if ($$newFH{'target'})
476 0 0 if ($$newLocation{'targetToSource'})
495 0 0 if ($format eq 'text') { }
0 0 elsif ($format eq 'latex') { }
525 0 0 if ($i_partOf_Bj > 0) { }
526 0 0 if ($j_partOf_Bi > 0) { }
532 0 0 if ($j_partOf_Bi > 0) { }
555 0 0 if ($numRowTokens > $maxRows)
567 0 0 if ($mark eq 'cross') { }
0 0 elsif ($mark eq 'ambiguity') { }
0 0 elsif ($mark eq 'confidence') { }
569 0 0 if (length $$al{'sourceLinks'}{"$j $i"}[0] > 0) { }
573 0 0 if (length $$al{'sourceLinks'}{"$j $i"}[1] > 0) { }
577 0 0 if ($mark eq 'ambiguity') { }
0 0 elsif ($mark eq 'confidence') { }
578 0 0 if (length $$al{'targetLinks'}{"$i $j"}[0] > 0) { }
581 0 0 if (length $$al{'targetLinks'}{"$i $j"}[1] > 0) { }
586 0 0 if ($i_partOf_Bj > 0) { }
587 0 0 if ($j_partOf_Bi > 0) { }
588 0 0 if ($mark_ji eq '\\boldmath $-$' and $mark_ij eq '\\ver{\\boldmath $-$}') { }
597 0 0 if ($j_partOf_Bi > 0) { }
624 0 0 unless (defined $mode)
634 0 0 if (defined $$sal{$source . 'Al'} and @{$$sal{$source . 'Al'};} > 0)
648 0 0 if ($mode eq 'contiguous')
651 0 0 if (@$sContiguousSeqs > 1 or @$tContiguousSeqs > 1)
661 0 0 if (defined $lex2) { }
668 0 0 if ($ibm1 > $bestIbm1Prob)
686 0 0 if (not $al->isIn($source . 'Al', $j, $i)) { }
712 0 0 if (@{$$al{'targetAl'};} > 0 and @{$$al{'sourceAl'};} > 0)
715 0 0 if (defined $$al{'sourceAl'}[$j])
717 0 0 if ($al->isIn('targetAl', $i, $j))
740 0 0 if (@{$$al{'targetAl'};} > 0 and @{$$al{'sourceAl'};} > 0) { }
0 0 elsif (@{$$al{'sourceAl'};} > 0) { }
743 0 0 if (defined $$al{$source . 'Al'}[$j])
746 0 0 unless ($al->isIn($target . 'Al', $i, $j))
767 0 0 unless (defined $criterion)
768 0 0 unless (defined $dontCountNull)
774 0 0 if ($dontCountNull) { }
778 0 0 if (defined $$al{'sourceAl'}[$j])
779 0 0 if (not $dontCountNull) { }
783 0 0 if ($i != 0)
789 0 0 if (defined $$al{'targetAl'}[$i])
790 0 0 if (not $dontCountNull) { }
794 0 0 if ($j != 0)
800 0 0 if ($numSource >= $numTarget and $criterion eq 'most' or $numSource < $numTarget and $criterion ne 'most') { }
802 0 0 if (defined $$al{'sourceAl'}[$j])
811 0 0 if (defined $$al{'targetAl'}[$i])
854 0 0 unless (defined $$swappedAl{$source . 'Al'}[$j])
882 0 0 unless (defined $refToWordsToAdd)
883 0 0 unless (defined $refToOtherSidePosi)
903 0 0 if ($side eq 'target')
915 0 0 if (defined $$al{'sourceAl'}[$j])
918 0 0 if ($j < $firstPos) { }
0 0 elsif ($j >= $firstPos and $j <= $lastPos) { }
922 0 0 if ($numList == 0)
925 0 0 unless (exists $modifs{$p}{$i})
947 0 0 if ($side eq 'target')
964 0 0 if ($side eq 'source') { }
991 0 0 if ($$change[0] eq '-') { }
1004 0 0 if ($numDel == 0) { }
1097 0 0 if (@{$$clust{$source};} > 1)
1101 0 0 if ($$clust{$source}[$c] != $$clust{$source}[$c - 1] + 1)
1106 0 0 if ($contiguous) { }
1142 0 0 if ($$al{$source . 'Words'}[$j] =~ /\@\@@/)
1156 0 0 if ($source eq 'source') { }
1164 0 0 if ($i == $pos + $offset)
1188 0 0 if ($side eq 'source') { }
1190 0 0 if (defined $$al{$side . 'Al'}[$j])
1191 0 0 if (@{$$al{$side . 'Al'}[$j];} == 1)
1193 0 0 if (defined $$al{$reverseSide . 'Al'}[$i])
1194 0 0 if (@{$$al{$reverseSide . 'Al'}[$i];} == 1 and $$al{$reverseSide . 'Al'}[$i][0] == $j)
1207 0 0 unless (defined $mode)
1223 0 0 if ($mode eq 'noAnchors') { }
1224 0 0 unless ($al->isAnchor($i, 'target'))
1241 0 0 if ($j != 0) { }
1247 0 0 if ($al->isIn('sourceAl', $j, $i))
1254 0 0 if ($i != 0) { }
1260 0 0 if ($al->isIn('targetAl', $i, $j))
1269 0 0 if ($targetInGap{$i})
1272 0 0 if ($sourceInGap{$j})
1285 0 0 if (@sortedSourceInGap == 0) { }
1292 0 0 if (@sortedTargetInGap == 0) { }
1305 0 0 if (scalar keys %targetToNull > 0)
1309 0 0 if (scalar keys %sourceToNull > 0)
1327 0 0 if ($sourceInGap{$j})
1340 0 0 if ($targetInGap{$i})
1360 132 0 if ($side eq 'sourceAl') { }
1381 0 0 if (defined $$al{'sourceAl'}[$j])
1386 0 0 if (defined $$al{'targetAl'}[$i])
1399 0 0 if (defined $$al{'sourceAl'}[$j])
1404 0 0 if (defined $$al{'targetAl'}[$i])
1418 0 0 unless (defined $direction)
1429 0 0 if (defined $$al{$direction . 'Al'}[$j])
1431 0 0 if ($i > 0)
1433 0 0 if (exists $scomp{$j} or exists $tcomp{$i}) { }
1435 0 0 if (exists $scomp{$j} and exists $tcomp{$i}) { }
0 0 elsif (exists $scomp{$j}) { }
0 0 elsif (exists $tcomp{$i}) { }
1436 0 0 if ($tcomp{$i} != $scomp{$j})
1438 0 0 if ($scomp{$j} < $tcomp{$i}) { }
1450 0 0 if ($val == $clustIndex2)
1451 0 0 if ($val > $clustIndex2)
1454 0 0 if ($val == $clustIndex2)
1455 0 0 if ($val > $clustIndex2)
1509 0 0 if (defined $$al{$source . 'Al'}[$j])
1511 0 0 if ($$al{$source . 'Links'}{$j . ' ' . $i}[0] ne 'p' and $$al{$source . 'Links'}{$j . ' ' . $i}[0] ne 'P')