biodiversity19 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -0
- data/.ruby-version +1 -1
- data/CHANGELOG +2 -0
- data/LICENSE +1 -1
- data/README.md +3 -3
- data/Rakefile +14 -14
- data/biodiversity.gemspec +19 -19
- data/lib/biodiversity/parser.rb +1 -1
- data/lib/biodiversity/parser/scientific_name_canonical.rb +13 -13
- data/lib/biodiversity/parser/scientific_name_canonical.treetop +17 -17
- data/lib/biodiversity/parser/scientific_name_clean.rb +163 -131
- data/lib/biodiversity/parser/scientific_name_clean.treetop +62 -56
- data/lib/biodiversity/parser/scientific_name_dirty.rb +36 -36
- data/lib/biodiversity/parser/scientific_name_dirty.treetop +50 -53
- data/lib/biodiversity/version.rb +2 -2
- data/spec/files/test_data.txt +6 -1
- data/spec/parser/scientific_name_canonical_spec.rb +21 -21
- data/spec/parser/scientific_name_clean_spec.rb +750 -500
- data/spec/parser/scientific_name_dirty_spec.rb +91 -90
- data/spec/parser/scientific_name_spec.rb +3 -1
- data/spec/spec_helper.rb +21 -21
- metadata +17 -16
@@ -5,21 +5,21 @@ grammar ScientificNameDirty
|
|
5
5
|
rule root
|
6
6
|
space a:scientific_name_5 space {
|
7
7
|
def value
|
8
|
-
a.value.gsub(/\s{2,}/,
|
8
|
+
a.value.gsub(/\s{2,}/, " ").strip
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def canonical
|
12
|
-
a.canonical.gsub(/\s{2,}/,
|
12
|
+
a.canonical.gsub(/\s{2,}/, " ").strip
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
def pos
|
16
16
|
a.pos
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def hybrid
|
20
20
|
a.hybrid
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def details
|
24
24
|
a.details.class == Array ? a.details : [a.details]
|
25
25
|
end
|
@@ -35,15 +35,15 @@ grammar ScientificNameDirty
|
|
35
35
|
def value
|
36
36
|
a.value
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def canonical
|
40
40
|
a.canonical
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def pos
|
44
44
|
a.pos
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def details
|
48
48
|
a.details
|
49
49
|
end
|
@@ -57,15 +57,15 @@ grammar ScientificNameDirty
|
|
57
57
|
def value
|
58
58
|
a.value + " " + b.value
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
def canonical
|
62
62
|
a.canonical
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def pos
|
66
66
|
a.pos.merge(b.pos)
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def details
|
70
70
|
{:infraspecies => a.details[:infraspecies].merge(b.details)}
|
71
71
|
end
|
@@ -75,15 +75,15 @@ grammar ScientificNameDirty
|
|
75
75
|
def value
|
76
76
|
a.value + " " + b.value
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
def canonical
|
80
80
|
a.canonical
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
def pos
|
84
84
|
a.pos.merge(b.pos)
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
def details
|
88
88
|
{:infraspecies => a.details[:infraspecies].merge(b.details)}
|
89
89
|
end
|
@@ -91,21 +91,21 @@ grammar ScientificNameDirty
|
|
91
91
|
/
|
92
92
|
super
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
rule species
|
96
96
|
a:species_string space b:year {
|
97
97
|
def value
|
98
98
|
a.value + " " + b.value
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
def canonical
|
102
102
|
a.canonical
|
103
103
|
end
|
104
|
-
|
104
|
+
|
105
105
|
def pos
|
106
106
|
a.pos.merge(b.pos)
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
def details
|
110
110
|
{:species => a.details[:species].merge(b.details)}
|
111
111
|
end
|
@@ -117,14 +117,14 @@ grammar ScientificNameDirty
|
|
117
117
|
rule latin_word
|
118
118
|
a:[a-z\-æœàâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž] b:valid_name_letters {
|
119
119
|
def value
|
120
|
-
res =
|
121
|
-
text_value.split(
|
122
|
-
l =
|
123
|
-
l =
|
120
|
+
res = ""
|
121
|
+
text_value.split("").each do |l|
|
122
|
+
l = "ae" if l == "æ"
|
123
|
+
l = "oe" if l == "œ"
|
124
124
|
res << l
|
125
125
|
end
|
126
|
-
res.tr(
|
127
|
-
|
126
|
+
res.tr("àâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž",
|
127
|
+
"aaaaaacceeeiiinnnoooooouuurrrsssz")
|
128
128
|
end
|
129
129
|
}
|
130
130
|
end
|
@@ -132,14 +132,14 @@ grammar ScientificNameDirty
|
|
132
132
|
rule valid_name_letters
|
133
133
|
[a-z\-æœàâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž]+ {
|
134
134
|
def value
|
135
|
-
res =
|
136
|
-
text_value.split(
|
137
|
-
l =
|
138
|
-
l =
|
135
|
+
res = ""
|
136
|
+
text_value.split("").each do |l|
|
137
|
+
l = "ae" if l == "æ"
|
138
|
+
l = "oe" if l == "œ"
|
139
139
|
res << l
|
140
140
|
end
|
141
|
-
res.tr(
|
142
|
-
|
141
|
+
res.tr("àâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž",
|
142
|
+
"aaaaaacceeeiiinnnoooooouuurrrsssz")
|
143
143
|
|
144
144
|
end
|
145
145
|
}
|
@@ -150,23 +150,23 @@ grammar ScientificNameDirty
|
|
150
150
|
/
|
151
151
|
super
|
152
152
|
end
|
153
|
-
|
153
|
+
|
154
154
|
rule left_paren
|
155
155
|
"(" space "("
|
156
156
|
/
|
157
157
|
super
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
rule year
|
161
161
|
a:year_number space b:approximate_year {
|
162
162
|
def value
|
163
163
|
a.value + " " + b.value
|
164
164
|
end
|
165
|
-
|
165
|
+
|
166
166
|
def pos
|
167
167
|
a.pos.merge(b.pos)
|
168
168
|
end
|
169
|
-
|
169
|
+
|
170
170
|
def details
|
171
171
|
{:year => a.value, :approximate_year => b.value}
|
172
172
|
end
|
@@ -176,11 +176,11 @@ grammar ScientificNameDirty
|
|
176
176
|
def value
|
177
177
|
a.text_value
|
178
178
|
end
|
179
|
-
|
179
|
+
|
180
180
|
def pos
|
181
|
-
{a.interval.begin => [
|
181
|
+
{a.interval.begin => ["year", a.interval.end]}
|
182
182
|
end
|
183
|
-
|
183
|
+
|
184
184
|
def details
|
185
185
|
{:year => value}
|
186
186
|
end
|
@@ -194,40 +194,39 @@ grammar ScientificNameDirty
|
|
194
194
|
/
|
195
195
|
super
|
196
196
|
end
|
197
|
-
|
197
|
+
|
198
198
|
rule approximate_year
|
199
199
|
"[" space a:year_number space "]"+ {
|
200
200
|
def value
|
201
201
|
"(" + a.text_value + ")"
|
202
202
|
end
|
203
|
-
|
203
|
+
|
204
204
|
def pos
|
205
|
-
{a.interval.begin => [
|
205
|
+
{a.interval.begin => ["year", a.interval.end]}
|
206
206
|
end
|
207
|
-
|
207
|
+
|
208
208
|
def details
|
209
209
|
{:approximate_year => value}
|
210
210
|
end
|
211
211
|
}
|
212
212
|
end
|
213
|
-
|
214
|
-
|
213
|
+
|
215
214
|
rule double_year
|
216
215
|
year_number "-" [0-9]+ [A-Za-z]? [\?]? {
|
217
216
|
def value
|
218
217
|
text_value
|
219
218
|
end
|
220
|
-
|
219
|
+
|
221
220
|
def pos
|
222
|
-
{interval.begin => [
|
221
|
+
{interval.begin => ["year", interval.end]}
|
223
222
|
end
|
224
|
-
|
223
|
+
|
225
224
|
def details
|
226
225
|
{:year => value}
|
227
226
|
end
|
228
227
|
}
|
229
228
|
end
|
230
|
-
|
229
|
+
|
231
230
|
rule year_number_with_punctuation
|
232
231
|
a:year_number "." {
|
233
232
|
def value
|
@@ -235,7 +234,7 @@ grammar ScientificNameDirty
|
|
235
234
|
end
|
236
235
|
|
237
236
|
def pos
|
238
|
-
{interval.begin => [
|
237
|
+
{interval.begin => ["year", interval.end]}
|
239
238
|
end
|
240
239
|
|
241
240
|
def details
|
@@ -244,7 +243,6 @@ grammar ScientificNameDirty
|
|
244
243
|
}
|
245
244
|
end
|
246
245
|
|
247
|
-
|
248
246
|
rule page_number
|
249
247
|
":" space [\d]+
|
250
248
|
{
|
@@ -252,16 +250,15 @@ grammar ScientificNameDirty
|
|
252
250
|
end
|
253
251
|
}
|
254
252
|
end
|
255
|
-
|
253
|
+
|
256
254
|
rule string_authorship_inconsistencies
|
257
255
|
("corrig.")
|
258
256
|
end
|
259
257
|
|
260
|
-
|
261
258
|
rule garbage
|
262
259
|
space (["',]) space [^щ]*
|
263
260
|
/
|
264
261
|
space_hard [^ш]+
|
265
262
|
end
|
266
|
-
|
263
|
+
|
267
264
|
end
|
data/lib/biodiversity/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Biodiversity
|
2
|
-
VERSION =
|
3
|
-
end
|
2
|
+
VERSION = "3.1.6"
|
3
|
+
end
|
data/spec/files/test_data.txt
CHANGED
@@ -132,6 +132,10 @@ Pseudocercospora dendrobii(H.C. Burnett, 1873)U. Braun & Crous 2003|{"sc
|
|
132
132
|
Pseudocercospora dendrobii(H.C. Burnett 1873)U. Braun & Crous , 2003|{"scientificName":{"parsed":true, "parser_version":"test_version", "parser_run":1,"verbatim":"Pseudocercospora dendrobii(H.C. Burnett 1873)U. Braun & Crous , 2003","normalized":"Pseudocercospora dendrobii (H.C. Burnett 1873) U. Braun & Crous 2003","canonical":"Pseudocercospora dendrobii","hybrid":false,"details":[{"genus":{"string":"Pseudocercospora"},"species":{"string":"dendrobii","authorship":"(H.C. Burnett 1873)U. Braun & Crous , 2003","combinationAuthorTeam":{"authorTeam":"U. Braun & Crous","author":["U. Braun","Crous"],"year":"2003"},"basionymAuthorTeam":{"authorTeam":"H.C. Burnett","author":["H.C. Burnett"],"year":"1873"}}}],"positions":{"0":["genus",16],"17":["species",26],"27":["author_word",31],"36":["author_word",43],"44":["year",48],"49":["author_word",51],"52":["author_word",57],"60":["author_word",65],"71":["year",75]}}}
|
133
133
|
Sedella pumila (Benth.) Britton & Rose|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Sedella pumila (Benth.) Britton & Rose", "normalized":"Sedella pumila (Benth.) Britton & Rose", "canonical":"Sedella pumila", "hybrid":false, "details":[{"genus":{"string":"Sedella"}, "species":{"string":"pumila", "authorship":"(Benth.) Britton & Rose", "combinationAuthorTeam":{"authorTeam":"Britton & Rose", "author":["Britton", "Rose"]}, "basionymAuthorTeam":{"authorTeam":"Benth.", "author":["Benth."]}}}], "parser_run":1, "positions":{"0":["genus", 7], "8":["species", 14], "16":["author_word", 22], "24":["author_word", 31], "34":["author_word", 38]}}}
|
134
134
|
|
135
|
+
#binomials with apostrophe in species epithet
|
136
|
+
Odynerus o'neili Cameron|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Odynerus o'neili Cameron", "normalized":"Odynerus oneili Cameron", "canonical":"Odynerus oneili", "hybrid":false, "details":[{"genus":{"string":"Odynerus"}, "species":{"string":"oneili", "authorship":"Cameron", "basionymAuthorTeam":{"authorTeam":"Cameron", "author":["Cameron"]}}}], "parser_run":1, "positions":{"0":["genus", 8], "9":["species", 16], "17":["author_word", 24]}}}
|
137
|
+
Serjania meridionalis Cambess. var. o'donelli F.A. Barkley|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Serjania meridionalis Cambess. var. o'donelli F.A. Barkley", "normalized":"Serjania meridionalis Cambess. var. odonelli F.A. Barkley", "canonical":"Serjania meridionalis odonelli", "hybrid":false, "details":[{"genus":{"string":"Serjania"}, "species":{"string":"meridionalis", "authorship":"Cambess.", "basionymAuthorTeam":{"authorTeam":"Cambess.", "author":["Cambess."]}}, "infraspecies":[{"string":"odonelli", "rank":"var.", "authorship":"F.A. Barkley", "basionymAuthorTeam":{"authorTeam":"F.A. Barkley", "author":["F.A. Barkley"]}}]}], "parser_run":1, "positions":{"0":["genus", 8], "9":["species", 21], "22":["author_word", 30], "31":["infraspecific_type", 35], "36":["infraspecies", 45], "46":["author_word", 50], "51":["author_word", 58]}}}
|
138
|
+
|
135
139
|
#infraspecies without rank
|
136
140
|
Hydnellum scrobiculatum zonatum (Batsch) K. A. Harrison 1961|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Hydnellum scrobiculatum zonatum (Batsch) K. A. Harrison 1961", "normalized":"Hydnellum scrobiculatum zonatum (Batsch) K. A. Harrison 1961", "canonical":"Hydnellum scrobiculatum zonatum", "hybrid":false, "details":[{"genus":{"string":"Hydnellum"}, "species":{"string":"scrobiculatum"}, "infraspecies":[{"string":"zonatum", "rank":"n/a", "authorship":"(Batsch) K. A. Harrison 1961", "combinationAuthorTeam":{"authorTeam":"K. A. Harrison", "author":["K. A. Harrison"], "year":"1961"}, "basionymAuthorTeam":{"authorTeam":"Batsch", "author":["Batsch"]}}]}], "parser_run":1, "positions":{"0":["genus", 9], "10":["species", 23], "24":["infraspecies", 31], "33":["author_word", 39], "41":["author_word", 43], "44":["author_word", 46], "47":["author_word", 55], "56":["year", 60]}}}
|
137
141
|
Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972|{"scientificName":{"parsed":true, "parser_version":"test_version", "parser_run":1,"verbatim":"Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972","normalized":"Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972","canonical":"Hydnellum scrobiculatum zonatum","hybrid":false,"details":[{"genus":{"string":"Hydnellum"},"species":{"string":"scrobiculatum"},"infraspecies":[{"string":"zonatum","rank":"n\/a","authorship":"(Banker) D. Hall & D.E. Stuntz 1972","combinationAuthorTeam":{"authorTeam":"D. Hall & D.E. Stuntz","author":["D. Hall","D.E. Stuntz"],"year":"1972"},"basionymAuthorTeam":{"authorTeam":"Banker","author":["Banker"]}}]}],"positions":{"0":["genus",9],"10":["species",23],"24":["infraspecies",31],"33":["author_word",39],"41":["author_word",43],"44":["author_word",48],"51":["author_word",55],"56":["author_word",62],"63":["year",67]}}}
|
@@ -160,6 +164,7 @@ Rhododendron weyrichii Maxim. f. albiflorum T.Yamaz.|{"scientificName":{"parsed"
|
|
160
164
|
Armeria maaritima (Mill.) Willd. fma. originaria Bern.|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Armeria maaritima (Mill.) Willd. fma. originaria Bern.", "normalized":"Armeria maaritima (Mill.) Willd. fma. originaria Bern.", "canonical":"Armeria maaritima originaria", "hybrid":false, "details":[{"genus":{"string":"Armeria"}, "species":{"string":"maaritima", "authorship":"(Mill.) Willd.", "combinationAuthorTeam":{"authorTeam":"Willd.", "author":["Willd."]}, "basionymAuthorTeam":{"authorTeam":"Mill.", "author":["Mill."]}}, "infraspecies":[{"string":"originaria", "rank":"fma.", "authorship":"Bern.", "basionymAuthorTeam":{"authorTeam":"Bern.", "author":["Bern."]}}]}], "parser_run":1, "positions":{"0":["genus", 7], "8":["species", 17], "19":["author_word", 24], "26":["author_word", 32], "33":["infraspecific_type", 37], "38":["infraspecies", 48], "49":["author_word", 54]}}}
|
161
165
|
Cotoneaster (Pyracantha) rogersiana var.aurantiaca|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Cotoneaster (Pyracantha) rogersiana var.aurantiaca", "normalized":"Cotoneaster (Pyracantha) rogersiana var. aurantiaca", "canonical":"Cotoneaster rogersiana aurantiaca", "hybrid":false, "details":[{"genus":{"string":"Cotoneaster"}, "infragenus":{"string":"Pyracantha"}, "species":{"string":"rogersiana"}, "infraspecies":[{"string":"aurantiaca", "rank":"var."}]}], "parser_run":1, "positions":{"0":["genus", 11], "13":["infragenus", 23], "25":["species", 35], "36":["infraspecific_type", 40], "40":["infraspecies", 50]}}}
|
162
166
|
Poa annua fo varia|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Poa annua fo varia", "normalized":"Poa annua fo varia", "canonical":"Poa annua varia", "hybrid":false, "details":[{"genus":{"string":"Poa"}, "species":{"string":"annua"}, "infraspecies":[{"string":"varia", "rank":"fo"}]}], "parser_run":1, "positions":{"0":["genus", 3], "4":["species", 9], "10":["infraspecific_type", 12], "13":["infraspecies", 18]}}}
|
167
|
+
Physarum globuliferum forma. flavum Leontyev & Dudka|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Physarum globuliferum forma. flavum Leontyev & Dudka", "normalized":"Physarum globuliferum forma. flavum Leontyev & Dudka", "canonical":"Physarum globuliferum flavum", "hybrid":false, "details":[{"genus":{"string":"Physarum"}, "species":{"string":"globuliferum"}, "infraspecies":[{"string":"flavum", "rank":"forma.", "authorship":"Leontyev & Dudka", "basionymAuthorTeam":{"authorTeam":"Leontyev & Dudka", "author":["Leontyev", "Dudka"]}}]}], "parser_run":1, "positions":{"0":["genus", 8], "9":["species", 21], "22":["infraspecific_type", 28], "29":["infraspecies", 35], "36":["author_word", 44], "47":["author_word", 52]}}}
|
163
168
|
#TODO: Homalanthus nutans (Mull.Arg.) Benth. & Hook. f. ex Drake|{}
|
164
169
|
|
165
170
|
#infraspecies_multiple
|
@@ -289,7 +294,7 @@ Acarospora cratericola cratericola Shenk 1974 group|{"scientificName":{"parsed":
|
|
289
294
|
Acarospora cratericola cratericola Shenk 1974 species group|{"scientificName":{"parsed":true, "verbatim":"Acarospora cratericola cratericola Shenk 1974 species group", "normalized":"Acarospora cratericola cratericola Shenk 1974", "canonical":"Acarospora cratericola cratericola", "hybrid":false, "details":[{"genus":{"string":"Acarospora"}, "species":{"string":"cratericola"}, "infraspecies":[{"string":"cratericola", "rank":"n/a", "authorship":"Shenk 1974", "basionymAuthorTeam":{"authorTeam":"Shenk", "author":["Shenk"], "year":"1974"}}]}], "parser_version":"test_version", "parser_run":1, "positions":{"0":["genus", 10], "11":["species", 22], "23":["infraspecies", 34], "35":["author_word", 40], "41":["year", 45]}}}
|
290
295
|
Acarospora cratericola cratericola Shenk 1974 species complex|{"scientificName":{"parsed":true, "verbatim":"Acarospora cratericola cratericola Shenk 1974 species complex", "normalized":"Acarospora cratericola cratericola Shenk 1974", "canonical":"Acarospora cratericola cratericola", "hybrid":false, "details":[{"genus":{"string":"Acarospora"}, "species":{"string":"cratericola"}, "infraspecies":[{"string":"cratericola", "rank":"n/a", "authorship":"Shenk 1974", "basionymAuthorTeam":{"authorTeam":"Shenk", "author":["Shenk"], "year":"1974"}}]}], "parser_version":"test_version", "parser_run":1, "positions":{"0":["genus", 10], "11":["species", 22], "23":["infraspecies", 34], "35":["author_word", 40], "41":["year", 45]}}}
|
291
296
|
|
292
|
-
#
|
297
|
+
#ignoring sensu sec
|
293
298
|
Senecio legionensis sensu Samp., non Lange|{"scientificName":{"parsed":true, "verbatim":"Senecio legionensis sensu Samp., non Lange", "normalized":"Senecio legionensis", "canonical":"Senecio legionensis", "hybrid":false, "details":[{"genus":{"string":"Senecio"}, "species":{"string":"legionensis"}}], "parser_version":"test_version", "parser_run":1, "positions":{"0":["genus", 7], "8":["species", 19]}}}
|
294
299
|
Pseudomonas methanica (Söhngen 1906) sensu. Dworkin and Foster 1956|{"scientificName":{"parsed":true, "verbatim":"Pseudomonas methanica (Söhngen 1906) sensu. Dworkin and Foster 1956", "normalized":"Pseudomonas methanica (Söhngen 1906)", "canonical":"Pseudomonas methanica", "hybrid":false, "details":[{"genus":{"string":"Pseudomonas"}, "species":{"string":"methanica", "authorship":"(Söhngen 1906)", "basionymAuthorTeam":{"authorTeam":"Söhngen", "author":["Söhngen"], "year":"1906"}}}], "parser_version":"test_version", "parser_run":1, "positions":{"0":["genus", 11], "12":["species", 21], "23":["author_word", 30], "31":["year", 35]}}}
|
295
300
|
Abarema scutifera sensu auct., non (Blanco)Kosterm.|{"scientificName":{"parsed":true, "verbatim":"Abarema scutifera sensu auct., non (Blanco)Kosterm.", "normalized":"Abarema scutifera", "canonical":"Abarema scutifera", "hybrid":false, "details":[{"genus":{"string":"Abarema"}, "species":{"string":"scutifera"}}], "parser_version":"test_version", "parser_run":1, "positions":{"0":["genus", 7], "8":["species", 17]}}}
|
@@ -1,30 +1,31 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
require_relative
|
2
|
+
require_relative "../spec_helper"
|
3
3
|
|
4
4
|
describe ScientificNameCanonical do
|
5
5
|
before(:all) do
|
6
6
|
set_parser(ScientificNameCanonicalParser.new)
|
7
7
|
end
|
8
8
|
|
9
|
-
it
|
9
|
+
it "parses names with valid name part and unparseable rest" do
|
10
10
|
[
|
11
|
-
[
|
12
|
-
[{:
|
13
|
-
[
|
14
|
-
|
15
|
-
:
|
16
|
-
{0=>["genus", 5], 7=>["infragenus", 12]}],
|
17
|
-
[
|
18
|
-
|
19
|
-
:
|
20
|
-
:
|
21
|
-
{0=>["genus", 5], 7=>["infragenus", 12], 14=>["species", 21]}],
|
22
|
-
[
|
23
|
-
[{:
|
24
|
-
{0=>["genus", 6], 7=>["species", 17]} ],
|
25
|
-
[
|
26
|
-
[{:
|
27
|
-
|
11
|
+
["Morea ssjjlajajaj324$33 234243242","Morea",
|
12
|
+
[{ uninomial: { string: "Morea" }}], { 0 => ["uninomial", 5]}],
|
13
|
+
["Morea (Morea) Burt 2342343242 23424322342 23424234",
|
14
|
+
"Morea (Morea)", [{ genus: { string: "Morea" },
|
15
|
+
infragenus: { string: "Morea" }}],
|
16
|
+
{ 0 => ["genus", 5], 7 => ["infragenus", 12] }],
|
17
|
+
["Morea (Morea) burtius 2342343242 23424322342 23424234",
|
18
|
+
"Morea (Morea) burtius", [{ genus: { string: "Morea" },
|
19
|
+
infragenus: { string: "Morea" },
|
20
|
+
species: { string: "burtius" }}],
|
21
|
+
{ 0 => ["genus", 5], 7 => ["infragenus", 12], 14 => ["species", 21] }],
|
22
|
+
["Moraea spathulata ( (L. f. Klatt","Moraea spathulata",
|
23
|
+
[{ genus: { string: "Moraea" }, species: { string: "spathulata"}}],
|
24
|
+
{ 0 => ["genus", 6], 7 => ["species", 17] } ],
|
25
|
+
["Verpericola megasoma \"Dall\" Pils.","Verpericola megasoma",
|
26
|
+
[{ genus: { string: "Verpericola" },
|
27
|
+
species: { string: "megasoma"}}],
|
28
|
+
{ 0 => ["genus", 11], 12 => ["species", 20] }]
|
28
29
|
].each do |n|
|
29
30
|
expect(parse(n[0])).not_to be_nil
|
30
31
|
expect(value(n[0])).to eq n[1]
|
@@ -32,6 +33,5 @@ describe ScientificNameCanonical do
|
|
32
33
|
expect(pos(n[0])).to eq n[3]
|
33
34
|
expect(parse(n[0]).hybrid).to be false
|
34
35
|
end
|
35
|
-
end
|
36
|
-
|
36
|
+
end
|
37
37
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
require_relative
|
2
|
+
require_relative "../spec_helper"
|
3
3
|
|
4
4
|
|
5
5
|
describe ScientificNameClean do
|
@@ -7,51 +7,51 @@ describe ScientificNameClean do
|
|
7
7
|
set_parser(ScientificNameCleanParser.new)
|
8
8
|
end
|
9
9
|
|
10
|
-
it
|
11
|
-
sn =
|
10
|
+
it "parses uninomial" do
|
11
|
+
sn = "Pseudocercospora"
|
12
12
|
expect(parse(sn)).to_not be_nil
|
13
|
-
expect(value(sn)).to eq
|
14
|
-
expect(canonical(sn)).to eq
|
15
|
-
expect(details(sn)).to eq [{:
|
16
|
-
expect(pos(sn)).to eq({
|
13
|
+
expect(value(sn)).to eq "Pseudocercospora"
|
14
|
+
expect(canonical(sn)).to eq "Pseudocercospora"
|
15
|
+
expect(details(sn)).to eq [{ uninomial: { string: "Pseudocercospora" } }]
|
16
|
+
expect(pos(sn)).to eq({ 0 => ["uninomial", 16] })
|
17
17
|
end
|
18
|
-
|
19
|
-
it
|
20
|
-
sn =
|
18
|
+
|
19
|
+
it "parses uninomial with author and year" do
|
20
|
+
sn = "Pseudocercospora Speg."
|
21
21
|
expect(parse(sn)).to_not be_nil
|
22
|
-
expect(details(sn)).to eq [{:
|
23
|
-
{:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
{:
|
27
|
-
expect(pos(sn)).to eq({0=>["uninomial", 16], 17=>["author_word", 22]})
|
28
|
-
sn =
|
22
|
+
expect(details(sn)).to eq [{ uninomial:
|
23
|
+
{ string: "Pseudocercospora",
|
24
|
+
authorship: "Speg.",
|
25
|
+
basionymAuthorTeam:
|
26
|
+
{ authorTeam: "Speg.", author: ["Speg."] } } }]
|
27
|
+
expect(pos(sn)).to eq({ 0 => ["uninomial", 16], 17 => ["author_word", 22] })
|
28
|
+
sn = "Pseudocercospora Spegazzini, 1910"
|
29
29
|
expect(parse(sn)).to_not be_nil
|
30
|
-
expect(value(sn)).to eq
|
31
|
-
expect(details(sn)).to eq [{:
|
32
|
-
{:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
{:
|
36
|
-
:
|
37
|
-
expect(pos(sn)).to eq({0=>["uninomial", 16],
|
38
|
-
17=>["author_word", 27], 29=>["year", 33]})
|
30
|
+
expect(value(sn)).to eq "Pseudocercospora Spegazzini 1910"
|
31
|
+
expect(details(sn)).to eq [{ uninomial:
|
32
|
+
{ string: "Pseudocercospora",
|
33
|
+
authorship: "Spegazzini, 1910",
|
34
|
+
basionymAuthorTeam:
|
35
|
+
{ authorTeam: "Spegazzini",
|
36
|
+
author: ["Spegazzini"], year: "1910" } } }]
|
37
|
+
expect(pos(sn)).to eq({ 0 => ["uninomial", 16],
|
38
|
+
17 => ["author_word", 27], 29 => ["year", 33] })
|
39
39
|
end
|
40
40
|
|
41
41
|
it "parses uninomials with uninomial ranks" do
|
42
42
|
sn = "Epacridaceae trib. Archerieae Crayn & Quinn"
|
43
43
|
expect(parse(sn)).to_not be_nil
|
44
|
-
expect(details(sn)).to eq [{:
|
45
|
-
{:
|
46
|
-
:
|
47
|
-
:uninomial2=>{:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
{:
|
51
|
-
:
|
44
|
+
expect(details(sn)).to eq [{ uninomial:
|
45
|
+
{ string: "Epacridaceae" },
|
46
|
+
rank_uninomials: "trib.",
|
47
|
+
:uninomial2 => { string: "Archerieae",
|
48
|
+
authorship: "Crayn & Quinn",
|
49
|
+
basionymAuthorTeam:
|
50
|
+
{ authorTeam: "Crayn & Quinn",
|
51
|
+
author: ["Crayn", "Quinn"] } } }]
|
52
52
|
end
|
53
53
|
|
54
|
-
it
|
54
|
+
it "parses names with a valid 2 letter genus" do
|
55
55
|
["Ca Dyar 1914",
|
56
56
|
"Ea Distant 1911",
|
57
57
|
"Ge Nicéville 1895",
|
@@ -73,170 +73,170 @@ describe ScientificNameClean do
|
|
73
73
|
"Ba Solem 1983"].each do |name|
|
74
74
|
expect(parse(name)).to_not be_nil
|
75
75
|
end
|
76
|
-
expect(canonical(
|
76
|
+
expect(canonical("Quoyula")).to eq "Quoyula"
|
77
77
|
end
|
78
78
|
|
79
|
-
it
|
80
|
-
sn =
|
79
|
+
it "parses canonical" do
|
80
|
+
sn = "Pseudocercospora dendrobii"
|
81
81
|
expect(parse(sn)).to_not be_nil
|
82
|
-
expect(value(sn)).to eq
|
83
|
-
expect(canonical(sn)).to eq
|
84
|
-
expect(details(sn)).to eq [{:
|
85
|
-
{:
|
86
|
-
:
|
87
|
-
expect(pos(sn)).to eq({0=>["genus", 16], 21=>["species", 30]})
|
82
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii"
|
83
|
+
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
84
|
+
expect(details(sn)).to eq [{ genus:
|
85
|
+
{ string: "Pseudocercospora" },
|
86
|
+
species: { string: "dendrobii" } }]
|
87
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 16], 21 => ["species", 30] })
|
88
88
|
end
|
89
89
|
|
90
|
-
it
|
91
|
-
sn =
|
90
|
+
it "parses abbreviated canonical" do
|
91
|
+
sn = "P. dendrobii"
|
92
92
|
expect(parse(sn)).to_not be_nil
|
93
|
-
expect(value(sn)).to eq
|
94
|
-
sn =
|
93
|
+
expect(value(sn)).to eq "P. dendrobii"
|
94
|
+
sn = "Ps. dendrobii"
|
95
95
|
expect(parse(sn)).to_not be_nil
|
96
|
-
expect(value(sn)).to eq
|
97
|
-
expect(details(sn)).to eq [{:
|
98
|
-
{:
|
99
|
-
:
|
96
|
+
expect(value(sn)).to eq "Ps. dendrobii"
|
97
|
+
expect(details(sn)).to eq [{ genus:
|
98
|
+
{ string: "Ps." },
|
99
|
+
species: { string: "dendrobii" } }]
|
100
100
|
end
|
101
101
|
|
102
102
|
|
103
|
-
it
|
103
|
+
it "parses species name with author and year" do
|
104
104
|
sn = "Platypus bicaudatulus Schedl 1935"
|
105
105
|
expect(parse(sn)).to_not be_nil
|
106
106
|
expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
|
107
107
|
sn = "Platypus bicaudatulus Schedl, 1935h"
|
108
108
|
expect(parse(sn)).to_not be_nil
|
109
109
|
expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
|
110
|
-
expect(details(sn)).to eq [{:
|
111
|
-
{:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
{:
|
116
|
-
:
|
117
|
-
expect(pos(sn)).to eq({0=>["genus", 8],
|
118
|
-
9=>["species", 21], 22=>["author_word", 28],
|
119
|
-
30=>["year", 35]})
|
110
|
+
expect(details(sn)).to eq [{ genus:
|
111
|
+
{ string: "Platypus" },
|
112
|
+
species: { string: "bicaudatulus",
|
113
|
+
authorship: "Schedl, 1935h",
|
114
|
+
basionymAuthorTeam:
|
115
|
+
{ authorTeam: "Schedl", author: ["Schedl"],
|
116
|
+
year: "1935" } } }]
|
117
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 8],
|
118
|
+
9 => ["species", 21], 22 => ["author_word", 28],
|
119
|
+
30 => ["year", 35] })
|
120
120
|
expect(parse("Platypus bicaudatulus Schedl, 1935B")).to_not be_nil
|
121
121
|
sn = "Platypus bicaudatulus Schedl (1935h)"
|
122
122
|
expect(parse(sn)).to_not be_nil
|
123
|
-
expect(details(sn)).to eq [{:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
123
|
+
expect(details(sn)).to eq [{ genus: { string: "Platypus" },
|
124
|
+
species: { string: "bicaudatulus", authorship: "Schedl (1935h)",
|
125
|
+
basionymAuthorTeam: { authorTeam: "Schedl", author: ["Schedl"],
|
126
|
+
year: "1935" } } }]
|
127
127
|
expect(parse("Platypus bicaudatulus Schedl 1935")).to_not be_nil
|
128
128
|
end
|
129
129
|
|
130
|
-
it
|
130
|
+
it "parses species name with abbreviated genus, author and year" do
|
131
131
|
sn = "P. bicaudatulus Schedl 1935"
|
132
132
|
expect(parse(sn)).to_not be_nil
|
133
133
|
expect(value(sn)).to eq "P. bicaudatulus Schedl 1935"
|
134
134
|
sn = "Pl. bicaudatulus Schedl, 1935h"
|
135
135
|
expect(parse(sn)).not_to be_nil
|
136
136
|
expect(value(sn)).to eq "Pl. bicaudatulus Schedl 1935"
|
137
|
-
expect(details(sn)).to eq [{:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
137
|
+
expect(details(sn)).to eq [{ genus: { string: "Pl." },
|
138
|
+
species: { string: "bicaudatulus", authorship: "Schedl, 1935h",
|
139
|
+
basionymAuthorTeam: { authorTeam: "Schedl",
|
140
|
+
author: ["Schedl"], year: "1935" } } }]
|
141
141
|
sn = "Pla. bicaudatulus Schedl, 1935h"
|
142
142
|
expect(parse(sn)).to_not be_nil
|
143
143
|
expect(value(sn)).to eq "Pla. bicaudatulus Schedl 1935"
|
144
144
|
end
|
145
145
|
|
146
|
-
it "parses species name with author's postfix f., filius (son of)" do
|
146
|
+
it "parses species name with author\'s postfix f., filius (son of)" do
|
147
147
|
names = [
|
148
|
-
[
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
|
153
|
-
["Platypus bicaudatulus Schedl filius 1935",
|
154
|
-
[{:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
|
160
|
-
[
|
161
|
-
[{:
|
162
|
-
:
|
163
|
-
:
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
[
|
168
|
-
[{:
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
[
|
174
|
-
[{:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
:
|
180
|
-
|
181
|
-
[
|
182
|
-
[{:
|
183
|
-
:
|
184
|
-
:
|
185
|
-
:
|
186
|
-
:
|
187
|
-
|
188
|
-
[
|
189
|
-
[{:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
:
|
193
|
-
|
194
|
-
[
|
195
|
-
[{:
|
196
|
-
:
|
197
|
-
{:
|
198
|
-
:
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
148
|
+
["Platypus bicaudatulus Schedl f. 1935", [{ genus: { string: "Platypus" },
|
149
|
+
species: { string: "bicaudatulus", authorship: "Schedl f. 1935",
|
150
|
+
basionymAuthorTeam: { authorTeam: "Schedl f.",
|
151
|
+
author: ["Schedl f."], year: "1935" } } }],
|
152
|
+
"Platypus bicaudatulus Schedl f. 1935"],
|
153
|
+
["Platypus bicaudatulus Schedl filius 1935",
|
154
|
+
[{ genus: { string: "Platypus" },
|
155
|
+
species: { string: "bicaudatulus",
|
156
|
+
authorship: "Schedl filius 1935",
|
157
|
+
basionymAuthorTeam: { authorTeam: "Schedl filius",
|
158
|
+
author: ["Schedl filius"], year: "1935" } } }],
|
159
|
+
"Platypus bicaudatulus Schedl filius 1935"],
|
160
|
+
["Fimbristylis ovata (Burm. f.) J. Kern",
|
161
|
+
[{ genus: { string: "Fimbristylis" }, species: { string: "ovata",
|
162
|
+
authorship: "(Burm. f.) J. Kern",
|
163
|
+
combinationAuthorTeam: { authorTeam: "J. Kern",
|
164
|
+
author: ["J. Kern"] },
|
165
|
+
basionymAuthorTeam: { authorTeam: "Burm. f.",
|
166
|
+
author: ["Burm. f."] } } }], "Fimbristylis ovata (Burm. f.) J. Kern"],
|
167
|
+
["Carex chordorrhiza Ehrh. ex L. f.",
|
168
|
+
[{ genus: { string: "Carex" }, species: { string: "chordorrhiza",
|
169
|
+
authorship: "Ehrh. ex L. f.",
|
170
|
+
basionymAuthorTeam: { authorTeam: "Ehrh.",
|
171
|
+
author: ["Ehrh."], exAuthorTeam: { authorTeam: "L. f.",
|
172
|
+
author: ["L. f."] } } } }], "Carex chordorrhiza Ehrh. ex L. f."],
|
173
|
+
["Amelanchier arborea var. arborea (Michx. f.) Fernald",
|
174
|
+
[{ genus: { string: "Amelanchier" }, species: { string: "arborea"},
|
175
|
+
infraspecies: [{ string: "arborea", rank: "var.",
|
176
|
+
authorship: "(Michx. f.) Fernald", combinationAuthorTeam: {
|
177
|
+
authorTeam: "Fernald", author: ["Fernald"] },
|
178
|
+
basionymAuthorTeam: { authorTeam: "Michx. f.",
|
179
|
+
author: ["Michx. f."] } }]}],
|
180
|
+
"Amelanchier arborea var. arborea (Michx. f.) Fernald"],
|
181
|
+
["Cerastium arvense var. fuegianum Hook. f.",
|
182
|
+
[{ genus: { string: "Cerastium" }, species: { string: "arvense"},
|
183
|
+
infraspecies: [{ string: "fuegianum", rank: "var.",
|
184
|
+
authorship: "Hook. f.",
|
185
|
+
basionymAuthorTeam: { authorTeam: "Hook. f.",
|
186
|
+
author: ["Hook. f."] } }]}],
|
187
|
+
"Cerastium arvense var. fuegianum Hook. f."],
|
188
|
+
["Cerastium arvense var. fuegianum Hook.f.",
|
189
|
+
[{ genus: { string: "Cerastium" }, species: { string: "arvense"},
|
190
|
+
infraspecies: [{ string: "fuegianum", rank: "var.",
|
191
|
+
authorship: "Hook.f.", basionymAuthorTeam: {
|
192
|
+
authorTeam: "Hook.f.", author: ["Hook.f."] } }]}],
|
193
|
+
"Cerastium arvense var. fuegianum Hook.f."],
|
194
|
+
["Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f.",
|
195
|
+
[{ genus: { string: "Cerastium" }, species: { string: "arvense"},
|
196
|
+
infraspecies: [{ string: "velutinum", rank: "ssp." },
|
197
|
+
{ string: "velutinum", rank: "var.",
|
198
|
+
authorship: "(Raf.) Britton f.",
|
199
|
+
combinationAuthorTeam: { authorTeam: "Britton f.",
|
200
|
+
author: ["Britton f."] }, basionymAuthorTeam: { authorTeam: "Raf.",
|
201
|
+
author: ["Raf."] } }]}],
|
202
202
|
"Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f."],
|
203
|
-
["Amelanchier arborea f. hirsuta (Michx. f.) Fernald",
|
204
|
-
[{:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
203
|
+
["Amelanchier arborea f. hirsuta (Michx. f.) Fernald",
|
204
|
+
[{ infraspecies: [{ basionymAuthorTeam: { author: ["Michx. f."],
|
205
|
+
authorTeam: "Michx. f." }, string: "hirsuta", rank: "f.",
|
206
|
+
combinationAuthorTeam: { author: ["Fernald"], authorTeam: "Fernald" },
|
207
|
+
authorship: "(Michx. f.) Fernald" }], genus: { string: "Amelanchier"},
|
208
|
+
species: { string: "arborea" } }],
|
209
209
|
"Amelanchier arborea f. hirsuta (Michx. f.) Fernald"],
|
210
|
-
["Betula pendula fo. dalecarlica (L. f.) C.K. Schneid.",
|
211
|
-
[{:
|
212
|
-
:
|
213
|
-
:
|
214
|
-
:
|
215
|
-
:
|
210
|
+
["Betula pendula fo. dalecarlica (L. f.) C.K. Schneid.",
|
211
|
+
[{ infraspecies: [{ basionymAuthorTeam: { author: ["L. f."],
|
212
|
+
authorTeam: "L. f." }, string: "dalecarlica", rank: "fo.",
|
213
|
+
combinationAuthorTeam: { author: ["C.K. Schneid."],
|
214
|
+
authorTeam: "C.K. Schneid." }, authorship: "(L. f.) C.K. Schneid."}],
|
215
|
+
genus: { string: "Betula" }, species: { string: "pendula"} }],
|
216
216
|
"Betula pendula fo. dalecarlica (L. f.) C.K. Schneid."],
|
217
|
-
["Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk.",
|
218
|
-
[{:
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
:
|
223
|
-
:
|
224
|
-
:
|
217
|
+
["Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk.",
|
218
|
+
[{ genus: { string: "Racomitrium" }, species: { string: "canescens"},
|
219
|
+
infraspecies: [{ string: "ericoides", rank: "f.",
|
220
|
+
authorship: "(F. Weber ex Brid.) Mönk.",
|
221
|
+
combinationAuthorTeam: { authorTeam: "Mönk.", author: ["Mönk."] },
|
222
|
+
basionymAuthorTeam: { authorTeam: "F. Weber",
|
223
|
+
author: ["F. Weber"], exAuthorTeam: { authorTeam: "Brid.",
|
224
|
+
author: ["Brid."] } } }]}],
|
225
225
|
"Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk."],
|
226
|
-
["Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk.",
|
227
|
-
[{:
|
228
|
-
:
|
229
|
-
:
|
230
|
-
:
|
231
|
-
:
|
232
|
-
:
|
226
|
+
["Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk.",
|
227
|
+
[{ genus: { string: "Racomitrium" }, species: { string: "canescens"},
|
228
|
+
infraspecies: [{ string: "ericoides", rank: "forma",
|
229
|
+
authorship: "(F. Weber ex Brid.) Mönk.",
|
230
|
+
combinationAuthorTeam: { authorTeam: "Mönk.", author: ["Mönk."] },
|
231
|
+
basionymAuthorTeam: { authorTeam: "F. Weber", author: ["F. Weber"],
|
232
|
+
exAuthorTeam: { authorTeam: "Brid.", author: ["Brid."] } } }]}],
|
233
233
|
"Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk."],
|
234
|
-
["Peristernia nassatula forskali Tapparone-Canefri 1875",
|
235
|
-
[{:
|
236
|
-
:
|
237
|
-
:
|
238
|
-
:
|
239
|
-
:
|
234
|
+
["Peristernia nassatula forskali Tapparone-Canefri 1875",
|
235
|
+
[{ genus: { string: "Peristernia" }, species: { string: "nassatula"},
|
236
|
+
infraspecies: [{ string: "forskali", rank: "n/a",
|
237
|
+
authorship: "Tapparone-Canefri 1875", basionymAuthorTeam: {
|
238
|
+
authorTeam: "Tapparone-Canefri", author: ["Tapparone-Canefri"],
|
239
|
+
year: "1875" } }]}],
|
240
240
|
"Peristernia nassatula forskali Tapparone-Canefri 1875"],
|
241
241
|
]
|
242
242
|
names.each do |sn, sn_details, sn_value|
|
@@ -246,27 +246,27 @@ describe ScientificNameClean do
|
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
-
it
|
249
|
+
it "parses genus with '?'" do
|
250
250
|
sn = "Ferganoconcha? oblonga"
|
251
251
|
expect(parse(sn)).to_not be_nil
|
252
252
|
expect(value(sn)).to eq "Ferganoconcha oblonga"
|
253
|
-
expect(details(sn)).to eq [{:
|
254
|
-
:
|
255
|
-
expect(pos(sn)).to eq({0=>["genus", 14], 15=>["species", 22]})
|
253
|
+
expect(details(sn)).to eq [{ genus: { string: "Ferganoconcha" },
|
254
|
+
species: { string: "oblonga" } }]
|
255
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 14], 15 => ["species", 22] })
|
256
256
|
end
|
257
257
|
|
258
|
-
it
|
258
|
+
it "parses æ in the name" do
|
259
259
|
names = [
|
260
260
|
["Læptura laetifica Dow, 1913", "Laeptura laetifica Dow 1913"],
|
261
261
|
["Leptura lætifica Dow, 1913", "Leptura laetifica Dow 1913"],
|
262
262
|
["Leptura leætifica Dow, 1913", "Leptura leaetifica Dow 1913"],
|
263
263
|
["Leæptura laetifica Dow, 1913", "Leaeptura laetifica Dow 1913"],
|
264
264
|
["Leœptura laetifica Dow, 1913", "Leoeptura laetifica Dow 1913"],
|
265
|
-
[
|
266
|
-
[
|
267
|
-
[
|
268
|
-
[
|
269
|
-
[
|
265
|
+
["Ærenea cognata Lacordaire, 1872", "Aerenea cognata Lacordaire 1872"],
|
266
|
+
["Œdicnemus capensis", "Oedicnemus capensis"],
|
267
|
+
["Œnanthæ œnanthe","Oenanthae oenanthe"],
|
268
|
+
["Œnanthe œnanthe","Oenanthe oenanthe"],
|
269
|
+
["Cerambyx thomæ Gmelin J. F., 1790", "Cerambyx thomae Gmelin J. F. 1790"]
|
270
270
|
]
|
271
271
|
names.each do |name_pair|
|
272
272
|
expect(parse(name_pair[0])).to_not be_nil
|
@@ -274,64 +274,64 @@ describe ScientificNameClean do
|
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
277
|
-
it
|
278
|
-
sn =
|
279
|
-
expect(canonical(sn)).to eq
|
280
|
-
sn =
|
281
|
-
expect(canonical(sn)).to eq
|
277
|
+
it "parses names with e-umlaut" do
|
278
|
+
sn = "Kalanchoë tuberosa"
|
279
|
+
expect(canonical(sn)).to eq "Kalanchoe tuberosa"
|
280
|
+
sn = "Isoëtes asplundii H. P. Fuchs"
|
281
|
+
expect(canonical(sn)).to eq "Isoetes asplundii"
|
282
282
|
end
|
283
283
|
|
284
|
-
it
|
284
|
+
it "parses infragenus (ICZN code)" do
|
285
285
|
sn = "Hegeter (Hegeter) intercedens Lindberg H 1950"
|
286
286
|
expect(parse(sn)).to_not be_nil
|
287
287
|
expect(value(sn)).to eq "Hegeter (Hegeter) intercedens Lindberg H 1950"
|
288
288
|
expect(canonical(sn)).to eq "Hegeter intercedens"
|
289
|
-
expect(details(sn)).to eq [{:
|
290
|
-
:
|
291
|
-
:
|
292
|
-
:
|
293
|
-
:
|
294
|
-
expect(pos(sn)).to eq({0=>["genus", 7], 9=>["infragenus", 16],
|
295
|
-
18=>["species", 29], 30=>["author_word", 38],
|
296
|
-
39=>["author_word", 40], 41=>["year", 45]})
|
289
|
+
expect(details(sn)).to eq [{ genus: { string: "Hegeter" },
|
290
|
+
infragenus: { string: "Hegeter" }, species: { string: "intercedens",
|
291
|
+
authorship: "Lindberg H 1950",
|
292
|
+
basionymAuthorTeam: { authorTeam: "Lindberg H",
|
293
|
+
author: ["Lindberg H"], year: "1950" } } }]
|
294
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 7], 9 => ["infragenus", 16],
|
295
|
+
18 => ["species", 29], 30 => ["author_word", 38],
|
296
|
+
39 => ["author_word", 40], 41 => ["year", 45] })
|
297
297
|
sn = "Ixodes (Ixodes) hexagonus hexagonus Neumann, 1911"
|
298
298
|
expect(canonical(sn)).to eq "Ixodes hexagonus hexagonus"
|
299
299
|
sn = "Brachytrypus (B.) grandidieri"
|
300
300
|
expect(canonical(sn)).to eq "Brachytrypus grandidieri"
|
301
|
-
expect(details(sn)).to eq [{:
|
302
|
-
:
|
301
|
+
expect(details(sn)).to eq [{ genus: { string: "Brachytrypus" },
|
302
|
+
infragenus: { string: "B." }, species: { string: "grandidieri"} }]
|
303
303
|
sn = "Empis (Argyrandrus) Bezzi 1909"
|
304
|
-
expect(details(sn)).to eq [{:
|
305
|
-
:
|
306
|
-
:
|
307
|
-
:
|
304
|
+
expect(details(sn)).to eq [{ uninomial: { string: "Empis",
|
305
|
+
infragenus: { string: "Argyrandrus" }, authorship: "Bezzi 1909",
|
306
|
+
basionymAuthorTeam: { authorTeam: "Bezzi",
|
307
|
+
author: ["Bezzi"], year: "1909" } } }]
|
308
308
|
sn = "Platydoris (Bergh )"
|
309
|
-
expect(details(sn)).to eq [{:
|
310
|
-
:
|
309
|
+
expect(details(sn)).to eq [{ uninomial: { string: "Platydoris",
|
310
|
+
infragenus: { string: "Bergh" } } }]
|
311
311
|
expect(value(sn)).to eq "Platydoris (Bergh)"
|
312
312
|
sn = "Platydoris (B.)"
|
313
|
-
expect(details(sn)).to eq [{:
|
314
|
-
:
|
313
|
+
expect(details(sn)).to eq [{ uninomial: { string: "Platydoris",
|
314
|
+
infragenus: { string: "B." } } }]
|
315
315
|
end
|
316
316
|
|
317
|
-
it
|
317
|
+
it "parses several authors without a year" do
|
318
318
|
sn = "Pseudocercospora dendrobii U. Braun & Crous"
|
319
319
|
expect(parse(sn)).to_not be be_nil
|
320
320
|
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
|
321
321
|
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
322
|
-
expect(details(sn)).to eq [{:
|
323
|
-
:
|
324
|
-
:
|
325
|
-
:
|
326
|
-
expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
|
327
|
-
27=>["author_word", 29], 30=>["author_word", 35],
|
328
|
-
38=>["author_word", 43]})
|
322
|
+
expect(details(sn)).to eq [{ genus: { string: "Pseudocercospora" },
|
323
|
+
species: { string: "dendrobii", authorship: "U. Braun & Crous",
|
324
|
+
basionymAuthorTeam: { authorTeam: "U. Braun & Crous",
|
325
|
+
author: ["U. Braun", "Crous"] } } }]
|
326
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 16], 17 => ["species", 26],
|
327
|
+
27 => ["author_word", 29], 30 => ["author_word", 35],
|
328
|
+
38 => ["author_word", 43] })
|
329
329
|
sn = "Pseudocercospora dendrobii U. Braun and Crous"
|
330
330
|
expect(parse(sn)).to_not be_nil
|
331
331
|
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
|
332
|
-
expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
|
333
|
-
27=>["author_word", 29], 30=>["author_word", 35],
|
334
|
-
40=>["author_word", 45]})
|
332
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 16], 17 => ["species", 26],
|
333
|
+
27 => ["author_word", 29], 30 => ["author_word", 35],
|
334
|
+
40 => ["author_word", 45] })
|
335
335
|
sn = "Pseudocercospora dendrobii U. Braun et Crous"
|
336
336
|
expect(parse(sn)).to_not be_nil
|
337
337
|
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
|
@@ -339,139 +339,140 @@ describe ScientificNameClean do
|
|
339
339
|
expect(parse(sn)).to_not be_nil
|
340
340
|
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) R.C. Harris"
|
341
341
|
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
342
|
-
expect(details(sn)).to eq [{:
|
343
|
-
:
|
344
|
-
:
|
345
|
-
:
|
346
|
-
:
|
342
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
343
|
+
species: { string: "hyalospora", authorship: "(Nyl.)R.C. Harris",
|
344
|
+
combinationAuthorTeam: { authorTeam: "R.C. Harris",
|
345
|
+
author: ["R.C. Harris"] },
|
346
|
+
basionymAuthorTeam: { authorTeam: "Nyl.", author: ["Nyl."] } } }]
|
347
347
|
end
|
348
348
|
|
349
|
-
it
|
349
|
+
it "parses several authors with a year" do
|
350
350
|
sn = "Pseudocercospora dendrobii U. Braun & Crous 2003"
|
351
351
|
expect(parse(sn)).to_not be_nil
|
352
352
|
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous 2003"
|
353
353
|
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
354
|
-
expect(details(sn)).to eq [{:
|
355
|
-
:
|
356
|
-
:
|
357
|
-
:
|
358
|
-
expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
|
359
|
-
27=>["author_word", 29], 30=>["author_word", 35],
|
360
|
-
38=>["author_word", 43], 44=>["year", 48]})
|
354
|
+
expect(details(sn)).to eq [{ genus: { string: "Pseudocercospora" },
|
355
|
+
species: { string: "dendrobii", authorship: "U. Braun & Crous 2003",
|
356
|
+
basionymAuthorTeam: { authorTeam: "U. Braun & Crous",
|
357
|
+
author: ["U. Braun", "Crous"], year: "2003" } } }]
|
358
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 16], 17 => ["species", 26],
|
359
|
+
27 => ["author_word", 29], 30 => ["author_word", 35],
|
360
|
+
38 => ["author_word", 43], 44 => ["year", 48] })
|
361
361
|
sn = "Pseudocercospora dendrobii Crous, 2003"
|
362
362
|
expect(parse(sn)).to_not be_nil
|
363
363
|
end
|
364
364
|
|
365
|
-
it
|
365
|
+
it "parses basionym authors in parenthesis" do
|
366
366
|
sn = "Zophosis persis (Chatanay, 1914)"
|
367
367
|
expect(parse(sn)).to_not be_nil
|
368
|
-
expect(details(sn)).to eq [{:
|
369
|
-
:
|
370
|
-
:
|
371
|
-
:
|
368
|
+
expect(details(sn)).to eq [{ genus: { string: "Zophosis" },
|
369
|
+
species: { string: "persis", authorship: "(Chatanay, 1914)",
|
370
|
+
basionymAuthorTeam: { authorTeam: "Chatanay",
|
371
|
+
author: ["Chatanay"], year: "1914" } } }]
|
372
372
|
sn = "Zophosis persis (Chatanay 1914)"
|
373
373
|
expect(parse(sn)).to_not be_nil
|
374
|
-
expect(details(sn)).to eq [{:
|
375
|
-
:
|
376
|
-
:
|
377
|
-
:
|
374
|
+
expect(details(sn)).to eq [{ genus: { string: "Zophosis" },
|
375
|
+
species: { string: "persis", authorship: "(Chatanay 1914)",
|
376
|
+
basionymAuthorTeam: { authorTeam: "Chatanay",
|
377
|
+
author: ["Chatanay"], year: "1914" } } }]
|
378
378
|
sn = "Zophosis persis (Chatanay), 1914"
|
379
379
|
expect(parse(sn)).to_not be_nil
|
380
380
|
expect(value(sn)).to eq "Zophosis persis (Chatanay 1914)"
|
381
|
-
expect(details(sn)).to eq [{:
|
382
|
-
:
|
383
|
-
:
|
384
|
-
:
|
385
|
-
expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 15],
|
386
|
-
17=>["author_word", 25], 28=>["year", 32]})
|
381
|
+
expect(details(sn)).to eq [{ genus: { string: "Zophosis" },
|
382
|
+
species: { string: "persis", authorship: "(Chatanay), 1914",
|
383
|
+
basionymAuthorTeam: { author_team: "(Chatanay), 1914",
|
384
|
+
author: ["Chatanay"], year: "1914" } } }]
|
385
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 8], 9 => ["species", 15],
|
386
|
+
17 => ["author_word", 25], 28 => ["year", 32] })
|
387
387
|
expect(parse("Zophosis persis (Chatanay) 1914")).to_not be_nil
|
388
388
|
#parse("Zophosis persis Chatanay (1914)")).to_not be_nil
|
389
389
|
end
|
390
390
|
|
391
391
|
it "parses name with identificaation annotation -- aff cf sp spp" do
|
392
|
-
sn =
|
393
|
-
expect(details(sn)).to eq [{:
|
394
|
-
:
|
395
|
-
:
|
396
|
-
:
|
397
|
-
:
|
398
|
-
sn =
|
399
|
-
expect(details(sn)).to eq [{:
|
400
|
-
:
|
401
|
-
{:
|
402
|
-
:
|
403
|
-
:
|
404
|
-
sn =
|
405
|
-
expect(details(sn)).to eq [{:
|
406
|
-
:
|
407
|
-
:
|
408
|
-
:
|
409
|
-
sn =
|
410
|
-
expect(details(sn)).to eq [{:
|
411
|
-
:
|
412
|
-
{:
|
413
|
-
:
|
414
|
-
:
|
415
|
-
sn =
|
416
|
-
expect(details(sn)).to eq [{:
|
417
|
-
:
|
418
|
-
{:
|
419
|
-
:
|
420
|
-
:
|
421
|
-
sn =
|
422
|
-
expect(details(sn)).to eq [{:
|
423
|
-
:
|
392
|
+
sn = "Diplocephalus aff. procerus Thaler, 1972"
|
393
|
+
expect(details(sn)).to eq [{ genus: { string: "Diplocephalus" },
|
394
|
+
annotation_identification: "aff.",
|
395
|
+
ignored: { species: { string: "procerus", authorship: "Thaler, 1972",
|
396
|
+
basionymAuthorTeam: { authorTeam: "Thaler",
|
397
|
+
author: ["Thaler"], year: "1972" } } } }]
|
398
|
+
sn = "Diplocephalus aff procerus Thaler, 1972"
|
399
|
+
expect(details(sn)).to eq [{ genus: { string: "Diplocephalus" },
|
400
|
+
annotation_identification: "aff", ignored: { species:
|
401
|
+
{ string: "procerus", authorship: "Thaler, 1972",
|
402
|
+
basionymAuthorTeam: { authorTeam: "Thaler",
|
403
|
+
author: ["Thaler"], year: "1972" } } } }]
|
404
|
+
sn = "Diplocephalus affprocerus Thaler, 1972"
|
405
|
+
expect(details(sn)).to eq [{ genus: { string: "Diplocephalus" },
|
406
|
+
species: { string: "affprocerus", authorship: "Thaler, 1972",
|
407
|
+
basionymAuthorTeam: { authorTeam: "Thaler",
|
408
|
+
author: ["Thaler"], year: "1972" } } }]
|
409
|
+
sn = "Diplocephalus cf. procerus Thaler, 1972"
|
410
|
+
expect(details(sn)).to eq [{ genus: { string: "Diplocephalus" },
|
411
|
+
annotation_identification: "cf.", species: { species:
|
412
|
+
{ string: "procerus", authorship: "Thaler, 1972",
|
413
|
+
basionymAuthorTeam: { authorTeam: "Thaler",
|
414
|
+
author: ["Thaler"], year: "1972" } } } }]
|
415
|
+
sn = "Diplocephalus cf procerus Thaler, 1972"
|
416
|
+
expect(details(sn)).to eq [{ genus: { string: "Diplocephalus" },
|
417
|
+
annotation_identification: "cf", species:
|
418
|
+
{ species: { string: "procerus", authorship: "Thaler, 1972",
|
419
|
+
basionymAuthorTeam: { authorTeam: "Thaler",
|
420
|
+
author: ["Thaler"], year: "1972" } } } }]
|
421
|
+
sn = "Sphingomonas sp. 37"
|
422
|
+
expect(details(sn)).to eq [{ genus: { string: "Sphingomonas" },
|
423
|
+
annotation_identification: "sp.", ignored: { unparsed: "37" } }]
|
424
424
|
sn = "Thryothorus leucotis spp. bogotensis"
|
425
|
-
expect(details(sn)).to eq [{:
|
426
|
-
:
|
427
|
-
[{:
|
428
|
-
:
|
425
|
+
expect(details(sn)).to eq [{ genus: { string: "Thryothorus" },
|
426
|
+
species: { string: "leucotis" }, infraspecies:
|
427
|
+
[{ annotation_identification: "spp.",
|
428
|
+
ignored: { infraspecies: { string: "bogotensis", rank: "n/a" } } }]}]
|
429
429
|
end
|
430
430
|
|
431
|
-
it
|
431
|
+
it "parses scientific name" do
|
432
432
|
sn = "Pseudocercospora dendrobii(H.C. Burnett)U. Braun & Crous 2003"
|
433
433
|
expect(parse(sn)).to_not be_nil
|
434
434
|
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett) "\
|
435
435
|
"U. Braun & Crous 2003"
|
436
436
|
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
437
|
-
expect(details(sn)).to eq [{:
|
438
|
-
:
|
439
|
-
:
|
440
|
-
:
|
441
|
-
:
|
442
|
-
:
|
443
|
-
:
|
437
|
+
expect(details(sn)).to eq [{ genus: { string: "Pseudocercospora" },
|
438
|
+
species: { string: "dendrobii",
|
439
|
+
authorship: "(H.C. Burnett)U. Braun & Crous 2003",
|
440
|
+
combinationAuthorTeam: { authorTeam: "U. Braun & Crous",
|
441
|
+
author: ["U. Braun", "Crous"], year: "2003" },
|
442
|
+
basionymAuthorTeam: { authorTeam: "H.C. Burnett",
|
443
|
+
author: ["H.C. Burnett"] } } }]
|
444
444
|
sn = "Pseudocercospora dendrobii(H.C. Burnett,1873)"\
|
445
445
|
"U. Braun & Crous 2003"
|
446
446
|
expect(parse(sn)).to_not be_nil
|
447
447
|
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1873) "\
|
448
448
|
"U. Braun & Crous 2003"
|
449
|
-
expect(details(sn)).to eq [{:
|
450
|
-
:
|
451
|
-
:
|
452
|
-
:
|
453
|
-
:
|
454
|
-
:
|
455
|
-
:
|
449
|
+
expect(details(sn)).to eq [{ genus: { string: "Pseudocercospora" },
|
450
|
+
species: { string: "dendrobii",
|
451
|
+
authorship: "(H.C. Burnett,1873)U. Braun & Crous 2003",
|
452
|
+
combinationAuthorTeam: { authorTeam: "U. Braun & Crous",
|
453
|
+
author: ["U. Braun", "Crous"], year: "2003" },
|
454
|
+
basionymAuthorTeam: { authorTeam: "H.C. Burnett",
|
455
|
+
author: ["H.C. Burnett"], year: "1873" } } }]
|
456
456
|
end
|
457
457
|
|
458
|
-
it
|
458
|
+
it "parses several authors with several years" do
|
459
459
|
sn = "Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003"
|
460
460
|
expect(parse(sn)).to_not be_nil
|
461
461
|
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1883) "\
|
462
462
|
"U. Braun & Crous 2003"
|
463
463
|
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
464
|
-
expect(details(sn)).to eq [{:
|
465
|
-
:
|
466
|
-
:
|
467
|
-
:
|
468
|
-
:
|
469
|
-
:
|
470
|
-
:
|
471
|
-
expect(pos(sn)).to eq({0=>["genus", 16], 17=>["species", 26],
|
472
|
-
28=>["author_word", 32], 33=>["author_word", 40],
|
473
|
-
41=>["year", 45], 47=>["author_word", 49],
|
474
|
-
50=>["author_word", 55], 58=>["author_word", 63],
|
464
|
+
expect(details(sn)).to eq [{ genus: { string: "Pseudocercospora" },
|
465
|
+
species: { string: "dendrobii",
|
466
|
+
authorship: "(H.C. Burnett 1883) U. Braun & Crous 2003",
|
467
|
+
combinationAuthorTeam: { authorTeam: "U. Braun & Crous",
|
468
|
+
author: ["U. Braun", "Crous"], year: "2003" },
|
469
|
+
basionymAuthorTeam: { authorTeam: "H.C. Burnett",
|
470
|
+
author: ["H.C. Burnett"], year: "1883" } } }]
|
471
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 16], 17 => ["species", 26],
|
472
|
+
28 => ["author_word", 32], 33 => ["author_word", 40],
|
473
|
+
41 => ["year", 45], 47 => ["author_word", 49],
|
474
|
+
50 => ["author_word", 55], 58 => ["author_word", 63],
|
475
|
+
64 => ["year", 68] })
|
475
476
|
end
|
476
477
|
|
477
478
|
it "parses name with subspecies without rank Zoological Code" do
|
@@ -480,57 +481,59 @@ describe ScientificNameClean do
|
|
480
481
|
expect(value(sn)).to eq "Hydnellum scrobiculatum zonatum (Banker) "\
|
481
482
|
"D. Hall & D.E. Stuntz 1972"
|
482
483
|
expect(canonical(sn)).to eq "Hydnellum scrobiculatum zonatum"
|
483
|
-
expect(details(sn)).to eq [{:
|
484
|
-
:
|
485
|
-
:
|
486
|
-
:
|
487
|
-
:
|
488
|
-
:
|
489
|
-
:
|
490
|
-
expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 23],
|
491
|
-
24=>["infraspecies", 31], 33=>["author_word", 39],
|
492
|
-
41=>["author_word", 43], 44=>["author_word", 48],
|
493
|
-
51=>["author_word", 55], 56=>["author_word", 62],
|
484
|
+
expect(details(sn)).to eq [{ genus: { string: "Hydnellum" },
|
485
|
+
species: { string: "scrobiculatum" },
|
486
|
+
infraspecies: [{ string: "zonatum", rank: "n/a",
|
487
|
+
authorship: "(Banker) D. Hall & D.E. Stuntz 1972",
|
488
|
+
combinationAuthorTeam: { authorTeam: "D. Hall & D.E. Stuntz",
|
489
|
+
author: ["D. Hall", "D.E. Stuntz"], year: "1972" },
|
490
|
+
basionymAuthorTeam: { authorTeam: "Banker", author: ["Banker"] } }]}]
|
491
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 9], 10 => ["species", 23],
|
492
|
+
24 => ["infraspecies", 31], 33 => ["author_word", 39],
|
493
|
+
41 => ["author_word", 43], 44 => ["author_word", 48],
|
494
|
+
51 => ["author_word", 55], 56 => ["author_word", 62],
|
495
|
+
63 => ["year", 67] })
|
494
496
|
sn = "Begonia pingbienensis angustior"
|
495
497
|
expect(parse(sn)).to_not be_nil
|
496
|
-
expect(details(sn)).to eq [{:
|
497
|
-
:
|
498
|
-
:
|
499
|
-
expect(pos(sn)).to eq({0=>["genus", 7],
|
500
|
-
8=>["species", 21], 22=>["infraspecies", 31]})
|
498
|
+
expect(details(sn)).to eq [{ genus: { string: "Begonia" },
|
499
|
+
species: { string: "pingbienensis" },
|
500
|
+
infraspecies: [{ string: "angustior", rank: "n/a" }]}]
|
501
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 7],
|
502
|
+
8 => ["species", 21], 22 => ["infraspecies", 31] })
|
501
503
|
end
|
502
504
|
|
503
|
-
it
|
505
|
+
it "parses infraspecies with rank" do
|
504
506
|
sn = "Aus bus Linn. var. bus"
|
505
507
|
expect(parse(sn)).to_not be_nil
|
506
|
-
expect(details(sn)).to eq [{:
|
507
|
-
:
|
508
|
-
:
|
509
|
-
:
|
508
|
+
expect(details(sn)).to eq [{ genus: { string: "Aus" },
|
509
|
+
species: { string: "bus", authorship: "Linn.",
|
510
|
+
basionymAuthorTeam: { authorTeam: "Linn.",
|
511
|
+
author: ["Linn."] } }, infraspecies: [{ string: "bus", rank: "var."}]}]
|
510
512
|
sn = "Agalinis purpurea (L.) Briton var. borealis (Berg.) Peterson 1987"
|
511
513
|
expect(parse(sn)).to_not be_nil
|
512
|
-
expect(details(sn)).to eq [{:
|
513
|
-
:
|
514
|
-
:
|
515
|
-
:
|
516
|
-
:
|
517
|
-
:
|
518
|
-
:
|
519
|
-
:
|
520
|
-
:
|
521
|
-
expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 17],
|
522
|
-
19=>["author_word", 21], 23=>["author_word", 29],
|
523
|
-
30=>["infraspecific_type", 34], 35=>["infraspecies", 43],
|
524
|
-
45=>["author_word", 50], 52=>["author_word", 60],
|
514
|
+
expect(details(sn)).to eq [{ genus: { string: "Agalinis" },
|
515
|
+
species: { string: "purpurea", authorship: "(L.) Briton",
|
516
|
+
combinationAuthorTeam: { authorTeam: "Briton", author: ["Briton"] },
|
517
|
+
basionymAuthorTeam: { authorTeam: "L.",
|
518
|
+
author: ["L."] } }, infraspecies: [{ string: "borealis",
|
519
|
+
rank: "var.", authorship: "(Berg.) Peterson 1987",
|
520
|
+
combinationAuthorTeam: { authorTeam: "Peterson",
|
521
|
+
author: ["Peterson"], year: "1987" },
|
522
|
+
basionymAuthorTeam: { authorTeam: "Berg.", author: ["Berg."] } }]}]
|
523
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 8], 9 => ["species", 17],
|
524
|
+
19 => ["author_word", 21], 23 => ["author_word", 29],
|
525
|
+
30 => ["infraspecific_type", 34], 35 => ["infraspecies", 43],
|
526
|
+
45 => ["author_word", 50], 52 => ["author_word", 60],
|
527
|
+
61 => ["year", 65] })
|
525
528
|
sn = "Phaeographis inusta var. macularis(Leight.) A.L. Sm. 1861"
|
526
529
|
expect(parse(sn)).to_not be_nil
|
527
530
|
expect(value(sn)).to eq "Phaeographis inusta var. macularis (Leight.) "\
|
528
531
|
"A.L. Sm. 1861"
|
529
532
|
expect(canonical(sn)).to eq "Phaeographis inusta macularis"
|
530
|
-
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 19],
|
531
|
-
20=>["infraspecific_type", 24], 25=>["infraspecies", 34],
|
532
|
-
35=>["author_word", 42], 44=>["author_word", 48],
|
533
|
-
49=>["author_word", 52], 53=>["year", 57]})
|
533
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 19],
|
534
|
+
20 => ["infraspecific_type", 24], 25 => ["infraspecies", 34],
|
535
|
+
35 => ["author_word", 42], 44 => ["author_word", 48],
|
536
|
+
49 => ["author_word", 52], 53 => ["year", 57] })
|
534
537
|
sn = "Cassytha peninsularis J. Z. Weber var. flindersii"
|
535
538
|
expect(canonical(sn)).to eq "Cassytha peninsularis flindersii"
|
536
539
|
sn = "Prunus armeniaca convar. budae (Pénzes) Soó"
|
@@ -553,60 +556,79 @@ describe ScientificNameClean do
|
|
553
556
|
expect(canonical(sn)).to eq "Polypodium pectinatum thisisjunk"
|
554
557
|
end
|
555
558
|
|
556
|
-
it
|
559
|
+
it "parsex unknown original authors (auct.)/(hort.)/(?)" do
|
557
560
|
sn = "Tragacantha leporina (?) Kuntze"
|
558
561
|
expect(parse(sn)).to_not be_nil
|
559
562
|
expect(value(sn)).to eq "Tragacantha leporina (?) Kuntze"
|
560
|
-
expect(details(sn)).to eq [{:
|
561
|
-
:
|
562
|
-
:
|
563
|
-
:
|
563
|
+
expect(details(sn)).to eq [{ genus: { string: "Tragacantha" },
|
564
|
+
species: { string: "leporina", authorship: "(?) Kuntze",
|
565
|
+
combinationAuthorTeam: { authorTeam: "Kuntze", author: ["Kuntze"] },
|
566
|
+
basionymAuthorTeam: { authorTeam: "(?)", author: ["?"] } } }]
|
564
567
|
sn = "Lachenalia tricolor var. nelsonii (auct.) Baker"
|
565
568
|
expect(parse(sn)).to_not be_nil
|
566
569
|
expect(value(sn)).to eq "Lachenalia tricolor var. nelsonii (auct.) Baker"
|
567
|
-
expect(details(sn)).to eq [{:
|
568
|
-
:
|
569
|
-
:
|
570
|
-
:
|
571
|
-
:
|
572
|
-
{:
|
573
|
-
expect(pos(sn)).to eq({0=>["genus", 10], 11=>["species", 19],
|
574
|
-
20=>["infraspecific_type", 24], 25=>["infraspecies", 33],
|
575
|
-
35=>["unknown_author", 40], 42=>["author_word", 47]})
|
576
|
-
end
|
577
|
-
|
578
|
-
it
|
570
|
+
expect(details(sn)).to eq [{ genus: { string: "Lachenalia" },
|
571
|
+
species: { string: "tricolor" }, infraspecies: [{ string: "nelsonii",
|
572
|
+
rank: "var.", authorship: "(auct.) Baker",
|
573
|
+
combinationAuthorTeam: { authorTeam: "Baker",
|
574
|
+
author: ["Baker"] }, basionymAuthorTeam:
|
575
|
+
{ authorTeam: "auct.", author: ["unknown"] } }]}]
|
576
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 10], 11 => ["species", 19],
|
577
|
+
20 => ["infraspecific_type", 24], 25 => ["infraspecies", 33],
|
578
|
+
35 => ["unknown_author", 40], 42 => ["author_word", 47] })
|
579
|
+
end
|
580
|
+
|
581
|
+
it "parses unknown authors auct./anon./hort./ht." do
|
579
582
|
sn = "Puya acris ht."
|
580
583
|
expect(parse(sn)).to_not be_nil
|
581
|
-
expect(pos(sn)).to eq({0=>["genus", 4], 5=>["species", 10],
|
582
|
-
11=>["unknown_author", 14]})
|
584
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 4], 5 => ["species", 10],
|
585
|
+
11 => ["unknown_author", 14] })
|
583
586
|
end
|
584
587
|
|
585
|
-
it
|
588
|
+
it "parses normal names with hort or anon in them" do
|
586
589
|
sn = "Mus musculus hortulanus"
|
587
590
|
expect(parse(sn)).to_not be_nil
|
588
|
-
expect(pos(sn)).to eq({0=>["genus", 3], 4=>["species", 12],
|
589
|
-
13=>["infraspecies", 23]})
|
591
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 3], 4 => ["species", 12],
|
592
|
+
13 => ["infraspecies", 23] })
|
590
593
|
end
|
591
594
|
|
592
|
-
it
|
595
|
+
it "parses real world examples" do
|
593
596
|
sn = "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
|
594
597
|
expect(parse(sn)).to_not be_nil
|
595
|
-
expect(value(sn)).
|
596
|
-
|
597
|
-
expect(
|
598
|
-
|
599
|
-
|
598
|
+
expect(value(sn)).
|
599
|
+
to eq "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
|
600
|
+
expect(details(sn)).to eq [{ genus: { string: "Stagonospora" },
|
601
|
+
species: { string: "polyspora",
|
602
|
+
authorship: "M.T. Lucas & Sousa da Câmara 1934", basionymAuthorTeam:
|
603
|
+
{ authorTeam: "M.T. Lucas & Sousa da Câmara",
|
604
|
+
author: ["M.T. Lucas", "Sousa da Câmara"], year: "1934"} } }]
|
605
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 22],
|
606
|
+
23 => ["author_word", 27], 28 => ["author_word", 33],
|
607
|
+
36 => ["author_word", 41], 42 => ["author_word", 44],
|
608
|
+
45 => ["author_word", 51], 52 => ["year", 56] })
|
609
|
+
expect(parse("Cladoniicola staurospora Diederich, "\
|
610
|
+
"van den Boom & Aptroot 2001")).to_not be_nil
|
611
|
+
sn = "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) "\
|
612
|
+
"Van der Walt & Arx 1981"
|
600
613
|
expect(parse(sn)).to_not be_nil
|
601
|
-
expect(value(sn)).to eq "Yarrowia lipolytica var. lipolytica
|
602
|
-
|
614
|
+
expect(value(sn)).to eq "Yarrowia lipolytica var. lipolytica "\
|
615
|
+
"(Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
|
616
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 8], 9 => ["species", 19],
|
617
|
+
20 => ["infraspecific_type", 24], 25 => ["infraspecies", 35],
|
618
|
+
37 => ["author_word", 42], 44 => ["author_word", 52],
|
619
|
+
55 => ["author_word", 59], 60 => ["author_word", 66],
|
620
|
+
68 => ["author_word", 71], 72 => ["author_word", 75],
|
621
|
+
76 => ["author_word", 80], 83 => ["author_word", 86],
|
622
|
+
87 => ["year", 91] })
|
603
623
|
expect(parse("Physalospora rubiginosa (Fr.) anon.")).to_not be_nil
|
604
624
|
expect(parse("Pleurotus ëous (Berk.) Sacc. 1887")).to_not be_nil
|
605
625
|
expect(parse("Lecanora wetmorei Śliwa 2004")).to_not be_nil
|
606
626
|
# valid
|
607
627
|
# infraspecific
|
608
|
-
expect(parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797")).
|
609
|
-
|
628
|
+
expect(parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797")).
|
629
|
+
to_not be_nil
|
630
|
+
expect(parse("Exobasidium vaccinii ** andromedae (P. Karst.) "\
|
631
|
+
"P. Karst. 1882")).to_not be_nil
|
610
632
|
expect(parse("Urceolaria scruposa **** clausa Flot. 1849")).to_not be_nil
|
611
633
|
expect(parse("Cortinarius angulatus B gracilescens Fr. 1838")).to_not be_nil
|
612
634
|
expect(parse("Cyathicula scelobelonium")).to_not be_nil
|
@@ -616,44 +638,61 @@ describe ScientificNameClean do
|
|
616
638
|
# author is exception
|
617
639
|
sn = "Tuber liui A S. Xu 1999"
|
618
640
|
expect(parse(sn)).to_not be_nil
|
619
|
-
expect(details(sn)).to eq [{
|
620
|
-
|
641
|
+
expect(details(sn)).to eq [{ genus: { string: "Tuber" },
|
642
|
+
species: { string: "liui", authorship: "A S. Xu 1999",
|
643
|
+
basionymAuthorTeam: { authorTeam: "A S. Xu",
|
644
|
+
author: ["A S. Xu"], year: "1999"} } }]
|
645
|
+
expect(parse("Xylaria potentillae A S. Xu")).to_not be_nil
|
621
646
|
expect(parse("Agaricus squamula Berk. & M.A. Curtis 1860")).to_not be_nil
|
622
|
-
expect(parse("Peltula coriacea Büdel, Henssen & Wessels 1986")).
|
647
|
+
expect(parse("Peltula coriacea Büdel, Henssen & Wessels 1986")).
|
648
|
+
to_not be_nil
|
623
649
|
#had to add no dot rule for trinomials without a rank to make it to work
|
624
650
|
sn = "Saccharomyces drosophilae anon."
|
625
651
|
expect(parse(sn)).to_not be_nil
|
626
|
-
expect(details(sn)).to eq [{
|
627
|
-
|
652
|
+
expect(details(sn)).to eq [{ genus: { string: "Saccharomyces" },
|
653
|
+
species: { string: "drosophilae", authorship: "anon.",
|
654
|
+
basionymAuthorTeam: { authorTeam: "anon.", author: ["unknown"]} } }]
|
655
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 13],
|
656
|
+
14 => ["species", 25],
|
657
|
+
26 => ["unknown_author", 31] })
|
628
658
|
sn = "Abacetus laevicollis de Chaudoir, 1869"
|
629
659
|
expect(parse(sn)).to_not be_nil
|
630
|
-
expect(canonical(sn)).to eq
|
660
|
+
expect(canonical(sn)).to eq "Abacetus laevicollis"
|
631
661
|
sn = "Gastrosericus eremorum van Beaumont 1955"
|
632
|
-
expect(canonical(sn)).to eq
|
662
|
+
expect(canonical(sn)).to eq "Gastrosericus eremorum"
|
633
663
|
sn = "Gastrosericus eremorum von Beaumont 1955"
|
634
|
-
expect(canonical(sn)).to eq
|
664
|
+
expect(canonical(sn)).to eq "Gastrosericus eremorum"
|
635
665
|
sn = "Cypraeovula (Luponia) amphithales perdentata"
|
636
|
-
expect(canonical(sn)).to eq
|
637
|
-
expect(details(sn)).to eq [{
|
666
|
+
expect(canonical(sn)).to eq "Cypraeovula amphithales perdentata"
|
667
|
+
expect(details(sn)).to eq [{ genus: { string: "Cypraeovula" },
|
668
|
+
infragenus: { string: "Luponia"}, species: { string: "amphithales"},
|
669
|
+
infraspecies: [{ string: "perdentata", rank: "n/a"}]}]
|
638
670
|
sn = "Polyrhachis orsyllus nat musculus Forel 1901"
|
639
671
|
expect(canonical(sn)).to eq "Polyrhachis orsyllus musculus"
|
640
|
-
sn =
|
641
|
-
expect(canonical(sn)).to eq
|
642
|
-
expect(value(sn)).to eq
|
643
|
-
sn =
|
644
|
-
expect(canonical(sn)).to eq
|
645
|
-
expect(value(sn)).to eq
|
646
|
-
sn =
|
647
|
-
expect(canonical(sn)).to eq
|
672
|
+
sn = "Latrodectus 13-guttatus Thorell, 1875"
|
673
|
+
expect(canonical(sn)).to eq "Latrodectus tredecguttatus"
|
674
|
+
expect(value(sn)).to eq "Latrodectus tredecguttatus Thorell 1875"
|
675
|
+
sn = "Latrodectus 3-guttatus Thorell, 1875"
|
676
|
+
expect(canonical(sn)).to eq "Latrodectus triguttatus"
|
677
|
+
expect(value(sn)).to eq "Latrodectus triguttatus Thorell 1875"
|
678
|
+
sn = "Balaninus c-album Schönherr, CJ., 1836"
|
679
|
+
expect(canonical(sn)).to eq "Balaninus c-album"
|
648
680
|
end
|
649
681
|
|
650
682
|
it "parses name with morph." do
|
651
683
|
sn = "Callideriphus flavicollis morph. reductus Fuchs 1961"
|
652
684
|
expect(parse(sn)).to_not be_nil
|
653
|
-
expect(value(sn)).
|
685
|
+
expect(value(sn)).
|
686
|
+
to eq "Callideriphus flavicollis morph. reductus Fuchs 1961"
|
654
687
|
expect(canonical(sn)).to eq "Callideriphus flavicollis reductus"
|
655
|
-
expect(details(sn)).to eq [{
|
656
|
-
|
688
|
+
expect(details(sn)).to eq [{ genus: { string: "Callideriphus" },
|
689
|
+
species: { string: "flavicollis"}, infraspecies: [{ string: "reductus",
|
690
|
+
rank: "morph.", authorship: "Fuchs 1961", basionymAuthorTeam:
|
691
|
+
{ authorTeam: "Fuchs", author: ["Fuchs"], year: "1961"} }]}]
|
692
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 13], 14 => ["species", 25],
|
693
|
+
26 => ["infraspecific_type", 32],
|
694
|
+
33 => ["infraspecies", 41],
|
695
|
+
42 => ["author_word", 47], 48 => ["year", 52] })
|
657
696
|
end
|
658
697
|
|
659
698
|
|
@@ -662,38 +701,90 @@ describe ScientificNameClean do
|
|
662
701
|
expect(parse(sn)).to_not be_nil
|
663
702
|
expect(value(sn)).to eq "Caulerpa cupressoides forma nuda"
|
664
703
|
expect(canonical(sn)).to eq "Caulerpa cupressoides nuda"
|
665
|
-
expect(details(sn)).to eq [{
|
666
|
-
|
704
|
+
expect(details(sn)).to eq [{ genus: { string: "Caulerpa" },
|
705
|
+
species: { string: "cupressoides"},
|
706
|
+
infraspecies: [{ string: "nuda", rank: "forma"}]}]
|
707
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 8], 9 => ["species", 21],
|
708
|
+
22 => ["infraspecific_type", 27],
|
709
|
+
28 => ["infraspecies", 32] })
|
667
710
|
sn = "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
|
668
711
|
expect(parse(sn)).to_not be_nil
|
669
|
-
expect(value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó")).
|
712
|
+
expect(value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó")).
|
713
|
+
to eq "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
|
670
714
|
expect(canonical(sn)).to eq "Chlorocyperus glaber fasciculariforme"
|
671
|
-
expect(details(sn)).to eq [{
|
672
|
-
|
673
|
-
|
715
|
+
expect(details(sn)).to eq [{ genus: { string: "Chlorocyperus" },
|
716
|
+
species: { string: "glaber"}, infraspecies:
|
717
|
+
[{ string: "fasciculariforme", rank: "form.",
|
718
|
+
authorship: "(Lojac.) Soó", combinationAuthorTeam: { authorTeam: "Soó",
|
719
|
+
author: ["Soó"]}, basionymAuthorTeam: { authorTeam: "Lojac.",
|
720
|
+
author: ["Lojac."]} }]}]
|
721
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 13], 14 => ["species", 20],
|
722
|
+
21 => ["infraspecific_type", 26],
|
723
|
+
27 => ["infraspecies", 43],
|
724
|
+
45 => ["author_word", 51],
|
725
|
+
53 => ["author_word", 56] })
|
726
|
+
sn = "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) "\
|
727
|
+
"Makino ex Shiros."
|
674
728
|
expect(parse(sn)).to_not be_nil
|
675
|
-
expect(value(sn)).to eq "Bambusa nana Roxb. fo. alphonse-karri
|
729
|
+
expect(value(sn)).to eq "Bambusa nana Roxb. fo. alphonse-karri "\
|
730
|
+
"(Mitford ex Satow) Makino ex Shiros."
|
676
731
|
expect(canonical(sn)).to eq "Bambusa nana alphonse-karri"
|
677
|
-
expect(details(sn)).to eq [{
|
678
|
-
|
732
|
+
expect(details(sn)).to eq [{ genus: { string: "Bambusa" },
|
733
|
+
species: { string: "nana", authorship: "Roxb.", basionymAuthorTeam:
|
734
|
+
{ authorTeam: "Roxb.", author: ["Roxb."]} },
|
735
|
+
infraspecies: [{ string: "alphonse-karri",
|
736
|
+
rank: "fo.", authorship: "(Mitford ex Satow) Makino ex Shiros.",
|
737
|
+
combinationAuthorTeam: { authorTeam: "Makino",
|
738
|
+
author: ["Makino"], exAuthorTeam: { authorTeam: "Shiros.",
|
739
|
+
author: ["Shiros."]} }, basionymAuthorTeam: { authorTeam: "Mitford",
|
740
|
+
author: ["Mitford"], exAuthorTeam: { authorTeam: "Satow",
|
741
|
+
author: ["Satow"]} } }]}]
|
742
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 7], 8 => ["species", 12],
|
743
|
+
13 => ["author_word", 18], 19 => ["infraspecific_type", 22],
|
744
|
+
23 => ["infraspecies", 37], 39 => ["author_word", 46],
|
745
|
+
50 => ["author_word", 55], 57 => ["author_word", 63],
|
746
|
+
67 => ["author_word", 74] })
|
679
747
|
sn = " Sphaerotheca fuliginea f. dahliae Movss. 1967 "
|
680
748
|
sn = "Sphaerotheca fuliginea f. dahliae Movss. 1967"
|
681
749
|
expect(parse(sn)).to_not be_nil
|
682
750
|
expect(value(sn)).to eq "Sphaerotheca fuliginea f. dahliae Movss. 1967"
|
683
751
|
expect(canonical(sn)).to eq "Sphaerotheca fuliginea dahliae"
|
684
|
-
expect(details(sn)).to eq [{
|
685
|
-
|
686
|
-
|
752
|
+
expect(details(sn)).to eq [{ genus: { string: "Sphaerotheca" },
|
753
|
+
species: { string: "fuliginea"}, infraspecies:
|
754
|
+
[{ string: "dahliae", rank: "f.", authorship: "Movss. 1967",
|
755
|
+
basionymAuthorTeam: { authorTeam: "Movss.",
|
756
|
+
author: ["Movss."], year: "1967"} }]}]
|
757
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 16 => ["species", 25],
|
758
|
+
29 => ["infraspecific_type", 31], 36 => ["infraspecies", 43],
|
759
|
+
47 => ["author_word", 53], 58 => ["year", 62] })
|
760
|
+
expect(parse("Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay")).
|
761
|
+
to_not be_nil
|
687
762
|
end
|
688
763
|
|
689
|
-
it "parses name with several subspecies names
|
690
|
-
|
764
|
+
it "parses name with several subspecies names" do
|
765
|
+
# NOT BOTANICAL CODE BUT NOT INFREQUENT"
|
766
|
+
sn = "Hydnellum scrobiculatum var. zonatum f. "\
|
767
|
+
"parvum (Banker) D. Hall & D.E. Stuntz 1972"
|
691
768
|
expect(parse(sn)).to_not be_nil
|
692
|
-
expect(value(sn)).to eq "Hydnellum scrobiculatum var. zonatum f.
|
693
|
-
|
694
|
-
expect(
|
695
|
-
|
696
|
-
|
769
|
+
expect(value(sn)).to eq "Hydnellum scrobiculatum var. zonatum f. "\
|
770
|
+
"parvum (Banker) D. Hall & D.E. Stuntz 1972"
|
771
|
+
expect(details(sn)).to eq [{ genus: { string: "Hydnellum" }, species:
|
772
|
+
{ string: "scrobiculatum"}, infraspecies: [{ string: "zonatum",
|
773
|
+
rank: "var."}, { string: "parvum", rank: "f.",
|
774
|
+
authorship: "(Banker) D. Hall & D.E. Stuntz 1972",
|
775
|
+
combinationAuthorTeam: { authorTeam: "D. Hall & D.E. Stuntz",
|
776
|
+
author: ["D. Hall", "D.E. Stuntz"], year: "1972"},
|
777
|
+
basionymAuthorTeam: { authorTeam: "Banker", author: ["Banker"]} }]}]
|
778
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 9], 10 => ["species", 23],
|
779
|
+
24 => ["infraspecific_type", 28], 29 => ["infraspecies", 36],
|
780
|
+
37 => ["infraspecific_type", 39], 40 => ["infraspecies", 46],
|
781
|
+
48 => ["author_word", 54], 56 => ["author_word", 58],
|
782
|
+
59 => ["author_word", 63], 66 => ["author_word", 70],
|
783
|
+
71 => ["author_word", 77], 78 => ["year", 82] })
|
784
|
+
expect(parse("Senecio fuchsii C.C.Gmel. subsp. fuchsii var. "\
|
785
|
+
"expansus (Boiss. & Heldr.) Hayek")).to_not be_nil
|
786
|
+
expect(parse("Senecio fuchsii C.C.Gmel. subsp. fuchsii var. fuchsii")).
|
787
|
+
to_not be_nil
|
697
788
|
end
|
698
789
|
|
699
790
|
|
@@ -701,64 +792,139 @@ describe ScientificNameClean do
|
|
701
792
|
#it is always latin abbrev often 2 words
|
702
793
|
sn = "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
|
703
794
|
expect(parse(sn)).to_not be_nil
|
704
|
-
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.)
|
795
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) "\
|
796
|
+
"R.C. Harris comb. nov."
|
705
797
|
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
706
|
-
expect(details(sn)).to eq [{
|
707
|
-
|
798
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
799
|
+
species: { string: "hyalospora", authorship: "(Nyl.) R.C. Harris",
|
800
|
+
combinationAuthorTeam: { authorTeam: "R.C. Harris",
|
801
|
+
author: ["R.C. Harris"]}, basionymAuthorTeam: { authorTeam: "Nyl.",
|
802
|
+
author: ["Nyl."]} }, status: "comb. nov."}]
|
803
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23],
|
804
|
+
25 => ["author_word", 29], 31 => ["author_word", 35],
|
805
|
+
36 => ["author_word", 42] })
|
708
806
|
end
|
709
807
|
|
710
808
|
it "parses revised (ex) names" do
|
711
809
|
#invalidly published
|
712
810
|
sn = "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
|
713
811
|
expect(parse(sn)).to_not be_nil
|
714
|
-
expect(value(sn)).
|
812
|
+
expect(value(sn)).
|
813
|
+
to eq "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
|
715
814
|
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
716
|
-
expect(details(sn)).to eq [{
|
717
|
-
|
815
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
816
|
+
species: { string: "hyalospora",
|
817
|
+
authorship: "(Nyl. ex Banker) R.C. Harris", combinationAuthorTeam:
|
818
|
+
{ authorTeam: "R.C. Harris", author: ["R.C. Harris"]},
|
819
|
+
basionymAuthorTeam: { authorTeam: "Nyl.", author: ["Nyl."],
|
820
|
+
exAuthorTeam: { authorTeam: "Banker", author: ["Banker"]} } } }]
|
821
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23],
|
822
|
+
25 => ["author_word", 29], 33 => ["author_word", 39],
|
823
|
+
41 => ["author_word", 45], 46 => ["author_word", 52] })
|
718
824
|
sn = "Arthopyrenia hyalospora Nyl. ex Banker"
|
719
825
|
expect(parse(sn)).to_not be_nil
|
720
|
-
expect(details(sn)).to eq [{
|
826
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
827
|
+
species: { string: "hyalospora", authorship: "Nyl. ex Banker",
|
828
|
+
basionymAuthorTeam: { authorTeam: "Nyl.", author: ["Nyl."],
|
829
|
+
exAuthorTeam: { authorTeam: "Banker", author: ["Banker"]} } } }]
|
721
830
|
sn = "Glomopsis lonicerae Peck ex C.J. Gould 1945"
|
722
831
|
expect(parse(sn)).to_not be_nil
|
723
|
-
expect(details(sn)).to eq [{
|
724
|
-
|
725
|
-
|
832
|
+
expect(details(sn)).to eq [{ genus: { string: "Glomopsis" },
|
833
|
+
species: { string: "lonicerae", authorship: "Peck ex C.J. Gould 1945",
|
834
|
+
basionymAuthorTeam: { authorTeam: "Peck", author: ["Peck"],
|
835
|
+
exAuthorTeam: { authorTeam: "C.J. Gould", author: ["C.J. Gould"],
|
836
|
+
year: "1945"} } } }]
|
837
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 9], 10 => ["species", 19],
|
838
|
+
20 => ["author_word", 24], 28 => ["author_word", 32],
|
839
|
+
33 => ["author_word", 38], 39 => ["year", 43] })
|
840
|
+
expect(parse("Acanthobasidium delicatum (Wakef.) Oberw. ex Jülich 1979")).
|
841
|
+
to_not be_nil
|
726
842
|
sn = "Mycosphaerella eryngii (Fr. ex Duby) Johanson ex Oudem. 1897"
|
727
843
|
expect(parse(sn)).to_not be_nil
|
728
|
-
expect(details(sn)).to eq [{
|
729
|
-
|
844
|
+
expect(details(sn)).to eq [{ genus: { string: "Mycosphaerella" },
|
845
|
+
species: { string: "eryngii",
|
846
|
+
authorship: "(Fr. ex Duby) Johanson ex Oudem. 1897",
|
847
|
+
combinationAuthorTeam: { authorTeam: "Johanson", author: ["Johanson"],
|
848
|
+
exAuthorTeam: { authorTeam: "Oudem.", author: ["Oudem."], year: "1897"} },
|
849
|
+
basionymAuthorTeam: { authorTeam: "Fr.", author: ["Fr."],
|
850
|
+
exAuthorTeam: { authorTeam: "Duby", author: ["Duby"]} } } }]
|
851
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 14], 15 => ["species", 22],
|
852
|
+
24 => ["author_word", 27], 31 => ["author_word", 35],
|
853
|
+
37 => ["author_word", 45], 49 => ["author_word", 55],
|
854
|
+
56 => ["year", 60] })
|
730
855
|
#invalid but happens
|
731
|
-
expect(parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897")).
|
732
|
-
|
733
|
-
|
856
|
+
expect(parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897")).
|
857
|
+
to_not be_nil
|
858
|
+
expect(parse("Mycosphaerella eryngii (Fr.ex Duby) ex Oudem. 1897")).
|
859
|
+
to_not be_nil
|
860
|
+
sn = "Salmonella werahensis (Castellani) Hauduroy and Ehringer "\
|
861
|
+
"in Hauduroy 1937"
|
734
862
|
expect(parse(sn)).to_not be_nil
|
735
|
-
expect(details(sn)).to eq [{
|
736
|
-
|
863
|
+
expect(details(sn)).to eq [{ genus: { string: "Salmonella" },
|
864
|
+
species: { string: "werahensis",
|
865
|
+
authorship: "(Castellani) Hauduroy and Ehringer in Hauduroy 1937",
|
866
|
+
combinationAuthorTeam: { authorTeam: "Hauduroy and Ehringer",
|
867
|
+
author: ["Hauduroy", "Ehringer"], exAuthorTeam: {
|
868
|
+
authorTeam: "Hauduroy", author: ["Hauduroy"], year: "1937"} },
|
869
|
+
basionymAuthorTeam: { authorTeam: "Castellani",
|
870
|
+
author: ["Castellani"]} } }]
|
871
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 10], 11 => ["species", 21],
|
872
|
+
23 => ["author_word", 33], 35 => ["author_word", 43],
|
873
|
+
48 => ["author_word", 56], 60 => ["author_word", 68],
|
874
|
+
69 => ["year", 73] })
|
737
875
|
end
|
738
876
|
|
739
|
-
it
|
877
|
+
it "parses named hybrids" do
|
740
878
|
[
|
741
|
-
["×Agropogon P. Fourn. 1934", [{
|
742
|
-
|
743
|
-
|
744
|
-
["
|
745
|
-
|
746
|
-
|
747
|
-
["
|
748
|
-
|
749
|
-
|
750
|
-
["
|
751
|
-
["
|
879
|
+
["×Agropogon P. Fourn. 1934", [{ uninomial: { string: "Agropogon",
|
880
|
+
authorship: "P. Fourn. 1934", basionymAuthorTeam:
|
881
|
+
{ authorTeam: "P. Fourn.", author: ["P. Fourn."], year: "1934" } } }]],
|
882
|
+
["xAgropogon P. Fourn.", [{ uninomial: { string: "Agropogon",
|
883
|
+
authorship: "P. Fourn.", basionymAuthorTeam: { authorTeam: "P. Fourn.",
|
884
|
+
author: ["P. Fourn."] } } }]],
|
885
|
+
["XAgropogon P.Fourn.", [{ uninomial: { string: "Agropogon",
|
886
|
+
authorship: "P.Fourn.", basionymAuthorTeam: { authorTeam: "P.Fourn.",
|
887
|
+
author: ["P.Fourn."] } } }]],
|
888
|
+
["× Agropogon", [{ uninomial: { string: "Agropogon" } }]],
|
889
|
+
["x Agropogon", [{ uninomial: { string: "Agropogon" } }]],
|
890
|
+
["X Agropogon", [{ uninomial: { string: "Agropogon" } }]],
|
891
|
+
["X Cupressocyparis leylandii", [{ genus: { string: "Cupressocyparis" },
|
892
|
+
species: { string: "leylandii"} }]],
|
893
|
+
["×Heucherella tiarelloides", [{ genus: { string: "Heucherella" },
|
894
|
+
species: { string: "tiarelloides"} }]],
|
895
|
+
["xHeucherella tiarelloides", [{ genus: { string: "Heucherella" },
|
896
|
+
species: { string: "tiarelloides"} }]],
|
897
|
+
["x Heucherella tiarelloides", [{ genus: { string: "Heucherella" },
|
898
|
+
species: { string: "tiarelloides"} }]],
|
899
|
+
["×Agropogon littoralis (Sm.) C. E. Hubb. 1946", [{ genus:
|
900
|
+
{ string: "Agropogon" }, species: { string: "littoralis",
|
901
|
+
authorship: "(Sm.) C. E. Hubb. 1946", combinationAuthorTeam:
|
902
|
+
{ authorTeam: "C. E. Hubb.", author: ["C. E. Hubb."], year: "1946"},
|
903
|
+
basionymAuthorTeam: { authorTeam: "Sm.", author: ["Sm."]} } }]]
|
752
904
|
].each do |res|
|
753
905
|
expect(parse(res[0])).to_not be_nil
|
754
906
|
expect(parse(res[0]).hybrid).to eq true
|
755
907
|
expect(details(res[0])).to eq res[1]
|
756
908
|
end
|
757
909
|
[
|
758
|
-
[
|
759
|
-
|
760
|
-
|
761
|
-
|
910
|
+
["Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956)",
|
911
|
+
[{ genus: { string: "Asplenium" }, species: { string: "inexpectatum",
|
912
|
+
authorship: "(E.L. Braun 1940) Morton (1956)", combinationAuthorTeam:
|
913
|
+
{ authorTeam: "Morton", author: ["Morton"], year: "1956"},
|
914
|
+
basionymAuthorTeam: { authorTeam: "E.L. Braun", author: ["E.L. Braun"],
|
915
|
+
year: "1940"} } }]],
|
916
|
+
["Mentha ×smithiana R. A. Graham 1949",[{ genus: { string: "Mentha" },
|
917
|
+
species: { string: "smithiana", authorship: "R. A. Graham 1949",
|
918
|
+
basionymAuthorTeam: { authorTeam: "R. A. Graham",
|
919
|
+
author: ["R. A. Graham"], year: "1949"} } }]],
|
920
|
+
["Salix ×capreola Andersson (1867)",[{ genus: { string: "Salix" },
|
921
|
+
species: { string: "capreola", authorship: "Andersson (1867)",
|
922
|
+
basionymAuthorTeam: { authorTeam: "Andersson", author: ["Andersson"],
|
923
|
+
year: "1867"} } }]],
|
924
|
+
["Salix x capreola Andersson",[{ genus: { string: "Salix" },
|
925
|
+
species: { string: "capreola", authorship: "Andersson",
|
926
|
+
basionymAuthorTeam: { authorTeam: "Andersson",
|
927
|
+
author: ["Andersson"]} } }]]
|
762
928
|
].each do |res|
|
763
929
|
expect(parse(res[0])).to_not be_nil
|
764
930
|
expect(parse(res[0]).hybrid).to eq true
|
@@ -766,62 +932,102 @@ describe ScientificNameClean do
|
|
766
932
|
end
|
767
933
|
sn = "Rosa alpina x pomifera"
|
768
934
|
expect(canonical(sn)).to eq "Rosa alpina × pomifera"
|
769
|
-
expect(parse(sn).details).to eq [{
|
935
|
+
expect(parse(sn).details).to eq [{ genus: { string: "Rosa" },
|
936
|
+
species: { string: "alpina"} }, { species: { string: "pomifera"},
|
937
|
+
genus: { string: "Rosa"} }]
|
770
938
|
end
|
771
939
|
|
772
940
|
it "parses hybrid combination" do
|
773
941
|
sn = "Arthopyrenia hyalospora X Hydnellum scrobiculatum"
|
774
942
|
expect(parse(sn)).to_not be_nil
|
775
943
|
expect(parse(sn).hybrid).to eq true
|
776
|
-
expect(value(sn)).
|
777
|
-
|
778
|
-
expect(
|
779
|
-
|
780
|
-
sn
|
944
|
+
expect(value(sn)).
|
945
|
+
to eq "Arthopyrenia hyalospora \303\227 Hydnellum scrobiculatum"
|
946
|
+
expect(canonical(sn)).
|
947
|
+
to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
|
948
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
949
|
+
species: { string: "hyalospora"} }, { genus: { string: "Hydnellum"},
|
950
|
+
species: { string: "scrobiculatum"} }]
|
951
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23],
|
952
|
+
26 => ["genus", 35], 36 => ["species", 49] })
|
953
|
+
sn = "Arthopyrenia hyalospora (Banker) D. Hall X Hydnellum "\
|
954
|
+
"scrobiculatum D.E. Stuntz"
|
781
955
|
expect(parse(sn)).to_not be_nil
|
782
956
|
expect(parse(sn).hybrid).to eq true
|
783
|
-
expect(value(sn)).to eq "Arthopyrenia hyalospora (Banker)
|
784
|
-
|
785
|
-
expect(
|
786
|
-
|
957
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Banker) "\
|
958
|
+
"D. Hall \303\227 Hydnellum scrobiculatum D.E. Stuntz"
|
959
|
+
expect(canonical(sn)).
|
960
|
+
to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
|
961
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23],
|
962
|
+
25 => ["author_word", 31], 33 => ["author_word", 35],
|
963
|
+
36 => ["author_word", 40], 43 => ["genus", 52],
|
964
|
+
53 => ["species", 66], 67 => ["author_word", 71],
|
965
|
+
72 => ["author_word", 78] })
|
966
|
+
expect(value("Arthopyrenia hyalospora X")).
|
967
|
+
to eq "Arthopyrenia hyalospora \303\227 ?"
|
787
968
|
sn = "Arthopyrenia hyalospora x"
|
788
969
|
expect(parse(sn)).to_not be_nil
|
789
970
|
expect(parse(sn).hybrid).to eq true
|
790
971
|
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
791
|
-
expect(details(sn)).to eq [{:
|
792
|
-
|
972
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
973
|
+
species: { string: "hyalospora"} }, "?"]
|
974
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23] })
|
793
975
|
sn = "Arthopyrenia hyalospora × ?"
|
794
976
|
expect(parse(sn)).to_not be_nil
|
795
977
|
expect(parse(sn).hybrid).to eq true
|
796
|
-
expect(details(sn)).to eq [{:
|
797
|
-
|
978
|
+
expect(details(sn)).to eq [{ genus: { string: "Arthopyrenia" },
|
979
|
+
species: { string: "hyalospora"} }, "?"]
|
980
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 12], 13 => ["species", 23] })
|
798
981
|
end
|
799
982
|
|
800
|
-
it
|
983
|
+
it "parses names with taxon concept" do
|
801
984
|
sn = "Stenometope laevissimus sec. Eschmeyer 2004"
|
802
|
-
expect(details(sn)).to eq [{
|
803
|
-
|
985
|
+
expect(details(sn)).to eq [{ genus: { string: "Stenometope" },
|
986
|
+
species: { string: "laevissimus"}, taxon_concept:
|
987
|
+
{ authorship: "Eschmeyer 2004",
|
988
|
+
basionymAuthorTeam: { authorTeam: "Eschmeyer",
|
989
|
+
author: ["Eschmeyer"], year: "2004"} } }]
|
990
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 11], 12 => ["species", 23],
|
991
|
+
29 => ["author_word", 38], 39 => ["year", 43] })
|
804
992
|
sn = "Stenometope laevissimus Bibron 1855 sec. Eschmeyer 2004"
|
805
993
|
expect(parse(sn)).to_not be_nil
|
806
|
-
expect(details(sn)).to eq [{
|
807
|
-
|
994
|
+
expect(details(sn)).to eq [{ genus: { string: "Stenometope" },
|
995
|
+
species: { string: "laevissimus", authorship: "Bibron 1855",
|
996
|
+
basionymAuthorTeam: { authorTeam: "Bibron", author: ["Bibron"],
|
997
|
+
year: "1855"} }, taxon_concept: { authorship: "Eschmeyer 2004",
|
998
|
+
basionymAuthorTeam: { authorTeam: "Eschmeyer",
|
999
|
+
author: ["Eschmeyer"], year: "2004"} } }]
|
1000
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 11], 12 => ["species", 23],
|
1001
|
+
24 => ["author_word", 30], 31 => ["year", 35],
|
1002
|
+
41 => ["author_word", 50], 51 => ["year", 55] })
|
808
1003
|
end
|
809
1004
|
|
810
|
-
it
|
811
|
-
expect(parse(" Asplenium X inexpectatum (E.L. Braun 1940)
|
1005
|
+
it "parses names with spaces inconsistencies" do
|
1006
|
+
expect(parse(" Asplenium X inexpectatum (E.L. Braun 1940) "\
|
1007
|
+
"Morton (1956) ")).to_not be_nil
|
812
1008
|
end
|
813
1009
|
|
814
|
-
it
|
815
|
-
sn = "Trematosphaeria phaeospora (E. Müll.)
|
1010
|
+
it "parses names with any number of spaces" do
|
1011
|
+
sn = "Trematosphaeria phaeospora (E. Müll.)"\
|
1012
|
+
" L. Holm 1957"
|
816
1013
|
expect(parse(sn)).to_not be_nil
|
817
1014
|
expect(value(sn)).to eq "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
|
818
1015
|
expect(canonical(sn)).to eq "Trematosphaeria phaeospora"
|
819
|
-
expect(details(sn)).to eq [{
|
820
|
-
|
1016
|
+
expect(details(sn)).to eq [{ genus: { string: "Trematosphaeria" },
|
1017
|
+
species: { string: "phaeospora", authorship: "(E. Müll.) "\
|
1018
|
+
"L. Holm 1957",
|
1019
|
+
combinationAuthorTeam: { authorTeam: "L. Holm",
|
1020
|
+
author: ["L. Holm"], year: "1957"},
|
1021
|
+
basionymAuthorTeam: { authorTeam: "E. Müll.", author: ["E. Müll."]} } }]
|
1022
|
+
expect(pos(sn)).to eq({ 0 => ["genus", 15], 16 => ["species", 26],
|
1023
|
+
28 => ["author_word", 30], 31 => ["author_word", 36],
|
1024
|
+
46 => ["author_word", 48], 61 => ["author_word", 65],
|
1025
|
+
66 => ["year", 70] })
|
821
1026
|
end
|
822
1027
|
|
823
|
-
it
|
824
|
-
expect(parse("Pseudocercospora dendrobii (H.C. Burnett 1883)
|
1028
|
+
it "does not parse serveral authors groups with several years NOT CORRECT" do
|
1029
|
+
expect(parse("Pseudocercospora dendrobii (H.C. Burnett 1883) "\
|
1030
|
+
"(Leight.) (Movss. 1967) U. Braun & Crous 2003")).to be_nil
|
825
1031
|
end
|
826
1032
|
|
827
1033
|
it "does not parse unallowed utf-8 chars in name part" do
|
@@ -831,47 +1037,90 @@ describe ScientificNameClean do
|
|
831
1037
|
end
|
832
1038
|
|
833
1039
|
it "parses new stuff" do
|
834
|
-
sn =
|
835
|
-
|
836
|
-
expect(
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
expect(
|
844
|
-
sn =
|
845
|
-
expect(details(sn)).to eq [{
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
sn =
|
853
|
-
expect(details(sn)).to eq [{
|
854
|
-
|
855
|
-
|
1040
|
+
sn = "Nesticus quelpartensis Paik & Namkung, in Paik, "\
|
1041
|
+
"Yaginuma & Namkung, 1969"
|
1042
|
+
expect(details(sn)).to eq [{ genus: { string: "Nesticus" },
|
1043
|
+
species: { string: "quelpartensis",
|
1044
|
+
authorship: "Paik & Namkung, in Paik, Yaginuma & Namkung, 1969",
|
1045
|
+
basionymAuthorTeam: { authorTeam: "Paik & Namkung",
|
1046
|
+
author: ["Paik", "Namkung"], exAuthorTeam:
|
1047
|
+
{ authorTeam: "Paik, Yaginuma & Namkung",
|
1048
|
+
author: ["Paik", "Yaginuma", "Namkung"], year: "1969"} } } }]
|
1049
|
+
expect(parse("Dipoena yoshidai Ono, in Ono et al., 1991")).to_not be_nil
|
1050
|
+
sn = "Latrodectus mactans bishopi Kaston, 1938"
|
1051
|
+
expect(details(sn)).to eq [{ genus: { string: "Latrodectus" },
|
1052
|
+
species: { string: "mactans"}, infraspecies: [{ string: "bishopi",
|
1053
|
+
rank: "n/a", authorship: "Kaston, 1938",
|
1054
|
+
basionymAuthorTeam: { authorTeam: "Kaston",
|
1055
|
+
author: ["Kaston"], year: "1938"} }]}]
|
1056
|
+
#have to figure out black lists for this one
|
1057
|
+
sn = "Thiobacillus x Parker and Prisk 1953"
|
1058
|
+
sn = "Bacille de Plaut, Kritchevsky and Séguin 1921"
|
1059
|
+
expect(details(sn)).to eq [{ uninomial: { string: "Bacille",
|
1060
|
+
authorship: "de Plaut, Kritchevsky and Séguin 1921",
|
1061
|
+
basionymAuthorTeam: { authorTeam: "de Plaut, Kritchevsky and Séguin",
|
1062
|
+
author: ["de Plaut", "Kritchevsky", "Séguin"], year: "1921" } } }]
|
1063
|
+
sn = "Araneus van bruysseli Petrunkevitch, 1911"
|
1064
|
+
expect(details(sn)).to eq [{ genus: { string: "Araneus" },
|
1065
|
+
species: { string: "van"}, infraspecies: [{ string: "bruysseli",
|
1066
|
+
rank: "n/a", authorship: "Petrunkevitch, 1911",
|
1067
|
+
basionymAuthorTeam: { authorTeam: "Petrunkevitch",
|
1068
|
+
author: ["Petrunkevitch"], year: "1911"} }]}]
|
1069
|
+
sn = "Sapromyces laidlawi ab Sabin 1941"
|
1070
|
+
expect(details(sn)).to eq [{ genus: { string: "Sapromyces" },
|
1071
|
+
species: { string: "laidlawi", authorship: "ab Sabin 1941",
|
1072
|
+
basionymAuthorTeam: { authorTeam: "ab Sabin", author: ["ab Sabin"],
|
1073
|
+
year: "1941"} } }]
|
1074
|
+
sn = "Nocardia rugosa di Marco and Spalla 1957"
|
1075
|
+
expect(details(sn)).to eq [{ genus: { string: "Nocardia" },
|
1076
|
+
species: { string: "rugosa", authorship: "di Marco and Spalla 1957",
|
1077
|
+
basionymAuthorTeam: { authorTeam: "di Marco and Spalla",
|
1078
|
+
author: ["di Marco", "Spalla"], year: "1957"} } }]
|
1079
|
+
sn = "Flexibacter elegans Lewin 1969 non Soriano 1945"
|
1080
|
+
expect(details(sn)).to eq [{ genus: { string: "Flexibacter" },
|
1081
|
+
species: { string: "elegans", authorship: "Lewin 1969 non Soriano 1945",
|
1082
|
+
basionymAuthorTeam: { authorTeam: "Lewin", author: ["Lewin"],
|
1083
|
+
year: "1969"} } }]
|
1084
|
+
sn = "Flexibacter elegans Soriano 1945, non Lewin 1969"
|
1085
|
+
expect(details(sn)).to eq [{ genus: { string: "Flexibacter" },
|
1086
|
+
species: { string: "elegans", authorship: "Soriano 1945, non Lewin 1969",
|
1087
|
+
basionymAuthorTeam: { authorTeam: "Soriano", author: ["Soriano"],
|
1088
|
+
year: "1945"} } }]
|
1089
|
+
sn = "Schottera nicaeënsis (J.V. Lamouroux ex Duby) Guiry & Hollenberg"
|
1090
|
+
expect(details(sn)).to eq [{ genus: { string: "Schottera" },
|
1091
|
+
species: { string: "nicaeensis",
|
1092
|
+
authorship: "(J.V. Lamouroux ex Duby) Guiry & Hollenberg",
|
1093
|
+
combinationAuthorTeam: { authorTeam: "Guiry & Hollenberg",
|
1094
|
+
author: ["Guiry", "Hollenberg"]}, basionymAuthorTeam:
|
1095
|
+
{ authorTeam: "J.V. Lamouroux", author: ["J.V. Lamouroux"],
|
1096
|
+
exAuthorTeam: { authorTeam: "Duby", author: ["Duby"]} } } }]
|
1097
|
+
sn = "Deschampsia cespitosa ssp pumila"
|
1098
|
+
expect(details(sn)).to eq [{ genus: { string: "Deschampsia" },
|
1099
|
+
species: { string: "cespitosa"},
|
1100
|
+
infraspecies: [{ string: "pumila", rank: "ssp"}]}]
|
856
1101
|
end
|
857
1102
|
|
858
1103
|
# Combination genus names merges without dash or capital letter
|
859
|
-
it
|
860
|
-
|
1104
|
+
it "parses hybrid names with capitalized second name in genus" do
|
1105
|
+
# (botanical code error)
|
1106
|
+
sn = "Anacampti-Platanthera P. Fourn."
|
861
1107
|
expect(parse(sn)).to_not be_nil
|
862
|
-
expect(canonical(sn)).to eq
|
863
|
-
sn =
|
1108
|
+
expect(canonical(sn)).to eq "Anacamptiplatanthera"
|
1109
|
+
sn = "Anacampti-Platanthera vulgaris P. Fourn."
|
864
1110
|
expect(parse(sn)).to_not be_nil
|
865
|
-
expect(canonical(sn)).to eq
|
1111
|
+
expect(canonical(sn)).to eq "Anacamptiplatanthera vulgaris"
|
866
1112
|
end
|
867
1113
|
|
868
|
-
it
|
869
|
-
sn =
|
870
|
-
expect(canonical(sn)).to eq
|
871
|
-
sn =
|
872
|
-
expect(canonical(sn)).to eq
|
1114
|
+
it "parses genus names starting with uppercase letters AE OE" do
|
1115
|
+
sn = "AEmona separata Broun 1921"
|
1116
|
+
expect(canonical(sn)).to eq "Aemona separata"
|
1117
|
+
sn = "OEmona simplex White, 1855"
|
1118
|
+
expect(canonical(sn)).to eq "Oemona simplex"
|
873
1119
|
end
|
874
|
-
|
1120
|
+
|
1121
|
+
|
1122
|
+
#"Arthrosamanea eriorhachis (Harms & sine ref. ) Aubrév."
|
1123
|
+
# -- ignore & sine ref. (means without reference)
|
875
1124
|
|
876
1125
|
=begin
|
877
1126
|
new stuff
|
@@ -881,7 +1130,8 @@ describe ScientificNameClean do
|
|
881
1130
|
sn
|
882
1131
|
Tamiops swinhoei near hainanus|Tamiops swinhoei near hainanus
|
883
1132
|
Conus textile form archiepiscopus|Conus textile form archiepiscopus|
|
884
|
-
Crypticus pseudosericeus ssp. olivieri Desbrochers des
|
1133
|
+
Crypticus pseudosericeus ssp. olivieri Desbrochers des \
|
1134
|
+
Loges,1881|Crypticus pseudosericeus olivieri des
|
885
1135
|
Solanum nigrum subsp nigrum|Solanum nigrum subsp nigrum
|
886
1136
|
Protoglossus taeniatum author unknown|Protoglossus taeniatum author unknown
|
887
1137
|
Dupontiella (S. ?) bicolor|Dupontiella|
|