| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
Condition0%0/3
$refl->form eq "si" and &any(sub {
$_->afun eq "Obj";
}
, $anode->get_echildren({"or_topological", 1}))
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}))
| |||||||||||||||||||||||||||||||||
| 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"
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"
| |||||||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||||||