| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Lingua::Ogmios::Annotations::SyntacticRelation; |
|
2
|
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
64
|
use strict; |
|
|
16
|
|
|
|
|
21
|
|
|
|
16
|
|
|
|
|
537
|
|
|
4
|
16
|
|
|
16
|
|
61
|
use warnings; |
|
|
16
|
|
|
|
|
20
|
|
|
|
16
|
|
|
|
|
347
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
16
|
|
|
16
|
|
57
|
use Lingua::Ogmios::Annotations::Element; |
|
|
16
|
|
|
|
|
45
|
|
|
|
16
|
|
|
|
|
9350
|
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Lingua::Ogmios::Annotations::Element); |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# |
|
10
|
|
|
|
|
|
|
# |
|
11
|
|
|
|
|
|
|
# |
|
12
|
|
|
|
|
|
|
#
|
|
13
|
|
|
|
|
|
|
# (log_id?, comments*, |
|
14
|
|
|
|
|
|
|
# syntactic_relation+) > |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# |
|
17
|
|
|
|
|
|
|
#
|
|
18
|
|
|
|
|
|
|
# (id, log_id?, |
|
19
|
|
|
|
|
|
|
# syntactic_relation_type, |
|
20
|
|
|
|
|
|
|
# refid_head, refid_modifier) > |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# |
|
23
|
|
|
|
|
|
|
#
|
|
24
|
|
|
|
|
|
|
# (refid_word | refid_phrase) > |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# |
|
27
|
|
|
|
|
|
|
#
|
|
28
|
|
|
|
|
|
|
# (refid_word | refid_phrase) > |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# |
|
31
|
|
|
|
|
|
|
#
|
|
32
|
|
|
|
|
|
|
# (#PCDATA) > |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
|
35
|
0
|
|
|
0
|
0
|
|
my ($class, $fields) = @_; |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'id'}) { |
|
38
|
0
|
|
|
|
|
|
$fields->{'id'} = -1; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'syntactic_relation_type'}) { |
|
41
|
0
|
|
|
|
|
|
die("syntactic_relation_type is not defined"); |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
# if (!defined $fields->{'refid_head'}) { |
|
44
|
|
|
|
|
|
|
# die("refid_head is not defined"); |
|
45
|
|
|
|
|
|
|
# } |
|
46
|
|
|
|
|
|
|
# if (!defined $fields->{'refid_modifier'}) { |
|
47
|
|
|
|
|
|
|
# die("refid_modifier is not defined"); |
|
48
|
|
|
|
|
|
|
# } |
|
49
|
0
|
|
|
|
|
|
my $syntacticrelation = $class->SUPER::new({ |
|
50
|
|
|
|
|
|
|
'id' => $fields->{'id'}, |
|
51
|
|
|
|
|
|
|
# 'form' => $fields->{'form'}, |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
); |
|
54
|
0
|
|
|
|
|
|
bless ($syntacticrelation,$class); |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my $i = 0; |
|
57
|
0
|
|
|
|
|
|
my $reference_name; |
|
58
|
|
|
|
|
|
|
my $ref; |
|
59
|
0
|
|
|
|
|
|
foreach $ref ('refid_phrase', 'refid_word') { |
|
60
|
0
|
0
|
|
|
|
|
if (defined $fields->{$ref . "_head"}) { |
|
61
|
0
|
|
|
|
|
|
$reference_name = $ref; |
|
62
|
0
|
|
|
|
|
|
last; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
0
|
|
|
|
|
|
$i++; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
0
|
0
|
|
|
|
|
if ($i == 2) { |
|
67
|
0
|
|
|
|
|
|
die("reference (list) is not defined"); |
|
68
|
|
|
|
|
|
|
} |
|
69
|
0
|
|
|
|
|
|
$syntacticrelation->refid_head($reference_name, $fields->{$reference_name . "_head"}); |
|
70
|
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
$i = 0; |
|
72
|
0
|
|
|
|
|
|
$reference_name = ""; |
|
73
|
0
|
|
|
|
|
|
$ref = ""; |
|
74
|
0
|
|
|
|
|
|
foreach $ref ('refid_phrase', 'refid_word') { |
|
75
|
0
|
0
|
|
|
|
|
if (defined $fields->{$ref . "_modifier"}) { |
|
76
|
0
|
|
|
|
|
|
$reference_name = $ref; |
|
77
|
0
|
|
|
|
|
|
last; |
|
78
|
|
|
|
|
|
|
} |
|
79
|
0
|
|
|
|
|
|
$i++; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
0
|
0
|
|
|
|
|
if ($i == 2) { |
|
82
|
0
|
|
|
|
|
|
die("reference (list) is not defined"); |
|
83
|
|
|
|
|
|
|
} |
|
84
|
0
|
|
|
|
|
|
$syntacticrelation->refid_modifier($reference_name, $fields->{$reference_name . "_modifier"}); |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
$syntacticrelation->syntactic_relation_type($fields->{'syntactic_relation_type'}); |
|
87
|
|
|
|
|
|
|
# $syntacticrelation->refid_head($fields->{'refid_head'}); |
|
88
|
|
|
|
|
|
|
# $syntacticrelation->refid_modifier($fields->{'refid_modifier'}); |
|
89
|
|
|
|
|
|
|
|
|
90
|
0
|
0
|
|
|
|
|
if (defined $fields->{'log_id'}) { |
|
91
|
0
|
|
|
|
|
|
$syntacticrelation->setLogId($fields->{'log_id'}); |
|
92
|
|
|
|
|
|
|
} |
|
93
|
0
|
|
|
|
|
|
return($syntacticrelation); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub syntactic_relation_type { |
|
98
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
99
|
|
|
|
|
|
|
|
|
100
|
0
|
0
|
|
|
|
|
$self->{'syntactic_relation_type'} = shift if @_; |
|
101
|
0
|
|
|
|
|
|
return($self->{'syntactic_relation_type'}); |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
sub refid_head { |
|
104
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
105
|
0
|
|
|
|
|
|
my $refid_head; |
|
106
|
|
|
|
|
|
|
|
|
107
|
0
|
0
|
0
|
|
|
|
if ((@_) && (scalar @_ == 2)) { |
|
108
|
0
|
|
|
|
|
|
$self->{'refid_head'} = {}; |
|
109
|
0
|
|
|
|
|
|
$self->{'refid_head'}->{'reference'} = shift; |
|
110
|
0
|
|
|
|
|
|
$self->{'refid_head'}->{$self->{'refid_head'}->{'reference'}} = []; |
|
111
|
0
|
|
|
|
|
|
$refid_head = shift; |
|
112
|
0
|
|
|
|
|
|
push @{$self->{'refid_head'}->{$self->{'refid_head'}->{'reference'}}}, $refid_head; |
|
|
0
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
} |
|
114
|
0
|
|
|
|
|
|
return($self->{'refid_head'}->{$self->{'refid_head'}->{'reference'}}); |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
sub refid_modifier { |
|
118
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
119
|
0
|
|
|
|
|
|
my $refid_modifier; |
|
120
|
|
|
|
|
|
|
|
|
121
|
0
|
0
|
0
|
|
|
|
if ((@_) && (scalar @_ == 2)) { |
|
122
|
0
|
|
|
|
|
|
$self->{'refid_modifier'} = {}; |
|
123
|
0
|
|
|
|
|
|
$self->{'refid_modifier'}->{'reference'} = shift; |
|
124
|
0
|
|
|
|
|
|
$self->{'refid_modifier'}->{$self->{'refid_modifier'}->{'reference'}} = []; |
|
125
|
0
|
|
|
|
|
|
$refid_modifier = shift; |
|
126
|
0
|
|
|
|
|
|
push @{$self->{'refid_modifier'}->{$self->{'refid_modifier'}->{'reference'}}}, $refid_modifier; |
|
|
0
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
} |
|
128
|
0
|
|
|
|
|
|
return($self->{'refid_modifier'}->{$self->{'refid_modifier'}->{'reference'}}); |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# $self->{'refid_modifier'} = shift if @_; |
|
131
|
|
|
|
|
|
|
# return($self->{'refid_modifier'}); |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub XMLout { |
|
135
|
0
|
|
|
0
|
0
|
|
my ($self, $order) = @_; |
|
136
|
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
return($self->SUPER::XMLout("syntactic_relation", $order)); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub reference_name_head { |
|
141
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
142
|
|
|
|
|
|
|
|
|
143
|
0
|
0
|
|
|
|
|
$self->{'refid_head'}->{'reference'} = shift if @_; |
|
144
|
0
|
|
|
|
|
|
return $self->{'refid_head'}->{'reference'}; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub reference_name_modifier { |
|
148
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
149
|
|
|
|
|
|
|
|
|
150
|
0
|
0
|
|
|
|
|
$self->{'refid_modifier'}->{'reference'} = shift if @_; |
|
151
|
0
|
|
|
|
|
|
return $self->{'refid_modifier'}->{'reference'}; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
sub reference { |
|
156
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
|
157
|
|
|
|
|
|
|
|
|
158
|
0
|
|
|
|
|
|
return($self->refid_head, $self->refid_modifier); |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
1; |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
__END__ |