| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Condition0%0/6
$anode->form =~ /^se$/i and $anode->tag =~ /^RV/ and $anode->afun =~ /^(AuxT|AuxR|Obj)$/
$anode->form =~ /^se$/i and $anode->tag =~ /^RV/
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)$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
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"
not $anode->form =~ /^se$/i and $anode->afun eq "AuxR"
not $anode->form =~ /^s[ei]$/i and $anode->afun eq "AuxT"
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"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | $anode->set_afun('Obj'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||