| 1 | package Treex::Block::W2A::JA::FixCopulas; | ||||||||||||||||||||||||||||
| 2 | 1 | $Treex::Block::W2A::JA::FixCopulas::VERSION = '0.13095'; | |||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Treex::Core::Common; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Encode; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | extends 'Treex::Core::Block'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # TODO: "では" is actually tokenized as "で" and "は" (both tokens marked as particles). Where should we fix this? | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub process_atree { | ||||||||||||||||||||||||||
|
Subroutine
process_atree: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 0 | my ( $self, $a_root ) = @_; | |||||||||||||||||||||||||||
| 17 | 0 | foreach my $child ( $a_root->get_children() ) { | |||||||||||||||||||||||||||
| 18 | 0 | fix_subtree($child); | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 0 | return 1; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub fix_subtree { | ||||||||||||||||||||||||||
|
Subroutine
fix_subtree: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 0 | my ($a_node) = @_; | |||||||||||||||||||||||||||
| 25 | 0 | my $lemma = $a_node->lemma; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # we change lemma of "じゃ" and "では" | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ( $lemma eq "じゃ" || $lemma eq "では" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$lemma eq "\x{3058}\x{3083}" or $lemma eq "\x{3067}\x{306f}"
MC/DC0%0/2
$lemma eq "\x{3058}\x{3083}" or $lemma eq "\x{3067}\x{306f}"
$lemma eq "\x{3058}\x{3083}"
$lemma eq "\x{3067}\x{306f}"
Truth table0%0/3
A or B
A= $lemma eq "\x{3058}\x{3083}"B= $lemma eq "\x{3067}\x{306f}"
| |||||||||||||||||||||||||||||
| 29 | 0 | foreach my $child ( $a_node->get_children() ) { | |||||||||||||||||||||||||||
| 30 | 0 | $a_node->set_lemma("です"); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 0 | return; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | 1; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||