blib/lib/PMLTQ/Relation/PDT/TEParentIterator.pm

filter: Statementstmt 67.7% 21 / 31 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 2 totaltotal 62.7% 27 / 43 CC 4 SCAR 20.8
CC
4
Cov
64%
dump_relation
20.0
get_node_list
2.0
BEGIN
1.0
CRAP 8.0
« blib/lib/PMLTQ/Relation/PDT/AEParentIterator.pm ↑ Summary blib/lib/PMLTQ/Command/verify.pm »
1 package PMLTQ::Relation::PDT::TEParentIterator;
2 11 our $AUTHORITY = 'cpan:MATY';
3 11 $PMLTQ::Relation::PDT::TEParentIterator::VERSION = '1.2.2';
4 # ABSTRACT: Effective parent relation iterator on t-nodes for PDT like treebanks
5  
6 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 ▶use base qw(PMLTQ::Relation::SimpleListIterator);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 11 ▶use PMLTQ::PML2BASE;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 use PMLTQ::Relation {
11 11 name => 'eparent',
12 table_name => 'tdata__#eparents',
13 schema => 'tdata',
14 tree_root => 't-root',
15 reversed_relation => 'implementation:echild',
16 start_node_type => 't-node',
17 target_node_type => 't-node',
18 iterator_class => __PACKAGE__,
19 iterator_weight => 2,
20 test_code => q( grep($_ == $end, PMLTQ::Relation::PDT::TGetEParents($start)) ? 1 : 0 ),
21 11 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
22 11 ▶use PMLTQ::Relation::PDT;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 sub get_node_list {
25 0 ▶ my ($self, $node) = @_;
Subroutine get_node_list: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my $type = $node->type->get_base_type_name;
27 0 my $fsfile = $self->start_file;
28 0 return [ map [ $_, $fsfile ], PMLTQ::Relation::PDT::TGetEParents($node) ];
29 }
30  
31 sub dump_relation {
32 0 ▶ my ($tree,$hash,$fh)=@_;
Subroutine dump_relation: not called CC=4 SCAR=30.0
Pod undocumented
33  
34 0 my $name = $tree->type->get_schema->get_root_name;
35 0 ▶ die 'Trying dump relation eparent for incompatible schema' unless $name =~ /^tdata/;
Branch: 1 branch
BranchTrueFalseTotal
unless $name =~ /^tdata/ 0 0 0
36  
37 0 for my $node ($tree->descendants) {
38 0 for my $p (PMLTQ::Relation::PDT::TGetEParents($node)) {
39 0 $fh->print(PMLTQ::PML2BASE::mkdump($hash->{$node}{'#idx'},$hash->{$p}{'#idx'}));
40 }
41 }
42 }
43  
44 11 1;
45  
46 __END__
« blib/lib/PMLTQ/Relation/PDT/AEParentIterator.pm ↑ Summary blib/lib/PMLTQ/Command/verify.pm »