line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wiktionary::Parser::Section::DerivedTerms; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
19
|
use Wiktionary::Parser::Section; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
102
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
20
|
use base qw(Wiktionary::Parser::Section); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1155
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
2
|
|
|
2
|
0
|
4
|
my $class = shift; |
9
|
2
|
|
|
|
|
7
|
my %args = @_; |
10
|
2
|
|
|
|
|
13
|
my $self = bless Wiktionary::Parser::Section->new(%args), $class; |
11
|
2
|
|
|
|
|
7
|
return $self; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub add_content { |
15
|
52
|
|
|
52
|
0
|
68
|
my $self = shift; |
16
|
52
|
|
|
|
|
60
|
my $line = shift; |
17
|
|
|
|
|
|
|
|
18
|
52
|
|
|
|
|
145
|
my $language = $self->get_language(); |
19
|
|
|
|
|
|
|
|
20
|
52
|
100
|
|
|
|
195
|
if (my @templates = $self->get_template_parser()->extract_templates(line => $line)) { |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
52
|
100
|
|
|
|
147
|
if (my @tokens = $self->get_template_parser()->extract_tokens(line => $line)) { |
25
|
48
|
|
|
|
|
80
|
for my $term (@tokens) { |
26
|
50
|
|
|
|
|
113
|
$self->add_derived_term(term => $term, language => $language); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub add_derived_term { |
35
|
50
|
|
|
50
|
0
|
56
|
my $self = shift; |
36
|
50
|
|
|
|
|
114
|
my %args = @_; |
37
|
50
|
|
|
|
|
88
|
my $term = $args{term}; |
38
|
50
|
|
|
|
|
64
|
my $language = $args{language}; |
39
|
50
|
|
|
|
|
49
|
push @{$self->{derived_terms}{$language}}, $term; |
|
50
|
|
|
|
|
372
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_derived_terms { |
43
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
44
|
0
|
|
|
|
|
|
return $self->{derived_terms}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |