PML2BASE/Relation/Treex/TEParentIterator.pm

filter: Statementstmt 60.0% 12 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 46.8% 15 / 32 CC 6 SCAR 33.4
CC
6
Cov
46%
dump_relation
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 28.3
« PML2BASE/Relation/Treex/AEParentIterator.pm ↑ Summary PML2BASE/Relation/PDT/AEParentIterator.pm »
1 package PMLTQ::PML2BASE::Relation::Treex::TEParentIterator;
2 6 our $AUTHORITY = 'cpan:MATY';
3 6 $PMLTQ::PML2BASE::Relation::Treex::TEParentIterator::VERSION = '3.0.1';
4 # ABSTRACT: Effective parent relation iterator on t-nodes for Treex treebanks
5  
6 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use PMLTQ::PML2BASE;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub dump_relation {
Subroutine dump_relation: not called CC=6 SCAR=37.4
Pod undocumented
11 0 my ($tree, $hash, $fh ) = @_;
12 0 my $name = $tree->type->get_schema->get_root_name;
13 0 ▶ die 'Trying dump relation eparent for incompatible schema' unless $name =~ /^treex_document/;
Branch: 1 branch
BranchTrueFalseTotal
unless $name =~ /^treex_document/ 0 0 0
14  
15 0 ▶ my $struct_name = $tree->type->get_structure_name || '';
Condition0%0/2
$tree->type->get_structure_name || ''
l!l
00
MC/DC0%0/1
$tree->type->get_structure_name || ''
$tree->type->get_structure_name
Truth table0%0/2
A
A= $tree->type->get_structure_name
Aresult
11
00
16 0 ▶ return unless $struct_name eq 't-root';
Branch: 1 branch
BranchTrueFalseTotal
unless $struct_name eq "t-root" 0 0 0
17  
18 0 for my $node ( $tree->descendants ) {
19 0 for my $p ( PMLTQ::Relation::Treex::TGetEParents($node) ) {
20 0 $fh->print( PMLTQ::PML2BASE::mkdump( $hash->{$node}{'#idx'}, $hash->{$p}{'#idx'} ) );
21 }
22 }
23 }
24  
25 6 1;
26  
27 __END__
« PML2BASE/Relation/Treex/AEParentIterator.pm ↑ Summary PML2BASE/Relation/PDT/AEParentIterator.pm »