Block/W2A/CS/FixReflexiveTantum.pm

filter: Statementstmt 63.6% 21 / 33 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 45.0% 27 / 60 CC 7 SCAR 33.5
CC
7
Cov
45%
process_anode
56.0
__ANON__
2.0
BEGIN
1.0
CRAP 28.6
« Block/W2A/CS/FixAtreeAfterMcD.pm ↑ Summary Tool/Lexicon/CS/Reflexivity.pm »
1 package Treex::Block::W2A::CS::FixReflexiveTantum;
2 1 $Treex::Block::W2A::CS::FixReflexiveTantum::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 ▶use Treex::Tool::Lexicon::CS;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Treex::Tool::Lexicon::CS::Reflexivity;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 extends 'Treex::Core::Block';
12  
13 0 ▶sub process_anode {
Subroutine process_anode: not called CC=7 SCAR=40.3
Pod undocumented
14  
15 0 my ( $self, $anode ) = @_;
16 0 my ($refl) = grep { $_->afun eq 'AuxT' } $anode->get_children();
17  
18 0 ▶ return if ( !$refl );
Branch: 1 branch
BranchTrueFalseTotal
unless $refl 0 0 0
19  
20 0 my $tantum_lemma = Treex::Tool::Lexicon::CS::truncate_lemma( $anode->lemma, 1 ) . '_' . lc( $refl->form );
21  
22 # the particle 'se/si' is marked as reflexive tantum, but that's not possible with the given verb
23 0 ▶ if ( !Treex::Tool::Lexicon::CS::Reflexivity::is_possible_tantum($tantum_lemma) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (Treex::Tool::Lexicon::CS::Reflexivity::is_possible_tantum($tantum_lemma)) 0 0 0
24  
25 # make an adverbial ("free dative") out of it, if the particle is 'si' and there is another object besides it
26 0 ▶ if ( $refl->form eq 'si' and any { $_->afun eq 'Obj' } $anode->get_echildren( { or_topological => 1 } ) ) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 2 branches
BranchTrueFalseTotal
if ($refl->form eq 'si' and &any(sub { $_->afun eq 'Obj'; } , $anode->get_echildren({'or_topological', 1}))) { } 0 0 0
elsif ($anode->tag =~ /^V(......[12]|f)/ or $refl->form eq 'si') { } 0 0 0
Condition0%0/3
$refl->form eq "si" and &any(sub { $_->afun eq "Obj"; } , $anode->get_echildren({"or_topological", 1}))
!ll&&!rl&&r
000
MC/DC0%0/2
$refl->form eq "si" and &any(sub { $_->afun eq "Obj"; } , $anode->get_echildren({"or_topological", 1}))
$refl->form eq "si" &any(sub { $_->afun eq "Obj"; } , $anode->get_echildren({"or_topological", 1}))
Truth table0%0/3
A and B
A= $refl->form eq "si"B= &any(sub { $_->afun eq "Obj"; } , $anode->get_echildren({"or_topological", 1}))
ABresult
0X0
100
111
27 0 $refl->set_afun('Adv');
28 }
29  
30 # make an object out of it, if the verb is in 1st or 2nd person, is an infinitive or the particle is 'si'
31 # (i.e. all cases where a reflexive passive is unlikely)
32 ▶ elsif ( $anode->tag =~ m/^V(......[12]|f)/ or $refl->form eq 'si' ) {
Condition0%0/3
$anode->tag =~ /^V(......[12]|f)/ or $refl->form eq "si"
l!l&&r!l&&!r
000
MC/DC0%0/2
$anode->tag =~ /^V(......[12]|f)/ or $refl->form eq "si"
$anode->tag =~ /^V(......[12]|f)/ $refl->form eq "si"
Truth table0%0/3
A or B
A= $anode->tag =~ /^V(......[12]|f)/B= $refl->form eq "si"
ABresult
1X1
011
000
33 0 $refl->set_afun('Obj');
34 }
35  
36 # otherwise make a reflexive passive marker out of it
37 else {
38 0 $refl->set_afun('AuxR');
39 }
40 }
41 0 return;
42 }
43  
44 1 1;
45 __END__
« Block/W2A/CS/FixAtreeAfterMcD.pm ↑ Summary Tool/Lexicon/CS/Reflexivity.pm »