« 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
| |||||||||||
| 34 | 0 | $fields->{'id'} = -1; | |||||||||
| 35 | } | ||||||||||
| 36 | 0 | ▶ | if (!defined $fields->{'anaphora_relation_type'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | die("anaphora_relation_type is not defined"); | |||||||||
| 38 | } | ||||||||||
| 39 | 0 | ▶ | if (!defined $fields->{'anaphora'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | die("anaphora is not defined"); | |||||||||
| 41 | } | ||||||||||
| 42 | 0 | ▶ | if (!defined $fields->{'antecedent'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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__ | ||||||||||