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

filter: Statementstmt 23.9% 11 / 46 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 18.6% 14 / 75 CC 10 SCAR 29.3
CC
10
Cov
18%
new
42.0
list_refid_semantic_unit
12.0
anaphora
6.0
CRAP 18.6
« blib/lib/Lingua/Ogmios/Annotations/Element.pm ↑ Summary blib/lib/Lingua/Ogmios/NLPWrappers/TermMeasures.pm »
1 package Lingua::Ogmios::Annotations::AnaphoraRelation;
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 # <!-- ANAPHORA_RELATION_LEVEL -->
11 # <!-- =================================================== -->
12 # <!ELEMENT anaphora_relation_level
13 # (log_id?, comments*,
14 # anaphora_relation+) >
15 # <!-- anaphora_relation -->
16 # <!ELEMENT anaphora_relation
17 # (id, log_id?,
18 # anaphora_relation_type,
19 # anaphora, antecedent) >
20
21 # <!ELEMENT antecedent (list_refid_semantic_unit)+ >
22 # <!ELEMENT anaphora
23 # (refid_semantic_unit) >
24
25
26 # <!-- anaphora_relation_type -->
27 # <!ELEMENT anaphora_relation_type
28 # (#PCDATA) >
29  
30 0 ▶sub new {
Subroutine new: not called CC=6 SCAR=37.4
Pod undocumented
31 0 my ($class, $fields) = @_;
32  
33 0 ▶ if (!defined $fields->{'id'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"id"}) 0 0 0
34 0 $fields->{'id'} = -1;
35 }
36 0 ▶ if (!defined $fields->{'anaphora_relation_type'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"anaphora_relation_type"}) 0 0 0
37 0 die("anaphora_relation_type is not defined");
38 }
39 0 ▶ if (!defined $fields->{'anaphora'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"anaphora"}) 0 0 0
40 0 die("anaphora is not defined");
41 }
42 0 ▶ if (!defined $fields->{'antecedent'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $fields->{"antecedent"}) 0 0 0
43 0 die("antecedent is not defined");
44 }
45 my $anaphorarelation = $class->SUPER::new({
46 0 'id' => $fields->{'id'},
47 # 'form' => $fields->{'form'},
48 }
49 );
50 0 bless ($anaphorarelation,$class);
51  
52 0 $anaphorarelation->anaphora_relation_type($fields->{'domain_specific_relation_type'});
53  
54 # $anaphorarelation->list_refid_semantic_unit($fields->{'list_refid_semantic_unit'});
55  
56 0 ▶ if (defined $fields->{'log_id'}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fields->{"log_id"}) 0 0 0
57 0 $anaphorarelation->setLogId($fields->{'log_id'});
58 }
59 0 return($anaphorarelation);
60 }
61  
62 0 ▶sub anaphora {
Subroutine anaphora: not called CC=2 SCAR=17.9
Pod undocumented
63 0 my $self = shift;
64  
65 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
66 0 $self->{anaphora}->{'reference'} = 'refid_semantic_unit';
67 0 $self->{anaphora}->{$self->{'reference'}} = shift;
68 }
69 0 return($self->{anaphora}->{$self->{'reference'}});
70
71 }
72  
73 0 ▶sub list_refid_semantic_unit {
Subroutine list_refid_semantic_unit: not called CC=3 SCAR=24.8
Pod undocumented
74 0 my $self = shift;
75  
76 0 my $ref;
77 my $elt;
78  
79 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
80 0 $self->{antecedent}->{'reference'} = 'list_refid_semantic_unit';
81 0 $self->{antecedent}->{$self->{'reference'}} = [];
82 0 $ref = shift;
83 0 foreach $elt (@$ref) {
84 0 push @{$self->{antecedent}->{$self->{'reference'}}}, $elt;
85 }
86 }
87 0 return($self->{antecedent}->{$self->{'reference'}});
88  
89 }
90  
91 0 ▶sub anaphora_relation_type {
Subroutine anaphora_relation_type: not called CC=2 SCAR=17.9
Pod undocumented
92 0 my $self = shift;
93  
94 0 ▶ $self->{'anaphora_relation_type'} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
95 0 return($self->{'anaphora_relation_type'});
96 }
97  
98 0 ▶sub XMLout {
Subroutine XMLout: not called CC=1 SCAR=6.9
Pod undocumented
99 0 my ($self, $order) = @_;
100
101 0 return($self->SUPER::XMLout("anaphora_relation", $order));
102 }
103  
104  
105 16 1;
106  
107 __END__
« blib/lib/Lingua/Ogmios/Annotations/Element.pm ↑ Summary blib/lib/Lingua/Ogmios/NLPWrappers/TermMeasures.pm »