line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::TermLeaf; |
2
|
5
|
|
|
5
|
|
1616
|
use Lingua::YaTeA::Edge; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
47
|
|
3
|
5
|
|
|
5
|
|
107
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
70
|
|
4
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
2253
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::Edge); |
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
278
|
|
|
278
|
1
|
400
|
my ($class,$index) = @_; |
12
|
278
|
|
|
|
|
567
|
my $this = $class->SUPER::new; |
13
|
278
|
|
|
|
|
480
|
$this->{INDEX} = $index; |
14
|
278
|
|
|
|
|
345
|
bless ($this,$class); |
15
|
278
|
|
|
|
|
561
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub getIF |
20
|
|
|
|
|
|
|
{ |
21
|
836
|
|
|
836
|
1
|
1180
|
my ($this,$words_a) = @_; |
22
|
836
|
|
|
|
|
1177
|
return $words_a->[$this->getIndex]->getIF; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub getPOS |
28
|
|
|
|
|
|
|
{ |
29
|
456
|
|
|
456
|
1
|
579
|
my ($this,$words_a) = @_; |
30
|
456
|
|
|
|
|
642
|
return $words_a->[$this->getIndex]->getPOS; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getLF |
34
|
|
|
|
|
|
|
{ |
35
|
408
|
|
|
408
|
1
|
521
|
my ($this,$words_a) = @_; |
36
|
408
|
|
|
|
|
529
|
return $words_a->[$this->getIndex]->getLF; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub getID |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
1
|
0
|
my ($this,$words_a) = @_; |
42
|
0
|
|
|
|
|
0
|
return $words_a->[$this->getIndex]->getID; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub getIndex |
47
|
|
|
|
|
|
|
{ |
48
|
4261
|
|
|
4261
|
1
|
5145
|
my ($this) = @_; |
49
|
4261
|
|
|
|
|
9147
|
return $this->{INDEX}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub getLength |
53
|
|
|
|
|
|
|
{ |
54
|
408
|
|
|
408
|
1
|
572
|
my ($this,$words_a) = @_; |
55
|
408
|
|
|
|
|
536
|
return $words_a->[$this->getIndex]->getLength; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub getWord |
59
|
|
|
|
|
|
|
{ |
60
|
32
|
|
|
32
|
1
|
47
|
my ($this,$words_a) = @_; |
61
|
32
|
|
|
|
|
50
|
return $words_a->[$this->getIndex]; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub searchHead |
65
|
|
|
|
|
|
|
{ |
66
|
606
|
|
|
606
|
1
|
828
|
my ($this) = @_; |
67
|
606
|
|
|
|
|
1264
|
return $this; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub print |
72
|
|
|
|
|
|
|
{ |
73
|
0
|
|
|
0
|
1
|
0
|
my ($this,$words_a,$fh) = @_; |
74
|
0
|
0
|
|
|
|
0
|
if(!defined $fh) |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
|
|
0
|
$fh = \*STDERR |
77
|
|
|
|
|
|
|
} |
78
|
0
|
0
|
|
|
|
0
|
if(defined $words_a) |
79
|
|
|
|
|
|
|
{ |
80
|
0
|
|
|
|
|
0
|
$this->printWords($words_a,$fh) ; |
81
|
0
|
|
|
|
|
0
|
print $fh " (" . $this->getIndex. ")"; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
else |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
|
|
0
|
print $fh $this->getIndex; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub printWords |
90
|
|
|
|
|
|
|
{ |
91
|
0
|
|
|
0
|
1
|
0
|
my ($this,$words_a,$fh) = @_; |
92
|
|
|
|
|
|
|
# if(!defined $fh) |
93
|
|
|
|
|
|
|
# { |
94
|
|
|
|
|
|
|
# $fh = \*STDERR |
95
|
|
|
|
|
|
|
# } |
96
|
0
|
|
|
|
|
0
|
print $fh $this->getIF($words_a); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub searchRightMostLeaf |
100
|
|
|
|
|
|
|
{ |
101
|
9
|
|
|
9
|
1
|
21
|
my ($this,$depth_r) = @_; |
102
|
9
|
|
|
|
|
20
|
return $this; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub searchLeftMostLeaf |
106
|
|
|
|
|
|
|
{ |
107
|
0
|
|
|
0
|
1
|
|
my ($this) = @_; |
108
|
0
|
|
|
|
|
|
return $this; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
__END__ |