Branch Coverage

blib/lib/Lingua/Treebank/Const.pm
Criterion Covered Total %
branch 41 276 14.8


line true false branch
36 0 0 unless defined $num
68 0 0 if ($STRINGIFY eq 'as_penn_text') { }
0 0 elsif ($STRINGIFY eq 'words') { }
0 0 elsif ($STRINGIFY eq 'preterm_tags') { }
94 0 0 defined $args{'keepterminal'} ? :
96 0 0 if (defined $args{'ignore'})
100 0 0 if defined $args{'coindex'}
105 0 0 if $ignore{$$_[0]}
107 0 0 if not $do_terminal and $$_[0] =~ /::/
109 0 0 if defined $coindex{$$_[1]}
110 0 0 if defined $coindex{$$_[2]}
119 0 0 if ($self->is_terminal)
144 0 0 if (scalar keys %is_phantom)
146 0 0 if ($is_phantom{$$_[0]})
170 0 0 if ($self->is_terminal) { }
187 0 0 unless defined $action
189 0 0 if (ref $action eq '') { }
0 0 elsif (not ref $action eq 'CODE') { }
191 0 0 unless (defined $action)
199 0 0 if (defined $stop_criterion)
200 0 0 if (ref $stop_criterion eq '') { }
0 0 elsif (not ref $stop_criterion eq 'CODE') { }
202 0 0 unless defined $stop_criterion
214 0 0 unless (defined $bf_traversal)
222 0 0 unless defined $node
226 0 0 if (defined $stop_criterion and &{$stop_criterion;}($node, $state))
233 0 0 if ($bf_traversal) { }
252 0 0 unless defined $cousin
253 0 0 unless UNIVERSAL::isa($cousin, 'Lingua::Treebank::Const')
257 0 0 if ($cousin->root != $matriarch)
267 0 0 if ($self_gramma == $cousin_gramma) { }
284 0 0 if ($self->is_terminal) { }
285 0 0 unless $other->is_terminal
287 0 0 if ($self->tag ne $other->tag)
290 0 0 if ($self->word ne $other->word)
299 0 0 if $other->is_terminal
302 0 0 if @{$self->children;} != @{$other->children;}
307 0 0 unless ($lchild->equiv_to($rchild))
332 0 0 if ($self == $target) { }
0 0 elsif ($self->is_root) { }
387 0 0 if ($self->is_terminal) { }
397 0 0 if ($max < $this_height)
409 0 0 if ($self->is_terminal)
414 0 0 unless ($self == $daughter->parent)
420 0 0 if ($self->children($_) == $daughter)
441 0 0 if ($self == $terminus) { }
0 0 elsif ($self->is_root) { }
450 0 0 if (not @path) { }
462 0 0 if ($self->is_root) { }
492 0 0 if &$criteria($self)
510 0 0 unless $node
512 0 0 if &$criteria($node)
526 2363 2144 if ($self->is_terminal) { }
540 0 0 if $self->is_root
546 0 0 if ($index == $#{$parent->children;})
556 0 0 if $self->is_root
562 0 0 if ($index == 0)
573 0 0 if ($self->is_terminal) { }
586 0 0 if ($self->is_terminal) { }
605 0 0 if (defined $left_sib) { }
611 0 0 if ($self->is_root) { }
629 0 0 if (defined $right_sib) { }
635 0 0 if ($self->is_root) { }
650 0 0 if ($self == $grandma)
653 0 0 if ($self->is_root) { }
687 0 0 if $self->is_root or $other->is_root
690 0 0 unless defined $parent
706 0 0 unless defined $step
707 0 0 unless defined $indentChar
708 0 0 unless defined $child_prolog
709 0 0 unless defined $child_epilog
713 0 0 if (defined $am_head)
714 0 0 if ($am_head)
720 0 0 if (defined $self->annot)
726 0 0 if ($self->is_terminal) { }
737 0 0 if (defined $head)
738 0 0 $head == $d ? :
759 0 0 if (s/^ \( \s* (.*) \s* \) $/$1/x) { }
0 0 elsif (/^([^_]+)_(\S+)$/) { }
768 0 0 if (/^\(/) { }
776 0 0 unless s/^(\S+)\s*//
827 0 4507 unless (defined $tag and defined $childrentext)
832 469 4038 if ($tag =~ / ^ ( [^-]+? ) ([-=]) ( .* ) $/x) { }
834 0 469 if ($2 ne '-')
835 0 0 if $VERBOSE
847 0 6521 if ($childrentext =~ s/^\s*__LPRN__\s*//) { }
0 6521 elsif ($childrentext =~ s/^\s*__RPRN__\s*//) { }
863 4158 2363 if (defined $childtext) { }
877 0 4158 if defined $self->word
882 0 2363 if ($childrentext =~ tr/()//)
895 0 2363 if @{$self->children;}
912 0 6870 if $nextR < $nextL
916 2363 4507 if $nextL == -1 and $nextR == -1
920 0 4507 if ($posn == -1)
928 0 40523 if ($nextR == -1)
931 22515 18008 if ($nextL == -1 or $nextR < $nextL) { }
953 0 0 if ($self->is_terminal)
960 0 0 if $daughter->is_terminal
988 0 0 if ($daughter->parent != $self)
994 0 0 if ($daughter->is_terminal)
1011 0 0 unless $target->parent == $self
1023 0 0 if $self->is_root
1030 0 0 if ($num_sibs == 1)
1053 0 0 unless (defined $index)
1059 0 0 unless (defined $d)
1067 0 0 if (defined $self->headchild and $self->headchild == $d)
1153 2363 2144 if (defined $$self[3]) { }
1154 0 2363 if (@{$self->children;})
1160 0 2144 unless (@{$self->children;})
1170 0 17330 if (@_ > 2)
1173 0 17330 if (@_ == 2)
1175 0 0 unless UNIVERSAL::isa($_[1], 'Lingua::Treebank::Const')
1182 0 17330 if (@_ == 1)
1183 0 0 if (ref $_[0] eq 'ARRAY') { }
1187 0 0 unless (UNIVERSAL::isa($_, 'Lingua::Treebank::Const'))
1213 0 0 if ($self->is_terminal)
1218 0 0 if ($kid == $head) { }
1237 0 0 if (not defined $parent or $parent->headterminal != $self)
1252 0 0 if ($self->is_terminal)
1257 0 0 unless defined $headchild
1264 0 0 if (@_) { }
1266 0 0 if (@_ > 1)
1270 0 0 unless UNIVERSAL::isa($val, 'Lingua::Treebank::Const')
1273 0 0 unless (grep {$val == $_;} @{$$self[5];})
1287 4158 0 if (@_) { }
1289 0 4158 if (@_ > 1)
1293 0 4158 unless UNIVERSAL::isa($val, 'Lingua::Treebank::Const')
1310 4507 0 if (@_) { }
1312 0 4507 if (@_ > 1)
1315 0 4507 if ref $_[0]
1326 469 0 if (@_) { }
1328 0 469 if (@_ > 1)
1331 0 469 if ref $_[0]
1342 2363 4158 if (@_) { }
1344 0 2363 if (@_ > 1)
1348 0 2363 if (@{$$self[5];})
1353 0 2363 if ref $_[0]
1377 0 0 if ($self->can($_)) { }