line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::MonolexicalTermCandidate; |
2
|
5
|
|
|
5
|
|
29
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
125
|
|
3
|
5
|
|
|
5
|
|
22
|
use warnings; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
105
|
|
4
|
5
|
|
|
5
|
|
22
|
use Lingua::YaTeA::TermCandidate; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
25
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::TermCandidate); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
188
|
|
|
188
|
1
|
314
|
my ($class) = @_; |
13
|
188
|
|
|
|
|
366
|
my $this = $class->SUPER::new; |
14
|
188
|
|
|
|
|
260
|
bless ($this,$class); |
15
|
188
|
|
|
|
|
309
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub searchHead |
19
|
|
|
|
|
|
|
{ |
20
|
128
|
|
|
128
|
1
|
173
|
my ($this) = @_; |
21
|
128
|
|
|
|
|
212
|
return $this; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub setOccurrences |
25
|
|
|
|
|
|
|
{ |
26
|
188
|
|
|
188
|
1
|
300
|
my ($this,$phrase_occurrences_a,$offset,$word_length,$maximal) = @_; |
27
|
188
|
|
|
|
|
232
|
my $phrase_occurrence; |
28
|
|
|
|
|
|
|
|
29
|
188
|
|
|
|
|
315
|
foreach $phrase_occurrence (@$phrase_occurrences_a) |
30
|
|
|
|
|
|
|
{ |
31
|
204
|
|
|
|
|
444
|
my $occurrence = Lingua::YaTeA::Occurrence->new; |
32
|
204
|
|
|
|
|
388
|
$occurrence->{SENTENCE} = $phrase_occurrence->getSentence; |
33
|
204
|
|
|
|
|
348
|
$occurrence->{START_CHAR} = $phrase_occurrence->getStartChar + $offset; |
34
|
204
|
|
|
|
|
353
|
$occurrence->{END_CHAR} = $phrase_occurrence->getStartChar + $offset + $word_length; |
35
|
204
|
|
|
|
|
257
|
$occurrence->{MAXIMAL} = $maximal; |
36
|
204
|
|
|
|
|
442
|
$this->addOccurrence($occurrence); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub getPOS |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
44
|
0
|
|
|
|
|
|
return $this->getWords->[0]->getPOS; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub getIF |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
50
|
0
|
|
|
|
|
|
return $this->getWords->[0]->getIF; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub addMonolexicalOccurrences |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
1
|
|
my ($this,$phrase_set,$monolexical_transfer_h) = @_; |
56
|
0
|
|
|
|
|
|
my $key = $this->getIF . "~" . $this->getPOS . "~" . $this->getLF; |
57
|
0
|
|
|
|
|
|
my $occurrences_a; |
58
|
0
|
0
|
|
|
|
|
if(exists $phrase_set->{$key}) |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
|
|
|
$occurrences_a = $phrase_set->{$key}->getOccurrences; |
61
|
0
|
|
|
|
|
|
$this->addOccurrences($occurrences_a); |
62
|
0
|
|
|
|
|
|
$phrase_set->{$key}->setTC(1); |
63
|
0
|
|
|
|
|
|
$monolexical_transfer_h->{$phrase_set->{$key}->getID}++; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub getHeadAndLinks |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
1
|
|
my ($this,$LGPmapping_h) = @_; |
70
|
0
|
|
|
|
|
|
my $head = $this->getWord(0); |
71
|
0
|
|
|
|
|
|
my @links; |
72
|
0
|
|
|
|
|
|
return ($head,0,\@links); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |