« blib/lib/Lingua/Ogmios/NLPWrappers/TermExpansion.pm
↑ Summary
blib/lib/Lingua/Ogmios/NLPWrappers/Flemm.pm »
| 1 | package Lingua::Ogmios::Annotations::DomainSpecificRelation; | ||||||||||
| 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 | # <!-- DOMAIN_SPECIFIC_RELATION_LEVEL --> | ||||||||||
| 11 | # <!-- =================================================== --> | ||||||||||
| 12 | |||||||||||
| 13 | # <!-- domain_specific_relation --> | ||||||||||
| 14 | # <!ELEMENT domain_specific_relation | ||||||||||
| 15 | # (id, log_id?, | ||||||||||
| 16 | # domain_specific_relation_type, | ||||||||||
| 17 | # list_refid_semantic_unit) > | ||||||||||
| 18 | |||||||||||
| 19 | # <!-- domain_specific_relation_type --> | ||||||||||
| 20 | # <!ELEMENT domain_specific_relation_type (#PCDATA) > | ||||||||||
| 21 | |||||||||||
| 22 | # <!ELEMENT list_refid_semantic_unit (refid_semantic_unit)+ > | ||||||||||
| 23 | # <!ELEMENT refid_semantic_unit (#PCDATA) > | ||||||||||
| 24 | |||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||
| 27 | 0 | my ($class, $fields) = @_; | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | if (!defined $fields->{'id'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | $fields->{'id'} = -1; | |||||||||
| 31 | } | ||||||||||
| 32 | 0 | ▶ | if (!defined $fields->{'domain_specific_relation_type'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | die("domain_specific_relation_type is not defined"); | |||||||||
| 34 | } | ||||||||||
| 35 | 0 | ▶ | if (!defined $fields->{'list_refid_semantic_unit'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | die("list_refid_semantic_unit is not defined"); | |||||||||
| 37 | } | ||||||||||
| 38 | my $domainspecificrelation = $class->SUPER::new({ | ||||||||||
| 39 | 0 | 'id' => $fields->{'id'}, | |||||||||
| 40 | # 'form' => $fields->{'form'}, | ||||||||||
| 41 | } | ||||||||||
| 42 | ); | ||||||||||
| 43 | 0 | bless ($domainspecificrelation,$class); | |||||||||
| 44 | |||||||||||
| 45 | 0 | $domainspecificrelation->list_refid_semantic_unit($fields->{'list_refid_semantic_unit'}); | |||||||||
| 46 | 0 | $domainspecificrelation->domain_specific_relation_type($fields->{'domain_specific_relation_type'}); | |||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | if (defined $fields->{'log_id'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 0 | $domainspecificrelation->setLogId($fields->{'log_id'}); | |||||||||
| 50 | } | ||||||||||
| 51 | 0 | return($domainspecificrelation); | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 0 | ▶ | sub list_refid_semantic_unit { | ||||||||
|
Subroutine
list_refid_semantic_unit: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||
| 55 | 0 | my $self = shift; | |||||||||
| 56 | |||||||||||
| 57 | 0 | my $ref; | |||||||||
| 58 | my $elt; | ||||||||||
| 59 | |||||||||||
| 60 | 0 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | 0 | $self->{'reference'} = 'list_refid_semantic_unit'; | |||||||||
| 62 | 0 | $self->{$self->{'reference'}} = []; | |||||||||
| 63 | 0 | $ref = shift; | |||||||||
| 64 | 0 | ▶ | if (ref($ref) eq "ARRAY") { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 0 | foreach $elt (@$ref) { | |||||||||
| 66 | # warn $elt->getForm . "\n"; | ||||||||||
| 67 | 0 | push @{$self->{$self->{'reference'}}}, $elt; | |||||||||
| 68 | } | ||||||||||
| 69 | } else { | ||||||||||
| 70 | 0 | ▶ | if (ref($ref) eq "HASH") { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 71 | 0 | foreach $elt (keys %$ref) { | |||||||||
| 72 | # warn $elt->getForm . "\n"; | ||||||||||
| 73 | 0 | push @{$self->{$self->{'reference'}}}, { $elt => $ref->{$elt}}; | |||||||||
| 74 | } | ||||||||||
| 75 | } | ||||||||||
| 76 | } | ||||||||||
| 77 | } | ||||||||||
| 78 | 0 | return($self->{$self->{'reference'}}); | |||||||||
| 79 | |||||||||||
| 80 | # $self->{'list_refid_semantic_unit'} = shift if @_; | ||||||||||
| 81 | # return($self->{'list_refid_semantic_unit'}); | ||||||||||
| 82 | } | ||||||||||
| 83 | |||||||||||
| 84 | 0 | ▶ | sub domain_specific_relation_type { | ||||||||
|
Subroutine
domain_specific_relation_type: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 85 | 0 | my $self = shift; | |||||||||
| 86 | |||||||||||
| 87 | 0 | ▶ | $self->{'domain_specific_relation_type'} = shift if @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 88 | 0 | return($self->{'domain_specific_relation_type'}); | |||||||||
| 89 | } | ||||||||||
| 90 | |||||||||||
| 91 | 0 | ▶ | sub XMLout { | ||||||||
|
Subroutine
XMLout: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 92 | 0 | my ($self, $order) = @_; | |||||||||
| 93 | |||||||||||
| 94 | 0 | return($self->SUPER::XMLout("domain_specific_relation", $order)); | |||||||||
| 95 | } | ||||||||||
| 96 | |||||||||||
| 97 | 0 | ▶ | sub reference { | ||||||||
|
Subroutine
reference: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 98 | 0 | my ($self) = @_; | |||||||||
| 99 | |||||||||||
| 100 | 0 | return($self->list_refid_semantic_unit); | |||||||||
| 101 | } | ||||||||||
| 102 | |||||||||||
| 103 | 16 | 1; | |||||||||
| 104 | |||||||||||
| 105 | __END__ | ||||||||||