| 1 | package Treex::Block::W2A::CS::FixAtreeAfterMcD; | ||||||||||||||||||||||||||||
| 2 | 1 | $Treex::Block::W2A::CS::FixAtreeAfterMcD::VERSION = '2.20151102'; | |||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Treex::Core::Common; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | extends 'Treex::Core::Block'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub process_atree { | ||||||||||||||||||||||||||
|
Subroutine
process_atree: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 0 | my ( $self, $a_root ) = @_; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | foreach my $a_node ( $a_root->get_descendants ) { | |||||||||||||||||||||||||||
| 13 | 0 | ▶ | if ( $a_node->afun eq "AuxX" || $a_node->afun eq "AuxG" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$a_node->afun eq "AuxX" or $a_node->afun eq "AuxG"
MC/DC0%0/2
$a_node->afun eq "AuxX" or $a_node->afun eq "AuxG"
$a_node->afun eq "AuxX"
$a_node->afun eq "AuxG"
Truth table0%0/3
A or B
A= $a_node->afun eq "AuxX"B= $a_node->afun eq "AuxG"
| |||||||||||||||||||||||||||||
| 14 | 0 | my @children = $a_node->get_children(); | |||||||||||||||||||||||||||
| 15 | 0 | my $ch = $children[0]; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | if ( defined $ch && $ch->is_member ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $ch and $ch->is_member
MC/DC0%0/2
defined $ch and $ch->is_member
defined $ch
$ch->is_member
Truth table0%0/3
A and B
A= defined $chB= $ch->is_member
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | # _Co under AuxX => change AuxX to Coord | ||||||||||||||||||||||||||||
| 19 | 0 | $a_node->set_afun('Coord'); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | my @root_children = grep { $_->afun ne "AuxK" } $a_root->get_children; | |||||||||||||||||||||||||||
| 25 | 0 | foreach my $i ( 1 .. $#root_children ) { | |||||||||||||||||||||||||||
| 26 | 0 | $root_children[$i]->set_parent( $root_children[0] ); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | return; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | __END__ | ||||||||||||||||||||||||||||