line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::MonolexicalTermCandidate; |
2
|
5
|
|
|
5
|
|
32
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
148
|
|
3
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
149
|
|
4
|
5
|
|
|
5
|
|
28
|
use Lingua::YaTeA::TermCandidate; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::TermCandidate); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
188
|
|
|
188
|
1
|
352
|
my ($class) = @_; |
13
|
188
|
|
|
|
|
443
|
my $this = $class->SUPER::new; |
14
|
188
|
|
|
|
|
366
|
bless ($this,$class); |
15
|
188
|
|
|
|
|
409
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub searchHead |
19
|
|
|
|
|
|
|
{ |
20
|
128
|
|
|
128
|
1
|
244
|
my ($this) = @_; |
21
|
128
|
|
|
|
|
271
|
return $this; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub setOccurrences |
25
|
|
|
|
|
|
|
{ |
26
|
188
|
|
|
188
|
1
|
388
|
my ($this,$phrase_occurrences_a,$offset,$word_length,$maximal) = @_; |
27
|
188
|
|
|
|
|
274
|
my $phrase_occurrence; |
28
|
|
|
|
|
|
|
|
29
|
188
|
|
|
|
|
422
|
foreach $phrase_occurrence (@$phrase_occurrences_a) |
30
|
|
|
|
|
|
|
{ |
31
|
204
|
|
|
|
|
569
|
my $occurrence = Lingua::YaTeA::Occurrence->new; |
32
|
204
|
|
|
|
|
535
|
$occurrence->{SENTENCE} = $phrase_occurrence->getSentence; |
33
|
204
|
|
|
|
|
433
|
$occurrence->{START_CHAR} = $phrase_occurrence->getStartChar + $offset; |
34
|
204
|
|
|
|
|
412
|
$occurrence->{END_CHAR} = $phrase_occurrence->getStartChar + $offset + $word_length; |
35
|
204
|
|
|
|
|
326
|
$occurrence->{MAXIMAL} = $maximal; |
36
|
204
|
|
|
|
|
471
|
$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__ |