Branch Coverage

blib/lib/RDF/NLP/SPARQLQuery/Question.pm
Criterion Covered Total %
branch 84 130 64.6


line true false branch
121 9 322 if (@_) { }
124 18 304 unless (defined $$self{'sortedSemanticUnits'})
142 279 12 if (@_) { }
144 269 10 unless (exists $$self{'termIndex'}{$offset})
149 12 0 if (exists $$self{'termIndex'}{$offset}) { }
172 0 0 if ($self->semanticUnits->[$i]{'id'} == $$term{'id'})
178 0 0 if ($deleted == 0)
190 0 0 if ($self->_termIndex($$term{'start_offset'})->[$i]{'id'} == $$term{'id'})
196 0 0 if ($deleted == 0)
330 9 0 if (defined $self->questionTopic) { }
349 29 2 unless (exists $term2semFeatures{$$term{'semanticUnit'}})
357 9 22 if (scalar @{$semCat;} > 1) { }
1 21 elsif (scalar @{$semCat;} == 1 and exists $self->semanticCorrespondance->{$self->language}{'CONST'}{$$semCat[0]}) { }
1 20 elsif (scalar @{$semCat;} == 1 and $$semCat[0] eq 'STRING') { }
1 19 elsif (scalar @{$semCat;} == 1 and $$semCat[0] eq 'REGEX') { }
0 19 elsif (scalar @{$semCat;} == 1 and $$semCat[0] eq 'conjunction') { }
19 0 elsif (scalar @{$semCat;} == 1) { }
359 8 1 if (exists $self->semanticCorrespondance->{$self->language}{'RESOURCE'}{$$semCat[0] . '/' . $$semCat[1]}{'CORRESP'} and exists $self->semanticCorrespondance->{$self->language}{'RESOURCE'}{$$semCat[0] . '/' . $$semCat[1]}{'CORRESP'}{$$semCat[$#$semCat - 1]}) { }
370 9 0 unless (exists $self->semFeaturesIndex->{$indexCat})
391 1 0 unless (exists $self->semFeaturesIndex->{$indexCat})
408 1 0 unless (exists $self->semFeaturesIndex->{$indexCat})
425 0 1 if ($conjunction2 eq 1) { }
435 0 0 if ($self->_regexForm == 1) { }
440 0 0 unless (exists $self->semFeaturesIndex->{$indexCat2})
458 1 0 if ($self->_regexForm == 1) { }
463 1 0 unless (exists $self->semFeaturesIndex->{$indexCat})
482 11 8 if (not exists $viewedPredicates{$$semCat[0]} and exists $self->semanticCorrespondance->{$self->language}{'PREDICATE'}{$$semCat[0]})
488 0 11 if (exists $self->negation->{$$term{'id'}})
492 0 55 if (exists $self->aggregation->{'TERM'}{$aggregOp}{$$term{'id'}})
532 1 31 if (scalar keys %{$$term{'semanticTypes'};} == 0)
537 6 0 if ($self->_getTerms($offset))
539 0 6 if ($$subterm{'id'} != $$term{'id'})
541 0 0 if (scalar keys %{$$subterm{'semanticTypes'};} > 0)
593 4 28 if (exists $self->semanticCorrespondance->{$self->language}{'CTXTL_REWRITE'}{'RULE'}{$semf}) { }
594 2 2 if (ref $self->semanticCorrespondance->{$self->language}{'CTXTL_REWRITE'}{'RULE'}{$semf} eq 'HASH') { }
610 0 14 if ($semf2 eq $$rule{'CTXT'} or index($semf2, $$rule{'CTXT'} . ':') == 0 or index($semf2, $$rule{'CTXT'} . '/') == 0 or index($semf2, ':' . $$rule{'CTXT'}) > 0)
613 0 2 if ($$rule{'NEWCTXT'} eq '') { }
2 0 elsif ($$rule{'NEWCTXT'} ne '-') { }
628 0 2 if ($newsemf eq '') { }
1 1 elsif ($$rule{'NEWSF'} ne '-') { }
674 31 1 if (scalar keys %{$$term{'semanticTypes'};} > 0) { }
679 0 33 if ($semf eq 'conjunction')
697 9 23 if (scalar @terms == 0) { }
700 1 22 if ($$term{'start_offset'} == $terms[$#terms]{'start_offset'}) { }
703 1 21 if (scalar @terms > 1) { }
716 0 9 if (scalar @terms > 1) { }
729 9 22 if (scalar @terms == 0) { }
732 2 20 if ($$term{'end_offset'} <= $terms[$#terms]{'end_offset'}) { }
741 0 9 if (scalar @terms > 1) { }
773 3 21 if ($$tmpTerm{'id'} != $$largerTerm{'id'})
774 0 3 if ($$tmpTerm{'start_offset'} < $$largerTerm{'start_offset'} or $$largerTerm{'end_offset'} < $$tmpTerm{'end_offset'})
798 29 0 if (scalar keys %{$$term{'semanticTypes'};} > 0)
803 11 20 if (exists $self->semanticCorrespondance->{$self->language}{'PREDICATE'}{$semf})
804 0 11 if ($neg == 1)
810 0 31 if ($semf eq 'negation')
832 29 0 if (scalar keys %{$$term{'semanticTypes'};} > 0)
837 0 31 if (exists $self->aggregation->{'TERM'}{$semf})
841 19 12 if (exists $self->semanticCorrespondance->{$self->language}{'VARIABLE'}{$semf})
842 0 19 if (scalar @aggregOp != 0)
850 0 31 if ($semf eq 'exists')
872 9 0 if ($i < scalar @{$self->_sortedSemanticUnits;})
881 9 1 if (exists $self->semanticCorrespondance->{$self->language}{'VARIABLE'}{$questionTopicCat}) { }
887 0 45 if (exists $self->aggregation->{'TERM'}{$aggregOp}{$self->_sortedSemanticUnits->[$i]{'id'}})
910 99 195 unless (defined $level)
914 0 294 if ($self->verbose > 0 and $self->verbose >= $level)