Parser/Section/DerivedTerms.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 4 totaltotal 82.5% 33 / 40 CC 4 SCAR 8.9
CC
4
Cov
93%
add_content
4.0
get_derived_terms
2.0
BEGIN
1.0
CRAP 2.4
« Parser/Section/PartofSpeech.pm ↑ Summary Parser/Section/Pronunciation/Representation.pm »
1 package Wiktionary::Parser::Section::DerivedTerms;
2  
3 3 ▶use Wiktionary::Parser::Section;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 ▶use base qw(Wiktionary::Parser::Section);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
8 2 my $class = shift;
9 2 my %args = @_;
10 2 my $self = bless Wiktionary::Parser::Section->new(%args), $class;
11 2 return $self;
12 }
13  
14 52 ▶sub add_content {
Subroutine add_content: called CC=4 SCAR=13.9
Pod undocumented
15 52 my $self = shift;
16 52 my $line = shift;
17  
18 52 my $language = $self->get_language();
19  
20 52 ▶ if (my @templates = $self->get_template_parser()->extract_templates(line => $line)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@templates) = $self->get_template_parser->extract_templates("line", $line)) 4 48 52
21
22 }
23  
24 52 ▶ if (my @tokens = $self->get_template_parser()->extract_tokens(line => $line)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@tokens) = $self->get_template_parser->extract_tokens("line", $line)) 48 4 52
25 48 for my $term (@tokens) {
26 50 $self->add_derived_term(term => $term, language => $language);
27 }
28 }
29
30  
31  
32 }
33  
34 50 ▶sub add_derived_term {
Subroutine add_derived_term: called CC=1 SCAR=0.0
Pod undocumented
35 50 my $self = shift;
36 50 my %args = @_;
37 50 my $term = $args{term};
38 50 my $language = $args{language};
39 50 push @{$self->{derived_terms}{$language}}, $term;
40 }
41  
42 0 ▶sub get_derived_terms {
Subroutine get_derived_terms: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my $self = shift;
44 0 return $self->{derived_terms};
45 }
46  
47  
48 3 1;
« Parser/Section/PartofSpeech.pm ↑ Summary Parser/Section/Pronunciation/Representation.pm »