Block/W2A/CS/FixReflexivePronouns.pm

filter: Statementstmt 65.2% 15 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 33.3% 19 / 57 CC 9 SCAR 41.4
CC
9
Cov
34%
process_anode
90.0
BEGIN
1.0
BEGIN
1.0
CRAP 62.6
↑ Summary Block/W2A/CS/FixIsMember.pm »
1 package Treex::Block::W2A::CS::FixReflexivePronouns;
2 1 $Treex::Block::W2A::CS::FixReflexivePronouns::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  
8 1 extends 'Treex::Core::Block';
9  
10 0 ▶sub process_anode {
Subroutine process_anode: not called CC=9 SCAR=45.0
Pod undocumented
11  
12 0 my ( $self, $anode ) = @_;
13  
14 0 ▶ return if ( $anode->is_root );
Branch: 1 branch
BranchTrueFalseTotal
if $anode->is_root 0 0 0
15  
16 # fix the reflexive pronoun based on parser output
17 0 ▶ if ( $anode->form =~ m/^se$/i and $anode->tag =~ m/^RV/ and $anode->afun =~ m/^(AuxT|AuxR|Obj)$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($anode->form =~ /^se$/i and $anode->tag =~ /^RV/ and $anode->afun =~ /^(AuxT|AuxR|Obj)$/) 0 0 0
Condition0%0/6
$anode->form =~ /^se$/i and $anode->tag =~ /^RV/ and $anode->afun =~ /^(AuxT|AuxR|Obj)$/
!ll&&!rl&&r
000
$anode->form =~ /^se$/i and $anode->tag =~ /^RV/
!ll&&!rl&&r
000
MC/DC0%0/3
$anode->form =~ /^se$/i and $anode->tag =~ /^RV/ and $anode->afun =~ /^(AuxT|AuxR|Obj)$/
$anode->form =~ /^se$/i $anode->tag =~ /^RV/ $anode->afun =~ /^(AuxT|AuxR|Obj)$/
Truth table0%0/4
A and B and C
A= $anode->form =~ /^se$/iB= $anode->tag =~ /^RV/C= $anode->afun =~ /^(AuxT|AuxR|Obj)$/
ABCresult
0XX0
10X0
1100
1111
18 0 $anode->set_lemma('se_^(zvr._zájmeno/částice)');
19 0 $anode->set_tag('P7-X4----------');
20 }
21  
22 # fix parser output if the afun is impossible in the given case (not a reflexive pronoun, but reflexive-pronoun-only afuns)
23 0 ▶ if ( ( $anode->form !~ m/^se$/i && $anode->afun eq 'AuxR' ) || ( $anode->form !~ m/^s[ei]$/i && $anode->afun eq 'AuxT' ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $anode->form =~ /^se$/i and $anode->afun eq "AuxR" or not $anode->form =~ /^s[ei]$/i and $anode->afun eq "AuxT") 0 0 0
Condition0%0/9
not $anode->form =~ /^se$/i and $anode->afun eq "AuxR" or not $anode->form =~ /^s[ei]$/i and $anode->afun eq "AuxT"
l!l&&r!l&&!r
000
not $anode->form =~ /^se$/i and $anode->afun eq "AuxR"
!ll&&!rl&&r
000
not $anode->form =~ /^s[ei]$/i and $anode->afun eq "AuxT"
!ll&&!rl&&r
000
MC/DC0%0/4
not $anode->form =~ /^se$/i and $anode->afun eq "AuxR" or not $anode->form =~ /^s[ei]$/i and $anode->afun eq "AuxT"
not $anode->form =~ /^se$/i $anode->afun eq "AuxR" not $anode->form =~ /^s[ei]$/i $anode->afun eq "AuxT"
Truth table0%0/7
not(A) and B or not(C) and D
A= not $anode->form =~ /^se$/iB= $anode->afun eq "AuxR"C= not $anode->form =~ /^s[ei]$/iD= $anode->afun eq "AuxT"
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
24 0 $anode->set_afun('Obj');
25 }
26  
27 0 return;
28 }
29  
30 1 1;
31 __END__
↑ Summary Block/W2A/CS/FixIsMember.pm »