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