line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::IslandSet; |
2
|
5
|
|
|
5
|
|
35
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
158
|
|
3
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
2768
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
9
|
|
|
9
|
1
|
31
|
my ($class) = @_; |
10
|
9
|
|
|
|
|
32
|
my $this = {}; |
11
|
9
|
|
|
|
|
22
|
bless ($this,$class); |
12
|
9
|
|
|
|
|
54
|
$this->{ISLANDS} = {}; |
13
|
9
|
|
|
|
|
37
|
return $this; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub getIslands |
17
|
|
|
|
|
|
|
{ |
18
|
208
|
|
|
208
|
1
|
342
|
my ($this) = @_; |
19
|
208
|
|
|
|
|
672
|
return $this->{ISLANDS}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub existIsland |
23
|
|
|
|
|
|
|
{ |
24
|
62
|
|
|
62
|
1
|
114
|
my ($this,$index_set) = @_; |
25
|
62
|
|
|
|
|
144
|
my $key = $index_set->joinAll('-'); |
26
|
62
|
100
|
|
|
|
138
|
if(exists $this->getIslands->{$key}) |
27
|
|
|
|
|
|
|
{ |
28
|
2
|
|
|
|
|
8
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
60
|
|
|
|
|
207
|
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
|
117
|
my ($this,$index) = @_; |
43
|
60
|
|
|
|
|
126
|
my $key = $index->joinAll('-'); |
44
|
60
|
|
|
|
|
103
|
my $island; |
45
|
60
|
|
|
|
|
86
|
foreach $island (values (%{$this->getIslands})) |
|
60
|
|
|
|
|
107
|
|
46
|
|
|
|
|
|
|
{ |
47
|
60
|
100
|
|
|
|
158
|
if($index->isCoveredBy($island->getIndexSet)) |
48
|
|
|
|
|
|
|
{ |
49
|
16
|
|
|
|
|
80
|
return 1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
44
|
|
|
|
|
168
|
return 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub addIsland |
56
|
|
|
|
|
|
|
{ |
57
|
9
|
|
|
9
|
1
|
28
|
my ($this,$island,$fh) = @_; |
58
|
9
|
|
|
|
|
42
|
my $key = $island->getIndexSet->joinAll('-'); |
59
|
|
|
|
|
|
|
# print $fh " key: ". $key . " - "; |
60
|
9
|
|
|
|
|
41
|
$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
|
67
|
my ($this) = @_; |
77
|
33
|
|
|
|
|
49
|
return scalar (keys %{$this->getIslands}); |
|
33
|
|
|
|
|
80
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub print |
81
|
|
|
|
|
|
|
{ |
82
|
3
|
|
|
3
|
1
|
8
|
my ($this,$fh) = @_; |
83
|
3
|
|
|
|
|
7
|
my $island; |
84
|
3
|
50
|
|
|
|
9
|
if(defined $fh) |
85
|
|
|
|
|
|
|
{ |
86
|
3
|
|
|
|
|
5
|
foreach $island (values (%{$this->getIslands})) |
|
3
|
|
|
|
|
9
|
|
87
|
|
|
|
|
|
|
{ |
88
|
3
|
|
|
|
|
8
|
print $fh "\t"; |
89
|
3
|
|
|
|
|
15
|
$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__ |