Block/W2A/JA/FixCopulas.pm

filter: Statementstmt 64.2% 18 / 28 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 52.2% 23 / 44 CC 5 SCAR 21.8
CC
5
Cov
55%
fix_subtree
20.0
process_atree
6.0
BEGIN
1.0
CRAP 8.8
« Block/W2A/JA/RehangAuxVerbs.pm ↑ Summary Block/W2A/JA/ParseJDEPP.pm »
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
BranchTrueFalseTotal
if ($lemma eq "\x{3058}\x{3083}" or $lemma eq "\x{3067}\x{306f}") 0 0 0
Condition0%0/3
$lemma eq "\x{3058}\x{3083}" or $lemma eq "\x{3067}\x{306f}"
l!l&&r!l&&!r
000
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}"
ABresult
1X1
011
000
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__
« Block/W2A/JA/RehangAuxVerbs.pm ↑ Summary Block/W2A/JA/ParseJDEPP.pm »