line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::MonolexicalTermCandidate; |
2
|
5
|
|
|
5
|
|
37
|
use strict; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
157
|
|
3
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
163
|
|
4
|
5
|
|
|
5
|
|
27
|
use Lingua::YaTeA::TermCandidate; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::TermCandidate); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
188
|
|
|
188
|
1
|
349
|
my ($class) = @_; |
13
|
188
|
|
|
|
|
420
|
my $this = $class->SUPER::new; |
14
|
188
|
|
|
|
|
345
|
bless ($this,$class); |
15
|
188
|
|
|
|
|
373
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub searchHead |
19
|
|
|
|
|
|
|
{ |
20
|
128
|
|
|
128
|
1
|
243
|
my ($this) = @_; |
21
|
128
|
|
|
|
|
259
|
return $this; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub setOccurrences |
25
|
|
|
|
|
|
|
{ |
26
|
188
|
|
|
188
|
1
|
361
|
my ($this,$phrase_occurrences_a,$offset,$word_length,$maximal) = @_; |
27
|
188
|
|
|
|
|
276
|
my $phrase_occurrence; |
28
|
|
|
|
|
|
|
|
29
|
188
|
|
|
|
|
408
|
foreach $phrase_occurrence (@$phrase_occurrences_a) |
30
|
|
|
|
|
|
|
{ |
31
|
204
|
|
|
|
|
591
|
my $occurrence = Lingua::YaTeA::Occurrence->new; |
32
|
204
|
|
|
|
|
493
|
$occurrence->{SENTENCE} = $phrase_occurrence->getSentence; |
33
|
204
|
|
|
|
|
449
|
$occurrence->{START_CHAR} = $phrase_occurrence->getStartChar + $offset; |
34
|
204
|
|
|
|
|
416
|
$occurrence->{END_CHAR} = $phrase_occurrence->getStartChar + $offset + $word_length; |
35
|
204
|
|
|
|
|
319
|
$occurrence->{MAXIMAL} = $maximal; |
36
|
204
|
|
|
|
|
528
|
$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__ |