line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::Island; |
2
|
5
|
|
|
5
|
|
28
|
use strict; |
|
5
|
|
|
|
|
27
|
|
|
5
|
|
|
|
|
114
|
|
3
|
5
|
|
|
5
|
|
21
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
2649
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $id = 0; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
9
|
|
|
9
|
1
|
24
|
my ($class,$index,$type,$source) = @_; |
12
|
9
|
|
|
|
|
16
|
my $this = {}; |
13
|
9
|
|
|
|
|
16
|
bless ($this,$class); |
14
|
9
|
|
|
|
|
33
|
$this->{ID} = $id++; |
15
|
9
|
|
|
|
|
25
|
$this->{INDEX_SET} = $index; |
16
|
9
|
|
|
|
|
21
|
$this->{TYPE} = $type; |
17
|
9
|
|
|
|
|
19
|
$this->{SOURCE} = $source; |
18
|
9
|
|
|
|
|
23
|
$this->{INTEGRATED} = 0; |
19
|
9
|
|
|
|
|
22
|
return $this; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub getIndexSet |
23
|
|
|
|
|
|
|
{ |
24
|
186
|
|
|
186
|
1
|
257
|
my ($this) = @_; |
25
|
186
|
|
|
|
|
383
|
return $this->{INDEX_SET}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub isIntegrated |
29
|
|
|
|
|
|
|
{ |
30
|
11
|
|
|
11
|
0
|
20
|
my ($this) = @_; |
31
|
11
|
|
|
|
|
33
|
return $this->{INTEGRATED}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub getType |
36
|
|
|
|
|
|
|
{ |
37
|
43
|
|
|
43
|
1
|
64
|
my ($this) = @_; |
38
|
43
|
|
|
|
|
116
|
return $this->{TYPE}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub getParsingMethod |
43
|
|
|
|
|
|
|
{ |
44
|
3
|
|
|
3
|
1
|
10
|
my ($this) = @_; |
45
|
3
|
|
|
|
|
6
|
return $this->getSource->getParsingMethod; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub getIF |
49
|
|
|
|
|
|
|
{ |
50
|
3
|
|
|
3
|
1
|
6
|
my ($this) = @_; |
51
|
3
|
|
|
|
|
6
|
return $this->getSource->getIF; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub getSource |
55
|
|
|
|
|
|
|
{ |
56
|
115
|
|
|
115
|
1
|
168
|
my ($this) = @_; |
57
|
115
|
|
|
|
|
294
|
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
|
22
|
my ($this) = @_; |
72
|
9
|
|
|
|
|
20
|
my $node_sets_a; |
73
|
|
|
|
|
|
|
my $tree; |
74
|
9
|
|
|
|
|
0
|
my $node_set; |
75
|
9
|
|
|
|
|
22
|
$node_sets_a = $this->getSource->exportNodeSets; |
76
|
|
|
|
|
|
|
|
77
|
9
|
|
|
|
|
18
|
foreach $node_set (@$node_sets_a) |
78
|
|
|
|
|
|
|
{ |
79
|
9
|
|
|
|
|
22
|
$node_set->updateLeaves($this->getIndexSet); |
80
|
|
|
|
|
|
|
} |
81
|
9
|
|
|
|
|
28
|
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
|
5
|
my ($this,$fh) = @_; |
106
|
|
|
|
|
|
|
|
107
|
3
|
50
|
|
|
|
7
|
if(defined $fh) |
108
|
|
|
|
|
|
|
{ |
109
|
3
|
|
|
|
|
7
|
print $fh "form: " . $this->getIF; |
110
|
3
|
|
|
|
|
5
|
print $fh " - indexes: "; |
111
|
3
|
|
|
|
|
7
|
$this->getIndexSet->print($fh); |
112
|
3
|
|
|
|
|
7
|
print $fh "- parsing method : " . $this->getParsingMethod; |
113
|
3
|
|
|
|
|
8
|
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__ |