line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::TriggerSet; |
2
|
5
|
|
|
5
|
|
77
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
151
|
|
3
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1393
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
8
|
|
|
8
|
1
|
22
|
my ($class) = @_; |
10
|
8
|
|
|
|
|
18
|
my $this = {}; |
11
|
8
|
|
|
|
|
15
|
bless ($this,$class); |
12
|
8
|
|
|
|
|
26
|
$this->{IF} = {}; |
13
|
8
|
|
|
|
|
19
|
$this->{POS} = {}; |
14
|
8
|
|
|
|
|
15
|
$this->{LF} = {}; |
15
|
8
|
|
|
|
|
26
|
return $this; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub addTrigger |
19
|
|
|
|
|
|
|
{ |
20
|
28
|
|
|
28
|
1
|
53
|
my ($this,$fs) = @_; |
21
|
28
|
|
|
|
|
63
|
my $trigger = $fs->getFirstItem; |
22
|
28
|
|
|
|
|
43
|
push @{$this->getSubset($trigger->getType)->{$trigger->getForm}}, $fs; |
|
28
|
|
|
|
|
84
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub getSubset |
28
|
|
|
|
|
|
|
{ |
29
|
1487
|
|
|
1487
|
1
|
2210
|
my ($this,$type) = @_; |
30
|
1487
|
|
|
|
|
3025
|
return $this->{$type}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub findTrigger |
34
|
|
|
|
|
|
|
{ |
35
|
248
|
|
|
248
|
1
|
417
|
my ($this,$word) = @_; |
36
|
248
|
|
|
|
|
455
|
my @types = ("IF","POS","LF"); |
37
|
248
|
|
|
|
|
347
|
my $type; |
38
|
248
|
|
|
|
|
375
|
foreach $type (@types) |
39
|
|
|
|
|
|
|
{ |
40
|
715
|
50
|
|
|
|
1181
|
if(defined $this->getSubset($type)) |
41
|
|
|
|
|
|
|
{ |
42
|
715
|
100
|
|
|
|
1122
|
if(exists $this->getSubset($type)->{$word->getLexItem->{$type}}) |
43
|
|
|
|
|
|
|
{ |
44
|
29
|
|
|
|
|
57
|
return $this->getSubset($type)->{$word->getLexItem->{$type}}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
219
|
|
|
|
|
687
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |