line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Taxon::Parse::Taxon; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1169
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1588
|
use parent qw( Taxon::Parse ); |
|
1
|
|
|
|
|
480
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.013'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
6
|
my $p = $self->{pattern_parts}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# l_ - patterns for latin names |
17
|
1
|
|
|
|
|
4
|
$p->{apostrophe} = qr/[\'´`]/xms; |
18
|
1
|
|
|
|
|
3
|
$p->{compound_connector} = qr/[-]/xms; |
19
|
1
|
|
|
|
|
3
|
$p->{NAME_LETTERS} = qr/[A-ZÏËÖÜÄÉÈČÁÀÆŒ]/xms; |
20
|
1
|
|
|
|
|
3
|
$p->{name_letters} = qr/[a-zïëöüäåéèčáàæœſú]/xms; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
3
|
$p->{word} = qr/ |
24
|
|
|
|
|
|
|
\b |
25
|
|
|
|
|
|
|
[\p{Latin}]+ |
26
|
|
|
|
|
|
|
\b |
27
|
1
|
|
|
1
|
|
196
|
/xms; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
28
|
1
|
|
|
|
|
20
|
$p->{compound} = qr/ |
29
|
|
|
|
|
|
|
$p->{word} |
30
|
|
|
|
|
|
|
[-] |
31
|
|
|
|
|
|
|
$p->{word} |
32
|
|
|
|
|
|
|
/xms; |
33
|
1
|
|
|
|
|
170
|
$p->{group} = qr/ |
34
|
|
|
|
|
|
|
\b |
35
|
|
|
|
|
|
|
$p->{NAME_LETTERS} |
36
|
|
|
|
|
|
|
$p->{name_letters}+ |
37
|
|
|
|
|
|
|
\b |
38
|
|
|
|
|
|
|
\?? |
39
|
|
|
|
|
|
|
/xms; |
40
|
1
|
|
|
|
|
66
|
$p->{epithet} = qr/ |
41
|
|
|
|
|
|
|
×? |
42
|
|
|
|
|
|
|
$p->{name_letters}+ |
43
|
|
|
|
|
|
|
(?: |
44
|
|
|
|
|
|
|
[-]? |
45
|
|
|
|
|
|
|
$p->{name_letters}+ |
46
|
|
|
|
|
|
|
)? |
47
|
|
|
|
|
|
|
/xms; |
48
|
1
|
|
|
|
|
8
|
$p->{abbrev} = qr/ |
49
|
|
|
|
|
|
|
[\p{Latin}]{1,3} |
50
|
|
|
|
|
|
|
[\.] |
51
|
|
|
|
|
|
|
/xms; |
52
|
1
|
|
|
|
|
43
|
$p->{bracketed} = qr/ |
53
|
|
|
|
|
|
|
[(\[] |
54
|
|
|
|
|
|
|
\s* |
55
|
|
|
|
|
|
|
(?: |
56
|
|
|
|
|
|
|
$p->{group} |
57
|
|
|
|
|
|
|
| $p->{abbrev} |
58
|
|
|
|
|
|
|
) |
59
|
|
|
|
|
|
|
\s* |
60
|
|
|
|
|
|
|
[)\]] |
61
|
|
|
|
|
|
|
/xms; |
62
|
1
|
|
|
|
|
113
|
$p->{infragenus} = qr/ |
63
|
|
|
|
|
|
|
(?: |
64
|
|
|
|
|
|
|
$p->{bracketed} |
65
|
|
|
|
|
|
|
| (?: |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
(?: ser|subg|sect|trib ) |
68
|
|
|
|
|
|
|
\. \s* $p->{group} |
69
|
|
|
|
|
|
|
) |
70
|
|
|
|
|
|
|
) |
71
|
|
|
|
|
|
|
/xms; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
183
|
$p->{genus} = qr/ |
74
|
|
|
|
|
|
|
$p->{group} |
75
|
|
|
|
|
|
|
(?: |
76
|
|
|
|
|
|
|
\s* |
77
|
|
|
|
|
|
|
$p->{infragenus} |
78
|
|
|
|
|
|
|
)? |
79
|
|
|
|
|
|
|
/xms; |
80
|
1
|
|
|
|
|
176
|
$p->{species} = qr/ |
81
|
|
|
|
|
|
|
$p->{genus} |
82
|
|
|
|
|
|
|
\s+ |
83
|
|
|
|
|
|
|
$p->{epithet} |
84
|
|
|
|
|
|
|
/xms; |
85
|
1
|
|
|
|
|
128
|
$p->{species_marker} = qr/ |
86
|
|
|
|
|
|
|
(?:(?: |
87
|
|
|
|
|
|
|
subsp |
88
|
|
|
|
|
|
|
|ssp |
89
|
|
|
|
|
|
|
|var |
90
|
|
|
|
|
|
|
|v |
91
|
|
|
|
|
|
|
|subvar |
92
|
|
|
|
|
|
|
|subv |
93
|
|
|
|
|
|
|
|sv |
94
|
|
|
|
|
|
|
|forma |
95
|
|
|
|
|
|
|
|form |
96
|
|
|
|
|
|
|
|fo |
97
|
|
|
|
|
|
|
|f |
98
|
|
|
|
|
|
|
|subform |
99
|
|
|
|
|
|
|
|subf |
100
|
|
|
|
|
|
|
|sf |
101
|
|
|
|
|
|
|
|cv |
102
|
|
|
|
|
|
|
|cf |
103
|
|
|
|
|
|
|
|hort |
104
|
|
|
|
|
|
|
|m |
105
|
|
|
|
|
|
|
|morph |
106
|
|
|
|
|
|
|
|nat |
107
|
|
|
|
|
|
|
|ab |
108
|
|
|
|
|
|
|
|aberration |
109
|
|
|
|
|
|
|
|agg |
110
|
|
|
|
|
|
|
|aff |
111
|
|
|
|
|
|
|
|[xX×] |
112
|
|
|
|
|
|
|
|\? |
113
|
|
|
|
|
|
|
)\.?) |
114
|
|
|
|
|
|
|
/xms; |
115
|
1
|
|
|
|
|
4
|
$p->{sensu} = qr/ |
116
|
|
|
|
|
|
|
(?: |
117
|
|
|
|
|
|
|
(?: |
118
|
|
|
|
|
|
|
(?:s\.|sensu\b)\s* |
119
|
|
|
|
|
|
|
(?:l\.|str\.|latu\b|strictu?\b) |
120
|
|
|
|
|
|
|
) |
121
|
|
|
|
|
|
|
| |
122
|
|
|
|
|
|
|
(?: |
123
|
|
|
|
|
|
|
(?: |
124
|
|
|
|
|
|
|
sec\.? |
125
|
|
|
|
|
|
|
|sensu |
126
|
|
|
|
|
|
|
|[aA]uct\.?(?: \s* \b non)? |
127
|
|
|
|
|
|
|
|non |
128
|
|
|
|
|
|
|
) |
129
|
|
|
|
|
|
|
) |
130
|
|
|
|
|
|
|
) |
131
|
|
|
|
|
|
|
/xms; |
132
|
1
|
|
|
|
|
65
|
$p->{list} = qr/ |
133
|
|
|
|
|
|
|
$p->{group} |
134
|
|
|
|
|
|
|
\s* |
135
|
|
|
|
|
|
|
(?: |
136
|
|
|
|
|
|
|
[,]\s* |
137
|
|
|
|
|
|
|
$p->{group} |
138
|
|
|
|
|
|
|
)+ |
139
|
|
|
|
|
|
|
/xms; |
140
|
1
|
|
|
|
|
99
|
$p->{name} = qr/ |
141
|
|
|
|
|
|
|
(?: ["] \s* )? |
142
|
|
|
|
|
|
|
$p->{genus} |
143
|
|
|
|
|
|
|
(?: |
144
|
|
|
|
|
|
|
(?: |
145
|
|
|
|
|
|
|
\s+ |
146
|
|
|
|
|
|
|
$p->{species_marker} |
147
|
|
|
|
|
|
|
)? |
148
|
|
|
|
|
|
|
\s+ |
149
|
|
|
|
|
|
|
$p->{epithet} |
150
|
|
|
|
|
|
|
)* |
151
|
|
|
|
|
|
|
(?: ["] \s* )? |
152
|
|
|
|
|
|
|
(?: |
153
|
|
|
|
|
|
|
\s+ |
154
|
|
|
|
|
|
|
$p->{sensu} |
155
|
|
|
|
|
|
|
)? |
156
|
|
|
|
|
|
|
/xms; |
157
|
1
|
|
|
|
|
413
|
$p->{namecaptured} = qr/ |
158
|
|
|
|
|
|
|
(?: ["] \s* )? |
159
|
|
|
|
|
|
|
(? $p->{genus} ) |
160
|
|
|
|
|
|
|
(?: |
161
|
|
|
|
|
|
|
(?: |
162
|
|
|
|
|
|
|
\s+ |
163
|
|
|
|
|
|
|
(? $p->{species_marker} ) |
164
|
|
|
|
|
|
|
)? |
165
|
|
|
|
|
|
|
\s+ |
166
|
|
|
|
|
|
|
(? $p->{epithet} ) |
167
|
|
|
|
|
|
|
)* |
168
|
|
|
|
|
|
|
(?: ["] \s* )? |
169
|
|
|
|
|
|
|
(?: |
170
|
|
|
|
|
|
|
\s+ |
171
|
|
|
|
|
|
|
(? $p->{sensu} ) |
172
|
|
|
|
|
|
|
)? |
173
|
|
|
|
|
|
|
/xms; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
176
|
1
|
|
|
|
|
238
|
my $patterns = $self->{patterns}; |
177
|
1
|
|
|
|
|
3
|
my @patterns = qw< name group genus species list epithet namecaptured>; |
178
|
1
|
|
|
|
|
3
|
map { $patterns->{$_} = $p->{$_} } @patterns; |
|
7
|
|
|
|
|
14
|
|
179
|
1
|
|
|
|
|
3
|
$self->{scores} = $self->scores(); |
180
|
1
|
|
|
|
|
27
|
$self->{order}->{namecaptured} = [qw< genus species_marker epithet sensu >]; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
sub scores { |
184
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
return { |
187
|
1
|
|
|
|
|
4
|
group => 0.5, |
188
|
|
|
|
|
|
|
species => 1, |
189
|
|
|
|
|
|
|
list => 0.75, |
190
|
|
|
|
|
|
|
epithet => 0.5, |
191
|
|
|
|
|
|
|
}; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
1; |