line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::IslandSet; |
2
|
5
|
|
|
5
|
|
36
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
144
|
|
3
|
5
|
|
|
5
|
|
29
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
2754
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
9
|
|
|
9
|
1
|
27
|
my ($class) = @_; |
10
|
9
|
|
|
|
|
30
|
my $this = {}; |
11
|
9
|
|
|
|
|
21
|
bless ($this,$class); |
12
|
9
|
|
|
|
|
48
|
$this->{ISLANDS} = {}; |
13
|
9
|
|
|
|
|
35
|
return $this; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub getIslands |
17
|
|
|
|
|
|
|
{ |
18
|
208
|
|
|
208
|
1
|
336
|
my ($this) = @_; |
19
|
208
|
|
|
|
|
639
|
return $this->{ISLANDS}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub existIsland |
23
|
|
|
|
|
|
|
{ |
24
|
62
|
|
|
62
|
1
|
102
|
my ($this,$index_set) = @_; |
25
|
62
|
|
|
|
|
134
|
my $key = $index_set->joinAll('-'); |
26
|
62
|
100
|
|
|
|
128
|
if(exists $this->getIslands->{$key}) |
27
|
|
|
|
|
|
|
{ |
28
|
2
|
|
|
|
|
9
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
60
|
|
|
|
|
194
|
return 0; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub getIsland |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
1
|
0
|
my ($this,$index_set) = @_; |
36
|
0
|
|
|
|
|
0
|
my $key = $index_set->joinAll('-'); |
37
|
0
|
|
|
|
|
0
|
return $this->getIslands->{$key}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub existLargerIsland |
41
|
|
|
|
|
|
|
{ |
42
|
60
|
|
|
60
|
1
|
119
|
my ($this,$index) = @_; |
43
|
60
|
|
|
|
|
125
|
my $key = $index->joinAll('-'); |
44
|
60
|
|
|
|
|
95
|
my $island; |
45
|
60
|
|
|
|
|
80
|
foreach $island (values (%{$this->getIslands})) |
|
60
|
|
|
|
|
108
|
|
46
|
|
|
|
|
|
|
{ |
47
|
60
|
100
|
|
|
|
149
|
if($index->isCoveredBy($island->getIndexSet)) |
48
|
|
|
|
|
|
|
{ |
49
|
16
|
|
|
|
|
72
|
return 1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
44
|
|
|
|
|
188
|
return 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub addIsland |
56
|
|
|
|
|
|
|
{ |
57
|
9
|
|
|
9
|
1
|
32
|
my ($this,$island,$fh) = @_; |
58
|
9
|
|
|
|
|
36
|
my $key = $island->getIndexSet->joinAll('-'); |
59
|
|
|
|
|
|
|
# print $fh " key: ". $key . " - "; |
60
|
9
|
|
|
|
|
34
|
$this->getIslands->{$key} = $island; |
61
|
|
|
|
|
|
|
# print $fh "\tilot ajoute"; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub removeIsland |
65
|
|
|
|
|
|
|
{ |
66
|
0
|
|
|
0
|
1
|
0
|
my ($this,$island,$fh) = @_; |
67
|
0
|
|
|
|
|
0
|
my $key = $island->getIndexSet->joinAll('-'); |
68
|
0
|
|
|
|
|
0
|
delete($this->getIslands->{$key}); |
69
|
|
|
|
|
|
|
# print $fh "remove"; |
70
|
0
|
|
|
|
|
0
|
$island = undef; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub size |
75
|
|
|
|
|
|
|
{ |
76
|
33
|
|
|
33
|
1
|
65
|
my ($this) = @_; |
77
|
33
|
|
|
|
|
44
|
return scalar (keys %{$this->getIslands}); |
|
33
|
|
|
|
|
80
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub print |
81
|
|
|
|
|
|
|
{ |
82
|
3
|
|
|
3
|
1
|
7
|
my ($this,$fh) = @_; |
83
|
3
|
|
|
|
|
5
|
my $island; |
84
|
3
|
50
|
|
|
|
8
|
if(defined $fh) |
85
|
|
|
|
|
|
|
{ |
86
|
3
|
|
|
|
|
5
|
foreach $island (values (%{$this->getIslands})) |
|
3
|
|
|
|
|
7
|
|
87
|
|
|
|
|
|
|
{ |
88
|
3
|
|
|
|
|
7
|
print $fh "\t"; |
89
|
3
|
|
|
|
|
17
|
$island->print($fh); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
else |
93
|
|
|
|
|
|
|
{ |
94
|
0
|
|
|
|
|
|
foreach $island (values (%{$this->getIslands})) |
|
0
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
{ |
96
|
0
|
|
|
|
|
|
print "\t"; |
97
|
0
|
|
|
|
|
|
$island->print; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
__END__ |