Branch Coverage

blib/lib/Text/Positional/Ngram.pm
Criterion Covered Total %
branch 59 142 41.5


line true false branch
124 1 0 if defined(@_ > 0)
125 0 1 @_ ? :
127 0 1 if $$self{'verbose'}
128 0 1 if $$self{'verbose'}
156 0 1 unless open VOCAB, ">$VOCAB_FILE"
157 0 1 unless open SNT, ">$SNT_FILE"
160 0 1 if ($NONTOKEN_FILE ne '')
170 0 1 unless open CORPUS, $_
179 18 4 if (not exists $vocab_hash{$token}) { }
188 0 3 if $new_line
223 1 0 if (-e $TOKEN_FILE) { }
224 0 1 unless open TOKEN, $TOKEN_FILE
228 0 1 if (length $_ <= 0)
229 0 1 unless (m[^/] and m[/$])
246 0 1 if (length $tokenizerRegex > 0)
256 0 1 if ($#tokenRegex < 0)
272 0 0 if ($NONTOKEN_FILE) { }
275 0 0 unless open NOTOK, $NONTOKEN_FILE
282 0 0 if (/^\s*$/)
284 0 0 unless (m[^/])
288 0 0 unless (m[/$])
301 0 0 if (length $nontokenizerRegex <= 0)
325 0 0 unless open FILE, $file
333 0 0 if (/^\s*$/)
336 0 0 unless (m[^/])
340 0 0 unless (m[/$])
353 0 0 if (length $stop_regex <= 0)
371 0 1 unless open VOCAB, $VOCAB_FILE
515 1 0 if $window_size == 0
519 0 1 if $window_size > $ngram_size
537 0 1 unless open SNT, $SNT_FILE
567 4 84 if ($i + $ngram_size > $N + 1)
570 42 42 if ($bits[0] != 1)
573 21 21 if ($size != $ngram_size)
598 0 0 if (vec($win, $j, $win_bit) == 1)
613 0 1 unless open SNTNGRAM, ">$SNTNGRAM_FILE"
617 1 0 unless (@vocab_array)
626 42 0 if vec($win, $_, $win_bit) == 1
629 0 21 if ($ngram[$#ngram] == 0)
632 1 20 if ($#prev == -1) { }
20 0 elsif (join(' ', @ngram) ne join(' ', @prev)) { }
642 20 0 if ($return_value == 1)
651 1 0 if ($return_value == 1)
669 0 21 if ($stop_flag)
672 0 0 if ($stop_mode =~ /OR|or/) { }
676 0 0 if ($token_ngram[$i] =~ /$stop_regex/)
0 0 if ($stop_mode =~ /OR|or/) { }
679 0 0 unless ($token_ngram[$i] =~ /$stop_regex/)
682 0 0 if ($doStop and $marginals)
684 0 0 if (exists $remove_hash{$_ . ':' . $ngram[$_]}) { }
693 0 0 if ($_ == 1)
0 21 if ($new_line)
698 21 0 if ($doStop == 0 and $line == 0)
699 21 0 if ($remove <= $freq) { }
701 21 0 if ($frequency <= $freq)
705 0 0 if (exists $remove_hash{$_ . ':' . $ngram[$_]}) { }
721 0 1 unless open SNTNGRAM, $SNTNGRAM_FILE
724 0 1 unless open NGRAM, ">$NGRAM_FILE"
727 0 1 unless (@vocab_array)
738 21 0 if ($marginals)
757 21 21 if ($i == 0)
758 0 21 if ($_[$i] == vec($corpus, $N, $bit))
760 21 21 if ($i == $#_)
761 0 21 if ($_[$i] == vec($corpus, 0, $bit))
764 0 42 if ($stop_flag or $remove > 0)
765 0 0 if (exists $remove_hash{$i . ':' . $_[$i]})
782 120 0 if (vec($a, $i, $win_bit) == 1)
783 120 0 if (vec($b, $i, $win_bit) == 1)
787 115 5 if ($a_array[$z] != $b_array[$z])
789 30 0 $a_array[$x] < $b_array[$x] ? :
30 30 $a_array[$x] > $b_array[$x] ? :