line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::TermLeaf; |
2
|
5
|
|
|
5
|
|
1886
|
use Lingua::YaTeA::Edge; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
62
|
|
3
|
5
|
|
|
5
|
|
130
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
90
|
|
4
|
5
|
|
|
5
|
|
33
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
2683
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::Edge); |
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
278
|
|
|
278
|
1
|
522
|
my ($class,$index) = @_; |
12
|
278
|
|
|
|
|
669
|
my $this = $class->SUPER::new; |
13
|
278
|
|
|
|
|
599
|
$this->{INDEX} = $index; |
14
|
278
|
|
|
|
|
443
|
bless ($this,$class); |
15
|
278
|
|
|
|
|
746
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub getIF |
20
|
|
|
|
|
|
|
{ |
21
|
836
|
|
|
836
|
1
|
1433
|
my ($this,$words_a) = @_; |
22
|
836
|
|
|
|
|
1536
|
return $words_a->[$this->getIndex]->getIF; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub getPOS |
28
|
|
|
|
|
|
|
{ |
29
|
456
|
|
|
456
|
1
|
741
|
my ($this,$words_a) = @_; |
30
|
456
|
|
|
|
|
761
|
return $words_a->[$this->getIndex]->getPOS; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getLF |
34
|
|
|
|
|
|
|
{ |
35
|
408
|
|
|
408
|
1
|
657
|
my ($this,$words_a) = @_; |
36
|
408
|
|
|
|
|
655
|
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
|
6204
|
my ($this) = @_; |
49
|
4261
|
|
|
|
|
11528
|
return $this->{INDEX}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub getLength |
53
|
|
|
|
|
|
|
{ |
54
|
408
|
|
|
408
|
1
|
682
|
my ($this,$words_a) = @_; |
55
|
408
|
|
|
|
|
678
|
return $words_a->[$this->getIndex]->getLength; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub getWord |
59
|
|
|
|
|
|
|
{ |
60
|
32
|
|
|
32
|
1
|
58
|
my ($this,$words_a) = @_; |
61
|
32
|
|
|
|
|
59
|
return $words_a->[$this->getIndex]; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub searchHead |
65
|
|
|
|
|
|
|
{ |
66
|
606
|
|
|
606
|
1
|
1007
|
my ($this) = @_; |
67
|
606
|
|
|
|
|
1714
|
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
|
26
|
my ($this,$depth_r) = @_; |
102
|
9
|
|
|
|
|
28
|
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__ |