line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::Island; |
2
|
5
|
|
|
5
|
|
34
|
use strict; |
|
5
|
|
|
|
|
34
|
|
|
5
|
|
|
|
|
138
|
|
3
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
3343
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $id = 0; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
9
|
|
|
9
|
1
|
33
|
my ($class,$index,$type,$source) = @_; |
12
|
9
|
|
|
|
|
20
|
my $this = {}; |
13
|
9
|
|
|
|
|
24
|
bless ($this,$class); |
14
|
9
|
|
|
|
|
41
|
$this->{ID} = $id++; |
15
|
9
|
|
|
|
|
30
|
$this->{INDEX_SET} = $index; |
16
|
9
|
|
|
|
|
30
|
$this->{TYPE} = $type; |
17
|
9
|
|
|
|
|
20
|
$this->{SOURCE} = $source; |
18
|
9
|
|
|
|
|
22
|
$this->{INTEGRATED} = 0; |
19
|
9
|
|
|
|
|
35
|
return $this; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub getIndexSet |
23
|
|
|
|
|
|
|
{ |
24
|
186
|
|
|
186
|
1
|
303
|
my ($this) = @_; |
25
|
186
|
|
|
|
|
515
|
return $this->{INDEX_SET}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub isIntegrated |
29
|
|
|
|
|
|
|
{ |
30
|
11
|
|
|
11
|
0
|
30
|
my ($this) = @_; |
31
|
11
|
|
|
|
|
42
|
return $this->{INTEGRATED}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub getType |
36
|
|
|
|
|
|
|
{ |
37
|
43
|
|
|
43
|
1
|
78
|
my ($this) = @_; |
38
|
43
|
|
|
|
|
143
|
return $this->{TYPE}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub getParsingMethod |
43
|
|
|
|
|
|
|
{ |
44
|
3
|
|
|
3
|
1
|
17
|
my ($this) = @_; |
45
|
3
|
|
|
|
|
8
|
return $this->getSource->getParsingMethod; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub getIF |
49
|
|
|
|
|
|
|
{ |
50
|
3
|
|
|
3
|
1
|
6
|
my ($this) = @_; |
51
|
3
|
|
|
|
|
8
|
return $this->getSource->getIF; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub getSource |
55
|
|
|
|
|
|
|
{ |
56
|
115
|
|
|
115
|
1
|
170
|
my ($this) = @_; |
57
|
115
|
|
|
|
|
401
|
return $this->{SOURCE}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub getID |
63
|
|
|
|
|
|
|
{ |
64
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
65
|
0
|
|
|
|
|
0
|
return $this->{ID}; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub importNodeSets |
70
|
|
|
|
|
|
|
{ |
71
|
9
|
|
|
9
|
1
|
25
|
my ($this) = @_; |
72
|
9
|
|
|
|
|
28
|
my $node_sets_a; |
73
|
|
|
|
|
|
|
my $tree; |
74
|
9
|
|
|
|
|
0
|
my $node_set; |
75
|
9
|
|
|
|
|
30
|
$node_sets_a = $this->getSource->exportNodeSets; |
76
|
|
|
|
|
|
|
|
77
|
9
|
|
|
|
|
26
|
foreach $node_set (@$node_sets_a) |
78
|
|
|
|
|
|
|
{ |
79
|
9
|
|
|
|
|
30
|
$node_set->updateLeaves($this->getIndexSet); |
80
|
|
|
|
|
|
|
} |
81
|
9
|
|
|
|
|
34
|
return $node_sets_a; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub gapSize |
85
|
|
|
|
|
|
|
{ |
86
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
87
|
0
|
|
|
|
|
0
|
my $i; |
88
|
0
|
|
|
|
|
0
|
my $gap =0; |
89
|
0
|
|
|
|
|
0
|
my $index = $this->getIndexSet->getIndexes->[0]; |
90
|
0
|
|
|
|
|
0
|
for ($i=1; $i < scalar @{$this->getIndexSet->getIndexes}; $i++) |
|
0
|
|
|
|
|
0
|
|
91
|
|
|
|
|
|
|
{ |
92
|
0
|
0
|
|
|
|
0
|
if($this->getIndexSet->getIndexes->[$i] != $index + 1) |
93
|
|
|
|
|
|
|
{ |
94
|
|
|
|
|
|
|
# return 0; |
95
|
0
|
|
|
|
|
0
|
$gap += $this->getIndexSet->getIndexes->[$i] - $index; |
96
|
|
|
|
|
|
|
} |
97
|
0
|
|
|
|
|
0
|
$index = $this->getIndexSet->getIndexes->[$i]; |
98
|
|
|
|
|
|
|
} |
99
|
0
|
|
|
|
|
0
|
return $gap; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub print |
104
|
|
|
|
|
|
|
{ |
105
|
3
|
|
|
3
|
1
|
9
|
my ($this,$fh) = @_; |
106
|
|
|
|
|
|
|
|
107
|
3
|
50
|
|
|
|
6
|
if(defined $fh) |
108
|
|
|
|
|
|
|
{ |
109
|
3
|
|
|
|
|
9
|
print $fh "form: " . $this->getIF; |
110
|
3
|
|
|
|
|
7
|
print $fh " - indexes: "; |
111
|
3
|
|
|
|
|
9
|
$this->getIndexSet->print($fh); |
112
|
3
|
|
|
|
|
10
|
print $fh "- parsing method : " . $this->getParsingMethod; |
113
|
3
|
|
|
|
|
10
|
print $fh " - type: " . $this->getType . "\n"; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
else |
118
|
|
|
|
|
|
|
{ |
119
|
0
|
|
|
|
|
|
print "form: " . $this->getIF; |
120
|
0
|
|
|
|
|
|
print " - indexes: "; |
121
|
0
|
|
|
|
|
|
$this->getIndexSet->print; |
122
|
0
|
|
|
|
|
|
print " - type: " . $this->getType . "\n"; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
__END__ |