| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Lingua::YaTeA::WordFromCorpus; |
|
2
|
3
|
|
|
3
|
|
16
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
68
|
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
56
|
|
|
4
|
3
|
|
|
3
|
|
12
|
use Lingua::YaTeA::WordOccurrence; |
|
|
3
|
|
|
|
|
4
|
|
|
|
3
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
|
|
# use UNIVERSAL; |
|
6
|
|
|
|
|
|
|
# use Scalar::Util qw(blessed); |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::WordOccurrence); |
|
9
|
|
|
|
|
|
|
our $counter = 0; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
598
|
|
|
598
|
1
|
908
|
my ($class,$form,$lexicon,$sentences) = @_; |
|
16
|
598
|
|
|
|
|
1237
|
my $this = $class->SUPER::new($form); |
|
17
|
598
|
|
|
|
|
739
|
bless ($this,$class); |
|
18
|
598
|
|
|
|
|
771
|
$this->{ID} = $counter; |
|
19
|
598
|
|
|
|
|
854
|
$this->{LEX_ITEM} = $this->setLexItem($form,$lexicon); |
|
20
|
598
|
|
|
|
|
1093
|
$this->{SENTENCE} = $sentences->getCurrent; |
|
21
|
598
|
|
|
|
|
804
|
$this->{START_CHAR} = $Lingua::YaTeA::Sentence::start_char; |
|
22
|
598
|
|
|
|
|
1025
|
return $this; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub setLexItem |
|
27
|
|
|
|
|
|
|
{ |
|
28
|
598
|
|
|
598
|
1
|
829
|
my ($this,$form,$lexicon) = @_; |
|
29
|
598
|
|
|
|
|
1037
|
return $lexicon->addOccurrence($form); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getID |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
|
36
|
0
|
|
|
|
|
0
|
return $this->{ID}; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub getSentence |
|
41
|
|
|
|
|
|
|
{ |
|
42
|
122
|
|
|
122
|
1
|
170
|
my ($this) = @_; |
|
43
|
122
|
|
|
|
|
206
|
return $this->{SENTENCE}; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub getDocument |
|
47
|
|
|
|
|
|
|
{ |
|
48
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
|
49
|
0
|
|
|
|
|
0
|
return $this->getSentence->getDocument; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub getSentenceID |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
|
55
|
0
|
|
|
|
|
0
|
return $this->getSentence->getID; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub getDocumentID |
|
59
|
|
|
|
|
|
|
{ |
|
60
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
|
61
|
0
|
|
|
|
|
0
|
return $this->getSentence->getDocument->getID; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub getStartChar |
|
65
|
|
|
|
|
|
|
{ |
|
66
|
244
|
|
|
244
|
1
|
338
|
my ($this) = @_; |
|
67
|
244
|
|
|
|
|
405
|
return $this->{START_CHAR}; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub getLexItem |
|
71
|
|
|
|
|
|
|
{ |
|
72
|
7725
|
|
|
7725
|
1
|
9716
|
my ($this) = @_; |
|
73
|
7725
|
|
|
|
|
14482
|
return $this->{LEX_ITEM}; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub isSentenceBoundary |
|
77
|
|
|
|
|
|
|
{ |
|
78
|
1180
|
|
|
1180
|
1
|
1706
|
my ($this,$sentence_boundary) = @_; |
|
79
|
|
|
|
|
|
|
|
|
80
|
1180
|
100
|
|
|
|
1604
|
if ($this->getLexItem->getPOS eq $sentence_boundary) |
|
81
|
|
|
|
|
|
|
{ |
|
82
|
36
|
|
|
|
|
98
|
return 1; |
|
83
|
|
|
|
|
|
|
} |
|
84
|
1144
|
|
|
|
|
2762
|
return 0; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub isDocumentBoundary |
|
88
|
|
|
|
|
|
|
{ |
|
89
|
1144
|
|
|
1144
|
1
|
1637
|
my ($this,$document_boundary) = @_; |
|
90
|
|
|
|
|
|
|
|
|
91
|
1144
|
50
|
|
|
|
1566
|
if ($this->getLexItem->getPOS eq $document_boundary) |
|
92
|
|
|
|
|
|
|
{ |
|
93
|
0
|
|
|
|
|
0
|
return 1; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
1144
|
|
|
|
|
2497
|
return 0; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub updateSentence |
|
101
|
|
|
|
|
|
|
{ |
|
102
|
0
|
|
|
0
|
1
|
0
|
my ($this,$sentences) = @_; |
|
103
|
0
|
|
|
|
|
0
|
$this->{SENTENCE} = $sentences->getCurrent; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub updateStartChar |
|
107
|
|
|
|
|
|
|
{ |
|
108
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
|
109
|
0
|
|
|
|
|
0
|
$this->{START_CHAR} = $Lingua::YaTeA::Sentence::start_char; |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub isChunkingFrontier |
|
113
|
|
|
|
|
|
|
{ |
|
114
|
568
|
|
|
568
|
1
|
779
|
my ($this,$chunking_data) = @_; |
|
115
|
568
|
|
|
|
|
938
|
my @types = ("POS", "LF", "IF"); |
|
116
|
568
|
|
|
|
|
652
|
my $type; |
|
117
|
568
|
|
|
|
|
810
|
foreach $type (@types) |
|
118
|
|
|
|
|
|
|
{ |
|
119
|
|
|
|
|
|
|
# word is a chunking frontier |
|
120
|
1208
|
100
|
|
|
|
1764
|
if ($chunking_data->existData("ChunkingFrontiers",$type,$this->getLexItem->{$type}) == 1) |
|
121
|
|
|
|
|
|
|
{ |
|
122
|
|
|
|
|
|
|
# word is not a chunking exception : end |
|
123
|
248
|
100
|
|
|
|
406
|
if (! $this->isChunkingException($chunking_data) ) |
|
124
|
|
|
|
|
|
|
{ |
|
125
|
|
|
|
|
|
|
|
|
126
|
214
|
|
|
|
|
509
|
return 1; |
|
127
|
|
|
|
|
|
|
} |
|
128
|
34
|
|
|
|
|
110
|
return 0; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
} |
|
131
|
320
|
|
|
|
|
686
|
return 0; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub isChunkingException |
|
135
|
|
|
|
|
|
|
{ |
|
136
|
248
|
|
|
248
|
1
|
310
|
my ($this,$chunking_data) = @_; |
|
137
|
248
|
|
|
|
|
411
|
my @types = ("POS", "LF", "IF"); |
|
138
|
248
|
|
|
|
|
292
|
my $type; |
|
139
|
248
|
|
|
|
|
341
|
foreach $type (@types) |
|
140
|
|
|
|
|
|
|
{ |
|
141
|
744
|
100
|
|
|
|
1034
|
if ($chunking_data->existData("ChunkingExceptions",$type,$this->getLexItem->{$type}) == 1) |
|
142
|
|
|
|
|
|
|
{ |
|
143
|
34
|
|
|
|
|
75
|
return 1; |
|
144
|
|
|
|
|
|
|
} |
|
145
|
|
|
|
|
|
|
} |
|
146
|
214
|
|
|
|
|
448
|
return 0; |
|
147
|
|
|
|
|
|
|
} |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub isCleaningFrontier |
|
150
|
|
|
|
|
|
|
{ |
|
151
|
314
|
|
|
314
|
1
|
447
|
my ($this,$chunking_data) = @_; |
|
152
|
314
|
|
|
|
|
526
|
my @types = ("POS", "LF", "IF"); |
|
153
|
314
|
|
|
|
|
424
|
my $type; |
|
154
|
314
|
|
|
|
|
419
|
foreach $type (@types) |
|
155
|
|
|
|
|
|
|
{ |
|
156
|
446
|
100
|
|
|
|
698
|
if ($chunking_data->existData("CleaningFrontiers",$type,$this->getLexItem->{$type}) == 1) |
|
157
|
|
|
|
|
|
|
{ |
|
158
|
248
|
50
|
|
|
|
423
|
if (! $this->isCleaningException($chunking_data)) |
|
159
|
|
|
|
|
|
|
{ |
|
160
|
248
|
|
|
|
|
625
|
return 1; |
|
161
|
|
|
|
|
|
|
} |
|
162
|
|
|
|
|
|
|
} |
|
163
|
|
|
|
|
|
|
} |
|
164
|
66
|
|
|
|
|
153
|
return 0; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub isCleaningException |
|
168
|
|
|
|
|
|
|
{ |
|
169
|
248
|
|
|
248
|
1
|
342
|
my ($this,$chunking_data) = @_; |
|
170
|
248
|
|
|
|
|
380
|
my @types = ("POS", "LF", "IF"); |
|
171
|
248
|
|
|
|
|
294
|
my $type; |
|
172
|
248
|
|
|
|
|
349
|
foreach $type (@types) |
|
173
|
|
|
|
|
|
|
{ |
|
174
|
744
|
50
|
|
|
|
1085
|
if ($chunking_data->existData("CleaningExceptions",$type,$this->getLexItem->{$type}) == 1) |
|
175
|
|
|
|
|
|
|
{ |
|
176
|
0
|
|
|
|
|
0
|
return 1; |
|
177
|
|
|
|
|
|
|
} |
|
178
|
|
|
|
|
|
|
} |
|
179
|
248
|
|
|
|
|
485
|
return 0; |
|
180
|
|
|
|
|
|
|
} |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub isCompulsory |
|
183
|
|
|
|
|
|
|
{ |
|
184
|
145
|
|
|
145
|
1
|
243
|
my ($this,$compulsory) = @_; |
|
185
|
|
|
|
|
|
|
# my $compuslory = $options->getCompulsory; |
|
186
|
|
|
|
|
|
|
|
|
187
|
145
|
100
|
|
|
|
218
|
if # ( |
|
188
|
|
|
|
|
|
|
# ((blessed($this)) && ($this->isa("Lingua::YaTeA::TestifiedTermMark"))) |
|
189
|
|
|
|
|
|
|
# || |
|
190
|
|
|
|
|
|
|
($this->getLexItem->getPOS =~ /$compulsory/) |
|
191
|
|
|
|
|
|
|
# ) |
|
192
|
|
|
|
|
|
|
{ |
|
193
|
120
|
|
|
|
|
382
|
return 1; |
|
194
|
|
|
|
|
|
|
} |
|
195
|
25
|
|
|
|
|
90
|
return 0; |
|
196
|
|
|
|
|
|
|
} |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub getPOS |
|
199
|
|
|
|
|
|
|
{ |
|
200
|
286
|
|
|
286
|
1
|
386
|
my ($this) = @_; |
|
201
|
286
|
|
|
|
|
376
|
return $this->getLexItem->getPOS; |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub isEndTrigger |
|
205
|
|
|
|
|
|
|
{ |
|
206
|
126
|
|
|
126
|
1
|
199
|
my ($this,$end_trigger_set) = @_; |
|
207
|
126
|
|
|
|
|
243
|
return $end_trigger_set->findTrigger($this); |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub isStartTrigger |
|
211
|
|
|
|
|
|
|
{ |
|
212
|
122
|
|
|
122
|
1
|
173
|
my ($this,$start_trigger_set) = @_; |
|
213
|
122
|
|
|
|
|
265
|
return $start_trigger_set->findTrigger($this); |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub getIF |
|
218
|
|
|
|
|
|
|
{ |
|
219
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
|
220
|
0
|
|
|
|
|
|
return $this->getLexItem->getIF; |
|
221
|
|
|
|
|
|
|
} |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub getLF |
|
224
|
|
|
|
|
|
|
{ |
|
225
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
|
226
|
0
|
|
|
|
|
|
return $this->getLexItem->getLF; |
|
227
|
|
|
|
|
|
|
} |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
1; |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
__END__ |