File Coverage

blib/lib/Lingua/Ogmios/Annotations/Lemma.pm
Criterion Covered Total %
statement 9 33 27.2
branch 0 12 0.0
condition n/a
subroutine 3 8 37.5
pod 0 5 0.0
total 12 58 20.6


line stmt bran cond sub pod time code
1             package Lingua::Ogmios::Annotations::Lemma;
2              
3 16     16   68 use strict;
  16         23  
  16         576  
4 16     16   63 use warnings;
  16         73  
  16         524  
5              
6 16     16   63 use Lingua::Ogmios::Annotations::Element;
  16         24  
  16         4774  
7             our @ISA = qw(Lingua::Ogmios::Annotations::Element);
8              
9             #
10             #
11             #
12             #
13            
14             #
15             #
16             # refid_word, form?) >
17            
18             #
19             #
20             #
21             # (#PCDATA) >
22              
23             sub new {
24 0     0 0   my ($class, $fields) = @_;
25              
26 0 0         if (!defined $fields->{'id'}) {
27 0           $fields->{'id'} = -1;
28             }
29 0 0         if (!defined $fields->{'refid_word'}) { # refid_word
30 0           die("refid_word is not defined");
31             }
32 0 0         if (!defined $fields->{'canonical_form'}) { # canonical_form
33 0           die("canonical_form is not defined");
34             }
35 0           my $lemma = $class->SUPER::new({
36             '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 0         if (defined $fields->{'log_id'}) {
46 0           $lemma->setLogId($fields->{'log_id'});
47             }
48 0           return($lemma);
49             }
50              
51             sub refid_word {
52 0     0 0   my $self = shift;
53              
54 0 0         $self->{'refid_word'} = shift if @_;
55 0           return($self->{'refid_word'});
56             }
57              
58             sub canonical_form {
59 0     0 0   my $self = shift;
60              
61 0 0         $self->{"canonical_form"} = shift if @_;
62 0           return($self->{"canonical_form"});
63             }
64              
65             sub XMLout {
66 0     0 0   my ($self, $order) = @_;
67            
68 0           return($self->SUPER::XMLout("lemma", $order));
69             }
70              
71             sub reference {
72 0     0 0   my ($self) = @_;
73              
74 0           return([$self->refid_word]);
75             }
76              
77             1;
78              
79             __END__