line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::LexiconItem; |
2
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
133
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
2069
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $counter =0; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
600
|
|
|
600
|
1
|
952
|
my ($class,$form) = @_; |
12
|
600
|
|
|
|
|
958
|
my $this = {}; |
13
|
600
|
|
|
|
|
992
|
bless ($this,$class); |
14
|
600
|
|
|
|
|
1080
|
$this->{ID} = $counter; |
15
|
600
|
|
|
|
|
2151
|
my @lex_infos = split /\t/, $form; |
16
|
600
|
|
|
|
|
1290
|
$this->{IF} = $lex_infos[0]; |
17
|
600
|
|
|
|
|
1184
|
$this->{POS} = $lex_infos[1]; |
18
|
600
|
|
|
|
|
1205
|
$this->{LF} = $this->setLF($lex_infos[2],$this->{IF}); |
19
|
600
|
|
|
|
|
1192
|
$this->{LENGTH} = $this->setLength; |
20
|
600
|
|
|
|
|
999
|
$this->{FREQUENCY} = 0; |
21
|
600
|
|
|
|
|
1395
|
return $this; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub setLF |
26
|
|
|
|
|
|
|
{ |
27
|
600
|
|
|
600
|
1
|
1125
|
my ($this,$LF,$IF) = @_; |
28
|
600
|
50
|
|
|
|
1120
|
if (defined $LF) { |
29
|
600
|
50
|
|
|
|
1506
|
if ($LF =~ /(\)|(\@card@)/){ # si le lemme est inconnu du tagger (TTG) : lemme = forme flechie |
30
|
0
|
|
|
|
|
0
|
return $IF; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
0
|
$LF = ""; |
34
|
|
|
|
|
|
|
} |
35
|
600
|
|
|
|
|
1463
|
return $LF; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub setLength |
39
|
|
|
|
|
|
|
{ |
40
|
600
|
|
|
600
|
1
|
928
|
my ($this) = @_; |
41
|
600
|
|
|
|
|
1529
|
return length($this->{IF}); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub incrementFrequency |
45
|
|
|
|
|
|
|
{ |
46
|
600
|
|
|
600
|
1
|
906
|
my ($this) = @_; |
47
|
600
|
|
|
|
|
1088
|
$this->{FREQUENCY}++; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub getID |
51
|
|
|
|
|
|
|
{ |
52
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
53
|
0
|
|
|
|
|
0
|
return $this->{ID}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub getIF |
57
|
|
|
|
|
|
|
{ |
58
|
8105
|
|
|
8105
|
1
|
13011
|
my ($this) = @_; |
59
|
8105
|
|
|
|
|
23621
|
return $this->{IF}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub getPOS |
63
|
|
|
|
|
|
|
{ |
64
|
6618
|
|
|
6618
|
1
|
10346
|
my ($this) = @_; |
65
|
6618
|
|
|
|
|
18386
|
return $this->{POS}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub getLF |
69
|
|
|
|
|
|
|
{ |
70
|
9249
|
|
|
9249
|
1
|
14143
|
my ($this) = @_; |
71
|
9249
|
|
|
|
|
26615
|
return $this->{LF}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub getLength |
75
|
|
|
|
|
|
|
{ |
76
|
1115
|
|
|
1115
|
1
|
1778
|
my ($this) = @_; |
77
|
1115
|
|
|
|
|
2775
|
return $this->{LENGTH}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub getFrequency |
81
|
|
|
|
|
|
|
{ |
82
|
0
|
|
|
0
|
1
|
0
|
my ($this) = @_; |
83
|
0
|
|
|
|
|
0
|
return $this->{FREQUENCY}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub getAny |
87
|
|
|
|
|
|
|
{ |
88
|
18578
|
|
|
18578
|
1
|
29525
|
my ($this,$field) = @_; |
89
|
18578
|
|
|
|
|
45906
|
return $this->{$field}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub isCleaningFrontier |
93
|
|
|
|
|
|
|
{ |
94
|
4814
|
|
|
4814
|
1
|
8293
|
my ($this,$chunking_data) = @_; |
95
|
4814
|
|
|
|
|
9067
|
my @types = ("POS", "LF", "IF"); |
96
|
4814
|
|
|
|
|
6355
|
my $type; |
97
|
4814
|
|
|
|
|
8264
|
foreach $type (@types) |
98
|
|
|
|
|
|
|
{ |
99
|
6362
|
100
|
|
|
|
11324
|
if ($chunking_data->existData("CleaningFrontiers",$type,$this->getAny($type)) == 1) |
100
|
|
|
|
|
|
|
{ |
101
|
4040
|
50
|
|
|
|
7751
|
if (! $this->isCleaningException($chunking_data)) |
102
|
|
|
|
|
|
|
{ |
103
|
4040
|
|
|
|
|
16515
|
return 1; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
774
|
|
|
|
|
3898
|
return 0; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub isCleaningException |
111
|
|
|
|
|
|
|
{ |
112
|
4040
|
|
|
4040
|
1
|
6605
|
my ($this,$chunking_data) = @_; |
113
|
4040
|
|
|
|
|
7848
|
my @types = ("POS", "LF", "IF"); |
114
|
4040
|
|
|
|
|
5298
|
my $type; |
115
|
4040
|
|
|
|
|
6465
|
foreach $type (@types) |
116
|
|
|
|
|
|
|
{ |
117
|
12120
|
50
|
|
|
|
20348
|
if ($chunking_data->existData("CleaningExceptions",$type,$this->getAny($type)) == 1) |
118
|
|
|
|
|
|
|
{ |
119
|
0
|
|
|
|
|
0
|
return 1; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
} |
122
|
4040
|
|
|
|
|
9268
|
return 0; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
__END__ |