blib/lib/Lingua/Ogmios/Annotations/Lemma.pm

filter: Statementstmt 31.4% 11 / 35 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 23.3% 14 / 60 CC 7 SCAR 25.6
CC
7
Cov
23%
new
30.0
refid_word
6.0
canonical_form
6.0
CRAP 12.9
« blib/lib/Lingua/Ogmios/NLPWrappers/TermMeasures.pm ↑ Summary blib/lib/Lingua/Ogmios/NLPWrappers/BasicWordSegmentizer.pm »
1 package Lingua::Ogmios::Annotations::Lemma;
2  
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 16 ▶use Lingua::Ogmios::Annotations::Element;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 our @ISA = qw(Lingua::Ogmios::Annotations::Element);
8  
9 # <!-- =================================================== -->
10 # <!-- LEMMA LEVEL -->
11 # <!-- =================================================== -->
12 # <!ELEMENT lemma_level (log_id?, comments*, lemma+) >
13
14 # <!-- lemma -->
15 # <!ELEMENT lemma (id, log_id?, canonical_form+,
16 # refid_word, form?) >
17
18 # <!-- canonical form of the word -->
19 # <!-- corresponding to the lemma -->
20 # <!ELEMENT canonical_form
21 # (#PCDATA) >
22  
23 0 ▶sub new {
Subroutine new: not called CC=5 SCAR=34.0
Pod undocumented
24 0 my ($class, $fields) = @_;
25  
26 0 ▶ if (!defined $fields->{'id'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"id"}) 0 0 0
27 0 $fields->{'id'} = -1;
28 }
29 0 ▶ if (!defined $fields->{'refid_word'}) { # refid_word
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"refid_word"}) 0 0 0
30 0 die("refid_word is not defined");
31 }
32 0 ▶ if (!defined $fields->{'canonical_form'}) { # canonical_form
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"canonical_form"}) 0 0 0
33 0 die("canonical_form is not defined");
34 }
35 my $lemma = $class->SUPER::new({
36 0 'id' => $fields->{'id'},
37 # 'form' => $fields->{'form'},
38 }
39 );
40 0 bless ($lemma,$class);
41  
42 0 $lemma->canonical_form($fields->{'canonical_form'});
43 0 $lemma->refid_word($fields->{'refid_word'});
44  
45 0 ▶ if (defined $fields->{'log_id'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fields->{"log_id"}) 0 0 0
46 0 $lemma->setLogId($fields->{'log_id'});
47 }
48 0 return($lemma);
49 }
50  
51 0 ▶sub refid_word {
Subroutine refid_word: not called CC=2 SCAR=17.9
Pod undocumented
52 0 my $self = shift;
53  
54 0 ▶ $self->{'refid_word'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
55 0 return($self->{'refid_word'});
56 }
57  
58 0 ▶sub canonical_form {
Subroutine canonical_form: not called CC=2 SCAR=17.9
Pod undocumented
59 0 my $self = shift;
60  
61 0 ▶ $self->{"canonical_form"} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
62 0 return($self->{"canonical_form"});
63 }
64  
65 0 ▶sub XMLout {
Subroutine XMLout: not called CC=1 SCAR=6.9
Pod undocumented
66 0 my ($self, $order) = @_;
67
68 0 return($self->SUPER::XMLout("lemma", $order));
69 }
70  
71 0 ▶sub reference {
Subroutine reference: not called CC=1 SCAR=6.9
Pod undocumented
72 0 my ($self) = @_;
73  
74 0 return([$self->refid_word]);
75 }
76  
77 16 1;
78  
79 __END__
« blib/lib/Lingua/Ogmios/NLPWrappers/TermMeasures.pm ↑ Summary blib/lib/Lingua/Ogmios/NLPWrappers/BasicWordSegmentizer.pm »