line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::ForbiddenStructureSet; |
2
|
5
|
|
|
5
|
|
29
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
118
|
|
3
|
5
|
|
|
5
|
|
19
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
97
|
|
4
|
5
|
|
|
5
|
|
1733
|
use Lingua::YaTeA::ForbiddenStructureAny; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
41
|
|
5
|
5
|
|
|
5
|
|
1805
|
use Lingua::YaTeA::ForbiddenStructureStartOrEnd; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
39
|
|
6
|
5
|
|
|
5
|
|
125
|
use Lingua::YaTeA::TriggerSet; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
15
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new |
12
|
|
|
|
|
|
|
{ |
13
|
4
|
|
|
4
|
1
|
14
|
my ($class,$file_path) = @_; |
14
|
4
|
|
|
|
|
10
|
my $this = {}; |
15
|
4
|
|
|
|
|
10
|
bless ($this,$class); |
16
|
4
|
|
|
|
|
28
|
$this->{ANY} = []; |
17
|
4
|
|
|
|
|
11
|
$this->{START} = []; |
18
|
4
|
|
|
|
|
9
|
$this->{END} = []; |
19
|
4
|
|
|
|
|
31
|
$this->{START_TRIGGERS} = Lingua::YaTeA::TriggerSet->new(); |
20
|
4
|
|
|
|
|
12
|
$this->{END_TRIGGERS} = Lingua::YaTeA::TriggerSet->new(); |
21
|
4
|
|
|
|
|
15
|
$this->loadStructures($file_path); |
22
|
4
|
|
|
|
|
23
|
return $this; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub loadStructures |
27
|
|
|
|
|
|
|
{ |
28
|
4
|
|
|
4
|
1
|
9
|
my ($this,$file_path) = @_; |
29
|
|
|
|
|
|
|
|
30
|
4
|
|
|
|
|
9
|
my @infos; |
31
|
4
|
|
|
|
|
24
|
my $fh = FileHandle->new("<$file_path"); |
32
|
4
|
|
|
|
|
237
|
my $line; |
33
|
4
|
|
|
|
|
86
|
while ($line= $fh->getline) |
34
|
|
|
|
|
|
|
{ |
35
|
304
|
100
|
100
|
|
|
7508
|
if(($line !~ /^#/)&&($line !~ /^\s*$/)) |
36
|
|
|
|
|
|
|
{ |
37
|
200
|
|
|
|
|
523
|
@infos = split /\t/, $line; |
38
|
200
|
|
|
|
|
471
|
$this->cleanInfos(\@infos); |
39
|
200
|
100
|
|
|
|
352
|
if($infos[1] eq "ANY") |
40
|
|
|
|
|
|
|
{ |
41
|
172
|
|
|
|
|
366
|
my $fs = Lingua::YaTeA::ForbiddenStructureAny->new(\@infos); |
42
|
172
|
|
|
|
|
230
|
push @{$this->{ANY}}, $fs; |
|
172
|
|
|
|
|
2898
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else{ |
45
|
28
|
|
|
|
|
36
|
chomp $infos[1]; |
46
|
28
|
50
|
66
|
|
|
95
|
if(($infos[1] eq "START") ||($infos[1] eq "END") ) |
47
|
|
|
|
|
|
|
{ |
48
|
28
|
|
|
|
|
66
|
my $fs = Lingua::YaTeA::ForbiddenStructureStartOrEnd->new(\@infos,$this->getTriggerSet($infos[1])); |
49
|
28
|
|
|
|
|
37
|
push @{$this->{$infos[1]}}, $fs; |
|
28
|
|
|
|
|
566
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
4
|
|
|
|
|
273
|
$this->sort($this->getSubset("START")); |
55
|
4
|
|
|
|
|
10
|
$this->sort($this->getSubset("END")); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub getTriggerSet |
62
|
|
|
|
|
|
|
{ |
63
|
276
|
|
|
276
|
1
|
453
|
my ($this,$position) = @_; |
64
|
276
|
|
|
|
|
518
|
my $name = $position . "_TRIGGERS"; |
65
|
276
|
|
|
|
|
664
|
return $this->{$name}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub getSubset |
69
|
|
|
|
|
|
|
{ |
70
|
28
|
|
|
28
|
1
|
69
|
my ($this,$name) = @_; |
71
|
28
|
|
|
|
|
71
|
return $this->{$name}; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub cleanInfos |
76
|
|
|
|
|
|
|
{ |
77
|
200
|
|
|
200
|
1
|
300
|
my ($this,$infos_a) = @_; |
78
|
200
|
|
|
|
|
220
|
my $info; |
79
|
200
|
|
|
|
|
303
|
foreach $info (@$infos_a) |
80
|
|
|
|
|
|
|
{ |
81
|
632
|
|
|
|
|
722
|
chomp $info; |
82
|
632
|
|
|
|
|
859
|
$info =~ s/\r//g; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub sort |
87
|
|
|
|
|
|
|
{ |
88
|
8
|
|
|
8
|
1
|
15
|
my ($this,$subset) = @_; |
89
|
|
|
|
|
|
|
|
90
|
8
|
|
|
|
|
27
|
@$subset = sort ({$b->getLength <=> $a->getLength} @$subset); |
|
32
|
|
|
|
|
75
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__END__ |