biodiversity19 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/CHANGELOG +2 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/biodiversity.gemspec +6 -5
- data/lib/biodiversity/parser/scientific_name_canonical.rb +21 -10
- data/lib/biodiversity/parser/scientific_name_clean.rb +911 -623
- data/lib/biodiversity/parser/scientific_name_dirty.rb +82 -54
- data/lib/biodiversity/version.rb +1 -1
- data/spec/biodiversity_spec.rb +8 -4
- data/spec/{parser → files}/test_data.txt +0 -0
- data/spec/{parser → files}/todo.txt +0 -0
- data/spec/guid/lsid.spec.rb +12 -4
- data/spec/parser/scientific_name_canonical_spec.rb +6 -6
- data/spec/parser/scientific_name_clean_spec.rb +589 -373
- data/spec/parser/scientific_name_dirty_spec.rb +126 -70
- data/spec/parser/scientific_name_spec.rb +32 -30
- data/spec/spec_helper.rb +2 -2
- metadata +52 -37
data/lib/biodiversity/version.rb
CHANGED
data/spec/biodiversity_spec.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Biodiversity do
|
4
|
-
|
5
|
-
version
|
6
|
-
|
7
|
-
|
4
|
+
describe '.version' do
|
5
|
+
it 'returns version' do
|
6
|
+
expect(subject.version).to match /^\d+\.\d+\.\d+/
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'is the same as Biodiversity::Version constant' do
|
10
|
+
expect(subject.version).to eq Biodiversity::VERSION
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
File without changes
|
File without changes
|
data/spec/guid/lsid.spec.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe LsidResolver do
|
4
|
-
|
5
|
-
lsid
|
6
|
-
|
7
|
-
|
4
|
+
describe '.resolve' do
|
5
|
+
let(:lsid) { 'urn:lsid:ubio.org:classificationbank:2232671' }
|
6
|
+
|
7
|
+
it 'resolves lsid using tdwg service' do
|
8
|
+
stub_request(:get,
|
9
|
+
%r|#{Biodiversity::LSID_RESOLVER_URL + lsid}|).to_return do
|
10
|
+
{ body: File.read(File.expand_path('../../files/lsid.xml', __FILE__)) }
|
11
|
+
end
|
12
|
+
expect(LsidResolver.resolve lsid).
|
13
|
+
to match %r|<dc:title>Pternistis Wagler 1832</dc:title>|
|
14
|
+
end
|
8
15
|
end
|
16
|
+
|
9
17
|
end
|
@@ -6,7 +6,7 @@ describe ScientificNameCanonical 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
11
|
['Morea ssjjlajajaj324$33 234243242','Morea',
|
12
12
|
[{:uninomial=>{:string=>"Morea"}}], {0=>["uninomial", 5]}],
|
@@ -26,11 +26,11 @@ describe ScientificNameCanonical do
|
|
26
26
|
[{:genus=>{:string=>"Verpericola"}, :species=>{:string=>"megasoma"}}],
|
27
27
|
{0=>["genus", 11], 12=>["species", 20]}]
|
28
28
|
].each do |n|
|
29
|
-
parse(n[0]).
|
30
|
-
value(n[0]).
|
31
|
-
details(n[0]).
|
32
|
-
pos(n[0]).
|
33
|
-
parse(n[0]).hybrid.
|
29
|
+
expect(parse(n[0])).not_to be_nil
|
30
|
+
expect(value(n[0])).to eq n[1]
|
31
|
+
expect(details(n[0])).to eq n[2]
|
32
|
+
expect(pos(n[0])).to eq n[3]
|
33
|
+
expect(parse(n[0]).hybrid).to be false
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -7,41 +7,41 @@ describe ScientificNameClean do
|
|
7
7
|
set_parser(ScientificNameCleanParser.new)
|
8
8
|
end
|
9
9
|
|
10
|
-
it '
|
10
|
+
it 'parses uninomial' do
|
11
11
|
sn = 'Pseudocercospora'
|
12
|
-
parse(sn).
|
13
|
-
value(sn).
|
14
|
-
canonical(sn).
|
15
|
-
details(sn).
|
16
|
-
pos(sn).
|
17
|
-
end
|
18
|
-
|
19
|
-
it '
|
12
|
+
expect(parse(sn)).to_not be_nil
|
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
|
+
end
|
18
|
+
|
19
|
+
it 'parses uninomial with author and year' do
|
20
20
|
sn = 'Pseudocercospora Speg.'
|
21
|
-
parse(sn).
|
22
|
-
details(sn).
|
21
|
+
expect(parse(sn)).to_not be_nil
|
22
|
+
expect(details(sn)).to eq [{:uninomial=>
|
23
23
|
{:string=>"Pseudocercospora",
|
24
24
|
:authorship=>"Speg.",
|
25
25
|
:basionymAuthorTeam=>
|
26
26
|
{:authorTeam=>"Speg.", :author=>["Speg."]}}}]
|
27
|
-
pos(sn).
|
27
|
+
expect(pos(sn)).to eq({0=>["uninomial", 16], 17=>["author_word", 22]})
|
28
28
|
sn = 'Pseudocercospora Spegazzini, 1910'
|
29
|
-
parse(sn).
|
30
|
-
value(sn).
|
31
|
-
details(sn).
|
29
|
+
expect(parse(sn)).to_not be_nil
|
30
|
+
expect(value(sn)).to eq 'Pseudocercospora Spegazzini 1910'
|
31
|
+
expect(details(sn)).to eq [{:uninomial=>
|
32
32
|
{:string=>"Pseudocercospora",
|
33
33
|
:authorship=>"Spegazzini, 1910",
|
34
34
|
:basionymAuthorTeam=>
|
35
35
|
{:authorTeam=>"Spegazzini",
|
36
36
|
:author=>["Spegazzini"], :year=>"1910"}}}]
|
37
|
-
pos(sn).
|
38
|
-
17=>["author_word", 27], 29=>["year", 33]}
|
37
|
+
expect(pos(sn)).to eq({0=>["uninomial", 16],
|
38
|
+
17=>["author_word", 27], 29=>["year", 33]})
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "parses uninomials with uninomial ranks" do
|
42
42
|
sn = "Epacridaceae trib. Archerieae Crayn & Quinn"
|
43
|
-
parse(sn).
|
44
|
-
details(sn).
|
43
|
+
expect(parse(sn)).to_not be_nil
|
44
|
+
expect(details(sn)).to eq [{:uninomial=>
|
45
45
|
{:string=>"Epacridaceae"},
|
46
46
|
:rank_uninomials=>"trib.",
|
47
47
|
:uninomial2=>{:string=>"Archerieae",
|
@@ -51,7 +51,7 @@ describe ScientificNameClean do
|
|
51
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",
|
@@ -71,104 +71,191 @@ describe ScientificNameClean do
|
|
71
71
|
"Qu Durkoop",
|
72
72
|
"As Slipinski 1982",
|
73
73
|
"Ba Solem 1983"].each do |name|
|
74
|
-
parse(name).
|
74
|
+
expect(parse(name)).to_not be_nil
|
75
75
|
end
|
76
|
-
canonical('Quoyula').
|
76
|
+
expect(canonical('Quoyula')).to eq 'Quoyula'
|
77
77
|
end
|
78
78
|
|
79
|
-
it '
|
79
|
+
it 'parses canonical' do
|
80
80
|
sn = 'Pseudocercospora dendrobii'
|
81
|
-
parse(sn).
|
82
|
-
value(sn).
|
83
|
-
canonical(sn).
|
84
|
-
details(sn).
|
81
|
+
expect(parse(sn)).to_not be_nil
|
82
|
+
expect(value(sn)).to eq 'Pseudocercospora dendrobii'
|
83
|
+
expect(canonical(sn)).to eq 'Pseudocercospora dendrobii'
|
84
|
+
expect(details(sn)).to eq [{:genus=>
|
85
85
|
{:string=>"Pseudocercospora"},
|
86
86
|
:species=>{:string=>"dendrobii"}}]
|
87
|
-
pos(sn).
|
87
|
+
expect(pos(sn)).to eq({0=>["genus", 16], 21=>["species", 30]})
|
88
88
|
end
|
89
89
|
|
90
|
-
it '
|
90
|
+
it 'parses abbreviated canonical' do
|
91
91
|
sn = 'P. dendrobii'
|
92
|
-
parse(sn).
|
93
|
-
value(sn).
|
92
|
+
expect(parse(sn)).to_not be_nil
|
93
|
+
expect(value(sn)).to eq 'P. dendrobii'
|
94
94
|
sn = 'Ps. dendrobii'
|
95
|
-
parse(sn).
|
96
|
-
value(sn).
|
97
|
-
details(sn).
|
95
|
+
expect(parse(sn)).to_not be_nil
|
96
|
+
expect(value(sn)).to eq 'Ps. dendrobii'
|
97
|
+
expect(details(sn)).to eq [{:genus=>
|
98
98
|
{:string=>"Ps."},
|
99
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
|
-
parse(sn).
|
106
|
-
value(sn).
|
105
|
+
expect(parse(sn)).to_not be_nil
|
106
|
+
expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
|
107
107
|
sn = "Platypus bicaudatulus Schedl, 1935h"
|
108
|
-
parse(sn).
|
109
|
-
value(sn).
|
110
|
-
details(sn).
|
108
|
+
expect(parse(sn)).to_not be_nil
|
109
|
+
expect(value(sn)).to eq "Platypus bicaudatulus Schedl 1935"
|
110
|
+
expect(details(sn)).to eq [{:genus=>
|
111
111
|
{:string=>"Platypus"},
|
112
112
|
:species=>{:string=>"bicaudatulus",
|
113
113
|
:authorship=>"Schedl, 1935h",
|
114
114
|
:basionymAuthorTeam=>
|
115
115
|
{:authorTeam=>"Schedl", :author=>["Schedl"],
|
116
116
|
:year=>"1935"}}}]
|
117
|
-
pos(sn).
|
117
|
+
expect(pos(sn)).to eq({0=>["genus", 8],
|
118
118
|
9=>["species", 21], 22=>["author_word", 28],
|
119
|
-
30=>["year", 35]}
|
120
|
-
parse("Platypus bicaudatulus Schedl, 1935B").
|
119
|
+
30=>["year", 35]})
|
120
|
+
expect(parse("Platypus bicaudatulus Schedl, 1935B")).to_not be_nil
|
121
121
|
sn = "Platypus bicaudatulus Schedl (1935h)"
|
122
|
-
parse(sn).
|
123
|
-
details(sn).
|
124
|
-
|
122
|
+
expect(parse(sn)).to_not be_nil
|
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
|
+
expect(parse("Platypus bicaudatulus Schedl 1935")).to_not be_nil
|
125
128
|
end
|
126
129
|
|
127
|
-
it '
|
130
|
+
it 'parses species name with abbreviated genus, author and year' do
|
128
131
|
sn = "P. bicaudatulus Schedl 1935"
|
129
|
-
parse(sn).
|
130
|
-
value(sn).
|
132
|
+
expect(parse(sn)).to_not be_nil
|
133
|
+
expect(value(sn)).to eq "P. bicaudatulus Schedl 1935"
|
131
134
|
sn = "Pl. bicaudatulus Schedl, 1935h"
|
132
|
-
parse(sn).
|
133
|
-
value(sn).
|
134
|
-
details(sn).
|
135
|
+
expect(parse(sn)).not_to be_nil
|
136
|
+
expect(value(sn)).to eq "Pl. bicaudatulus Schedl 1935"
|
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"}}}]
|
135
141
|
sn = "Pla. bicaudatulus Schedl, 1935h"
|
136
|
-
parse(sn).
|
137
|
-
value(sn).
|
142
|
+
expect(parse(sn)).to_not be_nil
|
143
|
+
expect(value(sn)).to eq "Pla. bicaudatulus Schedl 1935"
|
138
144
|
end
|
139
145
|
|
140
|
-
it "
|
146
|
+
it "parses species name with author's postfix f., filius (son of)" do
|
141
147
|
names = [
|
142
|
-
[ "Platypus bicaudatulus Schedl f. 1935", [{:genus=>{:string=>"Platypus"},
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
[
|
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
|
+
"Cerastium arvense ssp. velutinum var. velutinum (Raf.) Britton f."],
|
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
|
+
"Amelanchier arborea f. hirsuta (Michx. f.) Fernald"],
|
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
|
+
"Betula pendula fo. dalecarlica (L. f.) C.K. Schneid."],
|
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
|
+
"Racomitrium canescens f. ericoides (F. Weber ex Brid.) Mönk."],
|
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
|
+
"Racomitrium canescens forma ericoides (F. Weber ex Brid.) Mönk."],
|
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
|
+
"Peristernia nassatula forskali Tapparone-Canefri 1875"],
|
155
241
|
]
|
156
242
|
names.each do |sn, sn_details, sn_value|
|
157
|
-
parse(sn).
|
158
|
-
details(sn).
|
159
|
-
value(sn).
|
243
|
+
expect(parse(sn)).to_not be_nil
|
244
|
+
expect(details(sn)).to eq sn_details
|
245
|
+
expect(value(sn)).to eq sn_value
|
160
246
|
end
|
161
247
|
end
|
162
248
|
|
163
|
-
it '
|
249
|
+
it 'parses genus with "?"' do
|
164
250
|
sn = "Ferganoconcha? oblonga"
|
165
|
-
parse(sn).
|
166
|
-
value(sn).
|
167
|
-
details(sn).
|
168
|
-
|
251
|
+
expect(parse(sn)).to_not be_nil
|
252
|
+
expect(value(sn)).to eq "Ferganoconcha oblonga"
|
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]})
|
169
256
|
end
|
170
257
|
|
171
|
-
it '
|
258
|
+
it 'parses æ in the name' do
|
172
259
|
names = [
|
173
260
|
["Læptura laetifica Dow, 1913", "Laeptura laetifica Dow 1913"],
|
174
261
|
["Leptura lætifica Dow, 1913", "Leptura laetifica Dow 1913"],
|
@@ -182,345 +269,474 @@ describe ScientificNameClean do
|
|
182
269
|
['Cerambyx thomæ Gmelin J. F., 1790', 'Cerambyx thomae Gmelin J. F. 1790']
|
183
270
|
]
|
184
271
|
names.each do |name_pair|
|
185
|
-
parse(name_pair[0]).
|
186
|
-
value(name_pair[0]).
|
272
|
+
expect(parse(name_pair[0])).to_not be_nil
|
273
|
+
expect(value(name_pair[0])).to eq name_pair[1]
|
187
274
|
end
|
188
275
|
end
|
189
276
|
|
190
|
-
it '
|
277
|
+
it 'parses names with e-umlaut' do
|
191
278
|
sn = 'Kalanchoë tuberosa'
|
192
|
-
canonical(sn).
|
279
|
+
expect(canonical(sn)).to eq 'Kalanchoe tuberosa'
|
193
280
|
sn = 'Isoëtes asplundii H. P. Fuchs'
|
194
|
-
canonical(sn).
|
281
|
+
expect(canonical(sn)).to eq 'Isoetes asplundii'
|
195
282
|
end
|
196
283
|
|
197
|
-
it '
|
284
|
+
it 'parses infragenus (ICZN code)' do
|
198
285
|
sn = "Hegeter (Hegeter) intercedens Lindberg H 1950"
|
199
|
-
parse(sn).
|
200
|
-
value(sn).
|
201
|
-
canonical(sn).
|
202
|
-
details(sn).
|
203
|
-
|
286
|
+
expect(parse(sn)).to_not be_nil
|
287
|
+
expect(value(sn)).to eq "Hegeter (Hegeter) intercedens Lindberg H 1950"
|
288
|
+
expect(canonical(sn)).to eq "Hegeter intercedens"
|
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]})
|
204
297
|
sn = "Ixodes (Ixodes) hexagonus hexagonus Neumann, 1911"
|
205
|
-
canonical(sn).
|
298
|
+
expect(canonical(sn)).to eq "Ixodes hexagonus hexagonus"
|
206
299
|
sn = "Brachytrypus (B.) grandidieri"
|
207
|
-
canonical(sn).
|
208
|
-
details(sn).
|
300
|
+
expect(canonical(sn)).to eq "Brachytrypus grandidieri"
|
301
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Brachytrypus"},
|
302
|
+
:infragenus=>{:string=>"B."}, :species=>{:string=>"grandidieri"}}]
|
209
303
|
sn = "Empis (Argyrandrus) Bezzi 1909"
|
210
|
-
details(sn).
|
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"}}}]
|
211
308
|
sn = "Platydoris (Bergh )"
|
212
|
-
details(sn).
|
213
|
-
|
309
|
+
expect(details(sn)).to eq [{:uninomial=>{:string=>"Platydoris",
|
310
|
+
:infragenus=>{:string=>"Bergh"}}}]
|
311
|
+
expect(value(sn)).to eq "Platydoris (Bergh)"
|
214
312
|
sn = "Platydoris (B.)"
|
215
|
-
details(sn).
|
313
|
+
expect(details(sn)).to eq [{:uninomial=>{:string=>"Platydoris",
|
314
|
+
:infragenus=>{:string=>"B."}}}]
|
216
315
|
end
|
217
316
|
|
218
|
-
it '
|
317
|
+
it 'parses several authors without a year' do
|
219
318
|
sn = "Pseudocercospora dendrobii U. Braun & Crous"
|
220
|
-
parse(sn).
|
221
|
-
value(sn).
|
222
|
-
canonical(sn).
|
223
|
-
details(sn).
|
224
|
-
|
319
|
+
expect(parse(sn)).to_not be be_nil
|
320
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
|
321
|
+
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
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]})
|
225
329
|
sn = "Pseudocercospora dendrobii U. Braun and Crous"
|
226
|
-
parse(sn).
|
227
|
-
value(sn).
|
228
|
-
pos(sn).
|
330
|
+
expect(parse(sn)).to_not be_nil
|
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]})
|
229
335
|
sn = "Pseudocercospora dendrobii U. Braun et Crous"
|
230
|
-
parse(sn).
|
231
|
-
value(sn).
|
336
|
+
expect(parse(sn)).to_not be_nil
|
337
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous"
|
232
338
|
sn = "Arthopyrenia hyalospora(Nyl.)R.C. Harris"
|
233
|
-
parse(sn).
|
234
|
-
value(sn).
|
235
|
-
canonical(sn).
|
236
|
-
details(sn).
|
339
|
+
expect(parse(sn)).to_not be_nil
|
340
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) R.C. Harris"
|
341
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
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."]}}}]
|
237
347
|
end
|
238
348
|
|
239
|
-
it '
|
349
|
+
it 'parses several authors with a year' do
|
240
350
|
sn = "Pseudocercospora dendrobii U. Braun & Crous 2003"
|
241
|
-
parse(sn).
|
242
|
-
value(sn).
|
243
|
-
canonical(sn).
|
244
|
-
details(sn).
|
245
|
-
|
351
|
+
expect(parse(sn)).to_not be_nil
|
352
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii U. Braun & Crous 2003"
|
353
|
+
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
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]})
|
246
361
|
sn = "Pseudocercospora dendrobii Crous, 2003"
|
247
|
-
parse(sn).
|
362
|
+
expect(parse(sn)).to_not be_nil
|
248
363
|
end
|
249
364
|
|
250
|
-
it '
|
365
|
+
it 'parses basionym authors in parenthesis' do
|
251
366
|
sn = "Zophosis persis (Chatanay, 1914)"
|
252
|
-
parse(sn).
|
253
|
-
details(sn).
|
367
|
+
expect(parse(sn)).to_not be_nil
|
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"}}}]
|
254
372
|
sn = "Zophosis persis (Chatanay 1914)"
|
255
|
-
parse(sn).
|
256
|
-
details(sn).
|
373
|
+
expect(parse(sn)).to_not be_nil
|
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"}}}]
|
257
378
|
sn = "Zophosis persis (Chatanay), 1914"
|
258
|
-
parse(sn).
|
259
|
-
value(sn).
|
260
|
-
details(sn).
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
379
|
+
expect(parse(sn)).to_not be_nil
|
380
|
+
expect(value(sn)).to eq "Zophosis persis (Chatanay 1914)"
|
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
|
+
expect(parse("Zophosis persis (Chatanay) 1914")).to_not be_nil
|
388
|
+
#parse("Zophosis persis Chatanay (1914)")).to_not be_nil
|
389
|
+
end
|
390
|
+
|
391
|
+
it "parses name with identificaation annotation -- aff cf sp spp" do
|
267
392
|
sn = 'Diplocephalus aff. procerus Thaler, 1972'
|
268
|
-
details(sn).
|
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"}}}}]
|
269
398
|
sn = 'Diplocephalus aff procerus Thaler, 1972'
|
270
|
-
details(sn).
|
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"}}}}]
|
271
404
|
sn = 'Diplocephalus affprocerus Thaler, 1972'
|
272
|
-
details(sn).
|
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"}}}]
|
273
409
|
sn = 'Diplocephalus cf. procerus Thaler, 1972'
|
274
|
-
details(sn).
|
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"}}}}]
|
275
415
|
sn = 'Diplocephalus cf procerus Thaler, 1972'
|
276
|
-
details(sn).
|
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"}}}}]
|
277
421
|
sn = 'Sphingomonas sp. 37'
|
278
|
-
details(sn).
|
422
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Sphingomonas"},
|
423
|
+
:annotation_identification=>"sp.", :ignored=>{:unparsed=>"37"}}]
|
279
424
|
sn = "Thryothorus leucotis spp. bogotensis"
|
280
|
-
details(sn).
|
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"}}}]}]
|
281
429
|
end
|
282
430
|
|
283
|
-
it '
|
431
|
+
it 'parses scientific name' do
|
284
432
|
sn = "Pseudocercospora dendrobii(H.C. Burnett)U. Braun & Crous 2003"
|
285
|
-
parse(sn).
|
286
|
-
value(sn).
|
287
|
-
|
288
|
-
|
289
|
-
sn
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
433
|
+
expect(parse(sn)).to_not be_nil
|
434
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett) "\
|
435
|
+
"U. Braun & Crous 2003"
|
436
|
+
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
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
|
+
sn = "Pseudocercospora dendrobii(H.C. Burnett,1873)"\
|
445
|
+
"U. Braun & Crous 2003"
|
446
|
+
expect(parse(sn)).to_not be_nil
|
447
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1873) "\
|
448
|
+
"U. Braun & Crous 2003"
|
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
|
+
end
|
457
|
+
|
458
|
+
it 'parses several authors with several years' do
|
296
459
|
sn = "Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003"
|
297
|
-
parse(sn).
|
298
|
-
value(sn).
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
460
|
+
expect(parse(sn)).to_not be_nil
|
461
|
+
expect(value(sn)).to eq "Pseudocercospora dendrobii (H.C. Burnett 1883) "\
|
462
|
+
"U. Braun & Crous 2003"
|
463
|
+
expect(canonical(sn)).to eq "Pseudocercospora dendrobii"
|
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], 64=>["year", 68]})
|
475
|
+
end
|
476
|
+
|
477
|
+
it "parses name with subspecies without rank Zoological Code" do
|
305
478
|
sn = "Hydnellum scrobiculatum zonatum (Banker) D. Hall & D.E. Stuntz 1972"
|
306
|
-
parse(sn).
|
307
|
-
value(sn).
|
308
|
-
|
309
|
-
|
310
|
-
|
479
|
+
expect(parse(sn)).to_not be_nil
|
480
|
+
expect(value(sn)).to eq "Hydnellum scrobiculatum zonatum (Banker) "\
|
481
|
+
"D. Hall & D.E. Stuntz 1972"
|
482
|
+
expect(canonical(sn)).to eq "Hydnellum scrobiculatum zonatum"
|
483
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Hydnellum"},
|
484
|
+
:species=>{:string=>"scrobiculatum"},
|
485
|
+
:infraspecies=>[{:string=>"zonatum", :rank=>"n/a",
|
486
|
+
:authorship=>"(Banker) D. Hall & D.E. Stuntz 1972",
|
487
|
+
:combinationAuthorTeam=>{:authorTeam=>"D. Hall & D.E. Stuntz",
|
488
|
+
:author=>["D. Hall", "D.E. Stuntz"], :year=>"1972"},
|
489
|
+
:basionymAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}]}]
|
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], 63=>["year", 67]})
|
311
494
|
sn = "Begonia pingbienensis angustior"
|
312
|
-
parse(sn).
|
313
|
-
details(sn).
|
314
|
-
|
495
|
+
expect(parse(sn)).to_not be_nil
|
496
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Begonia"},
|
497
|
+
:species=>{:string=>"pingbienensis"},
|
498
|
+
:infraspecies=>[{:string=>"angustior", :rank=>"n/a"}]}]
|
499
|
+
expect(pos(sn)).to eq({0=>["genus", 7],
|
500
|
+
8=>["species", 21], 22=>["infraspecies", 31]})
|
315
501
|
end
|
316
502
|
|
317
|
-
it '
|
503
|
+
it 'parses infraspecies with rank' do
|
318
504
|
sn = "Aus bus Linn. var. bus"
|
319
|
-
parse(sn).
|
320
|
-
details(sn).
|
505
|
+
expect(parse(sn)).to_not be_nil
|
506
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Aus"},
|
507
|
+
:species=>{:string=>"bus", :authorship=>"Linn.",
|
508
|
+
:basionymAuthorTeam=>{:authorTeam=>"Linn.",
|
509
|
+
:author=>["Linn."]}}, :infraspecies=>[{:string=>"bus", :rank=>"var."}]}]
|
321
510
|
sn = "Agalinis purpurea (L.) Briton var. borealis (Berg.) Peterson 1987"
|
322
|
-
parse(sn).
|
323
|
-
details(sn).
|
324
|
-
|
511
|
+
expect(parse(sn)).to_not be_nil
|
512
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Agalinis"},
|
513
|
+
:species=>{:string=>"purpurea", :authorship=>"(L.) Briton",
|
514
|
+
:combinationAuthorTeam=>{:authorTeam=>"Briton", :author=>["Briton"]},
|
515
|
+
:basionymAuthorTeam=>{:authorTeam=>"L.",
|
516
|
+
:author=>["L."]}}, :infraspecies=>[{:string=>"borealis",
|
517
|
+
:rank=>"var.", :authorship=>"(Berg.) Peterson 1987",
|
518
|
+
:combinationAuthorTeam=>{:authorTeam=>"Peterson",
|
519
|
+
:author=>["Peterson"], :year=>"1987"},
|
520
|
+
:basionymAuthorTeam=>{:authorTeam=>"Berg.", :author=>["Berg."]}}]}]
|
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], 61=>["year", 65]})
|
325
525
|
sn = "Phaeographis inusta var. macularis(Leight.) A.L. Sm. 1861"
|
326
|
-
parse(sn).
|
327
|
-
value(sn).
|
328
|
-
|
329
|
-
|
526
|
+
expect(parse(sn)).to_not be_nil
|
527
|
+
expect(value(sn)).to eq "Phaeographis inusta var. macularis (Leight.) "\
|
528
|
+
"A.L. Sm. 1861"
|
529
|
+
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]})
|
330
534
|
sn = "Cassytha peninsularis J. Z. Weber var. flindersii"
|
331
|
-
canonical(sn).
|
535
|
+
expect(canonical(sn)).to eq "Cassytha peninsularis flindersii"
|
332
536
|
sn = "Prunus armeniaca convar. budae (Pénzes) Soó"
|
333
537
|
|
334
|
-
canonical(sn).
|
538
|
+
expect(canonical(sn)).to eq "Prunus armeniaca budae"
|
335
539
|
sn = "Polypodium pectinatum L. f. typica Rosenst."
|
336
|
-
canonical(sn).
|
540
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum typica"
|
337
541
|
# might get confused with forma vs filius
|
338
542
|
sn = "Polypodium pectinatum L.f. typica Rosenst."
|
339
|
-
canonical(sn).
|
543
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum typica"
|
340
544
|
sn = "Polypodium pectinatum (L.) f. typica Rosenst."
|
341
|
-
canonical(sn).
|
545
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum typica"
|
342
546
|
sn = "Polypodium pectinatum L. f., Rosenst."
|
343
|
-
canonical(sn).
|
547
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum"
|
344
548
|
sn = "Polypodium pectinatum L. f."
|
345
|
-
canonical(sn).
|
549
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum"
|
346
550
|
sn = "Polypodium pectinatum (L. f.) typica Rosent."
|
347
|
-
canonical(sn).
|
551
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum typica"
|
348
552
|
sn = "Polypodium pectinatum L. f. thisisjunk Rosent."
|
349
|
-
canonical(sn).
|
553
|
+
expect(canonical(sn)).to eq "Polypodium pectinatum thisisjunk"
|
350
554
|
end
|
351
555
|
|
352
|
-
it '
|
556
|
+
it 'parsex unknown original authors (auct.)/(hort.)/(?)' do
|
353
557
|
sn = "Tragacantha leporina (?) Kuntze"
|
354
|
-
parse(sn).
|
355
|
-
value(sn).
|
356
|
-
details(sn).
|
558
|
+
expect(parse(sn)).to_not be_nil
|
559
|
+
expect(value(sn)).to eq "Tragacantha leporina (?) Kuntze"
|
560
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Tragacantha"},
|
561
|
+
:species=>{:string=>"leporina", :authorship=>"(?) Kuntze",
|
562
|
+
:combinationAuthorTeam=>{:authorTeam=>"Kuntze", :author=>["Kuntze"]},
|
563
|
+
:basionymAuthorTeam=>{:authorTeam=>"(?)", :author=>["?"]}}}]
|
357
564
|
sn = "Lachenalia tricolor var. nelsonii (auct.) Baker"
|
358
|
-
parse(sn).
|
359
|
-
value(sn).
|
360
|
-
details(sn).
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
565
|
+
expect(parse(sn)).to_not be_nil
|
566
|
+
expect(value(sn)).to eq "Lachenalia tricolor var. nelsonii (auct.) Baker"
|
567
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Lachenalia"},
|
568
|
+
:species=>{:string=>"tricolor"}, :infraspecies=>[{:string=>"nelsonii",
|
569
|
+
:rank=>"var.", :authorship=>"(auct.) Baker",
|
570
|
+
:combinationAuthorTeam=>{:authorTeam=>"Baker",
|
571
|
+
:author=>["Baker"]}, :basionymAuthorTeam=>
|
572
|
+
{:authorTeam=>"auct.", :author=>["unknown"]}}]}]
|
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 'parses unknown authors auct./anon./hort./ht.' do
|
365
579
|
sn = "Puya acris ht."
|
366
|
-
parse(sn).
|
367
|
-
pos(sn).
|
580
|
+
expect(parse(sn)).to_not be_nil
|
581
|
+
expect(pos(sn)).to eq({0=>["genus", 4], 5=>["species", 10],
|
582
|
+
11=>["unknown_author", 14]})
|
368
583
|
end
|
369
584
|
|
370
|
-
it '
|
585
|
+
it 'parses normal names with hort or anon in them' do
|
371
586
|
sn = "Mus musculus hortulanus"
|
372
|
-
|
373
|
-
pos(sn).
|
587
|
+
expect(parse(sn)).to_not be_nil
|
588
|
+
expect(pos(sn)).to eq({0=>["genus", 3], 4=>["species", 12],
|
589
|
+
13=>["infraspecies", 23]})
|
374
590
|
end
|
375
591
|
|
376
|
-
it '
|
592
|
+
it 'parses real world examples' do
|
377
593
|
sn = "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
|
378
|
-
parse(sn).
|
379
|
-
value(sn).
|
380
|
-
details(sn).
|
381
|
-
pos(sn).
|
382
|
-
parse("Cladoniicola staurospora Diederich, van den Boom & Aptroot 2001").
|
594
|
+
expect(parse(sn)).to_not be_nil
|
595
|
+
expect(value(sn)).to eq "Stagonospora polyspora M.T. Lucas & Sousa da Câmara 1934"
|
596
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Stagonospora"}, :species=>{:string=>"polyspora", :authorship=>"M.T. Lucas & Sousa da Câmara 1934", :basionymAuthorTeam=>{:authorTeam=>"M.T. Lucas & Sousa da Câmara", :author=>["M.T. Lucas", "Sousa da Câmara"], :year=>"1934"}}}]
|
597
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 22], 23=>["author_word", 27], 28=>["author_word", 33], 36=>["author_word", 41], 42=>["author_word", 44], 45=>["author_word", 51], 52=>["year", 56]})
|
598
|
+
expect(parse("Cladoniicola staurospora Diederich, van den Boom & Aptroot 2001")).to_not be_nil
|
383
599
|
sn = "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
|
384
|
-
parse(sn).
|
385
|
-
value(sn).
|
386
|
-
pos(sn).
|
387
|
-
parse("Physalospora rubiginosa (Fr.) anon.").
|
388
|
-
parse("Pleurotus ëous (Berk.) Sacc. 1887").
|
389
|
-
parse("Lecanora wetmorei Śliwa 2004").
|
600
|
+
expect(parse(sn)).to_not be_nil
|
601
|
+
expect(value(sn)).to eq "Yarrowia lipolytica var. lipolytica (Wick., Kurtzman & E.A. Herrm.) Van der Walt & Arx 1981"
|
602
|
+
expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 19], 20=>["infraspecific_type", 24], 25=>["infraspecies", 35], 37=>["author_word", 42], 44=>["author_word", 52], 55=>["author_word", 59], 60=>["author_word", 66], 68=>["author_word", 71], 72=>["author_word", 75], 76=>["author_word", 80], 83=>["author_word", 86], 87=>["year", 91]})
|
603
|
+
expect(parse("Physalospora rubiginosa (Fr.) anon.")).to_not be_nil
|
604
|
+
expect(parse("Pleurotus ëous (Berk.) Sacc. 1887")).to_not be_nil
|
605
|
+
expect(parse("Lecanora wetmorei Śliwa 2004")).to_not be_nil
|
390
606
|
# valid
|
391
607
|
# infraspecific
|
392
|
-
parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797").
|
393
|
-
parse("Exobasidium vaccinii ** andromedae (P. Karst.) P. Karst. 1882").
|
394
|
-
parse("Urceolaria scruposa **** clausa Flot. 1849").
|
395
|
-
parse("Cortinarius angulatus B gracilescens Fr. 1838").
|
396
|
-
parse("Cyathicula scelobelonium").
|
608
|
+
expect(parse("Calicium furfuraceum * furfuraceum (L.) Pers. 1797")).to_not be_nil
|
609
|
+
expect(parse("Exobasidium vaccinii ** andromedae (P. Karst.) P. Karst. 1882")).to_not be_nil
|
610
|
+
expect(parse("Urceolaria scruposa **** clausa Flot. 1849")).to_not be_nil
|
611
|
+
expect(parse("Cortinarius angulatus B gracilescens Fr. 1838")).to_not be_nil
|
612
|
+
expect(parse("Cyathicula scelobelonium")).to_not be_nil
|
397
613
|
# single quote that did not show
|
398
614
|
# parse("Phytophthora hedraiandra De Cock & Man in ?t Veld 2004"
|
399
615
|
# Phthora vastatrix d?Hérelle 1909
|
400
616
|
# author is exception
|
401
617
|
sn = "Tuber liui A S. Xu 1999"
|
402
|
-
parse(sn).
|
403
|
-
details(sn).
|
404
|
-
parse('Xylaria potentillae A S. Xu').
|
405
|
-
parse("Agaricus squamula Berk. & M.A. Curtis 1860").
|
406
|
-
parse("Peltula coriacea Büdel, Henssen & Wessels 1986").
|
618
|
+
expect(parse(sn)).to_not be_nil
|
619
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Tuber"}, :species=>{:string=>"liui", :authorship=>"A S. Xu 1999", :basionymAuthorTeam=>{:authorTeam=>"A S. Xu", :author=>["A S. Xu"], :year=>"1999"}}}]
|
620
|
+
expect(parse('Xylaria potentillae A S. Xu')).to_not be_nil
|
621
|
+
expect(parse("Agaricus squamula Berk. & M.A. Curtis 1860")).to_not be_nil
|
622
|
+
expect(parse("Peltula coriacea Büdel, Henssen & Wessels 1986")).to_not be_nil
|
407
623
|
#had to add no dot rule for trinomials without a rank to make it to work
|
408
624
|
sn = "Saccharomyces drosophilae anon."
|
409
|
-
parse(sn).
|
410
|
-
details(sn).
|
411
|
-
pos(sn).
|
625
|
+
expect(parse(sn)).to_not be_nil
|
626
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Saccharomyces"}, :species=>{:string=>"drosophilae", :authorship=>"anon.", :basionymAuthorTeam=>{:authorTeam=>"anon.", :author=>["unknown"]}}}]
|
627
|
+
expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 25], 26=>["unknown_author", 31]})
|
412
628
|
sn = "Abacetus laevicollis de Chaudoir, 1869"
|
413
|
-
parse(sn).
|
414
|
-
canonical(sn).
|
629
|
+
expect(parse(sn)).to_not be_nil
|
630
|
+
expect(canonical(sn)).to eq 'Abacetus laevicollis'
|
415
631
|
sn = "Gastrosericus eremorum van Beaumont 1955"
|
416
|
-
canonical(sn).
|
632
|
+
expect(canonical(sn)).to eq 'Gastrosericus eremorum'
|
417
633
|
sn = "Gastrosericus eremorum von Beaumont 1955"
|
418
|
-
canonical(sn).
|
634
|
+
expect(canonical(sn)).to eq 'Gastrosericus eremorum'
|
419
635
|
sn = "Cypraeovula (Luponia) amphithales perdentata"
|
420
|
-
canonical(sn).
|
421
|
-
details(sn).
|
636
|
+
expect(canonical(sn)).to eq 'Cypraeovula amphithales perdentata'
|
637
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Cypraeovula"}, :infragenus=>{:string=>"Luponia"}, :species=>{:string=>"amphithales"}, :infraspecies=>[{:string=>"perdentata", :rank=>"n/a"}]}]
|
422
638
|
sn = "Polyrhachis orsyllus nat musculus Forel 1901"
|
423
|
-
canonical(sn).
|
639
|
+
expect(canonical(sn)).to eq "Polyrhachis orsyllus musculus"
|
424
640
|
sn = 'Latrodectus 13-guttatus Thorell, 1875'
|
425
|
-
canonical(sn).
|
426
|
-
value(sn).
|
641
|
+
expect(canonical(sn)).to eq 'Latrodectus tredecguttatus'
|
642
|
+
expect(value(sn)).to eq 'Latrodectus tredecguttatus Thorell 1875'
|
427
643
|
sn = 'Latrodectus 3-guttatus Thorell, 1875'
|
428
|
-
canonical(sn).
|
429
|
-
value(sn).
|
644
|
+
expect(canonical(sn)).to eq 'Latrodectus triguttatus'
|
645
|
+
expect(value(sn)).to eq 'Latrodectus triguttatus Thorell 1875'
|
430
646
|
sn = 'Balaninus c-album Schönherr, CJ., 1836'
|
431
|
-
canonical(sn).
|
647
|
+
expect(canonical(sn)).to eq 'Balaninus c-album'
|
432
648
|
end
|
433
649
|
|
434
|
-
it "
|
650
|
+
it "parses name with morph." do
|
435
651
|
sn = "Callideriphus flavicollis morph. reductus Fuchs 1961"
|
436
|
-
parse(sn).
|
437
|
-
value(sn).
|
438
|
-
canonical(sn).
|
439
|
-
details(sn).
|
440
|
-
pos(sn).
|
652
|
+
expect(parse(sn)).to_not be_nil
|
653
|
+
expect(value(sn)).to eq "Callideriphus flavicollis morph. reductus Fuchs 1961"
|
654
|
+
expect(canonical(sn)).to eq "Callideriphus flavicollis reductus"
|
655
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Callideriphus"}, :species=>{:string=>"flavicollis"}, :infraspecies=>[{:string=>"reductus", :rank=>"morph.", :authorship=>"Fuchs 1961", :basionymAuthorTeam=>{:authorTeam=>"Fuchs", :author=>["Fuchs"], :year=>"1961"}}]}]
|
656
|
+
expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 25], 26=>["infraspecific_type", 32], 33=>["infraspecies", 41], 42=>["author_word", 47], 48=>["year", 52]})
|
441
657
|
end
|
442
658
|
|
443
659
|
|
444
|
-
it "
|
660
|
+
it "parses name with forma/fo./form./f." do
|
445
661
|
sn = "Caulerpa cupressoides forma nuda"
|
446
|
-
parse(sn).
|
447
|
-
value(sn).
|
448
|
-
canonical(sn).
|
449
|
-
details(sn).
|
450
|
-
pos(sn).
|
662
|
+
expect(parse(sn)).to_not be_nil
|
663
|
+
expect(value(sn)).to eq "Caulerpa cupressoides forma nuda"
|
664
|
+
expect(canonical(sn)).to eq "Caulerpa cupressoides nuda"
|
665
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Caulerpa"}, :species=>{:string=>"cupressoides"}, :infraspecies=>[{:string=>"nuda", :rank=>"forma"}]}]
|
666
|
+
expect(pos(sn)).to eq({0=>["genus", 8], 9=>["species", 21], 22=>["infraspecific_type", 27], 28=>["infraspecies", 32]})
|
451
667
|
sn = "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
|
452
|
-
parse(sn).
|
453
|
-
value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó").
|
454
|
-
canonical(sn).
|
455
|
-
details(sn).
|
456
|
-
pos(sn).
|
668
|
+
expect(parse(sn)).to_not be_nil
|
669
|
+
expect(value("Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó")).to eq "Chlorocyperus glaber form. fasciculariforme (Lojac.) Soó"
|
670
|
+
expect(canonical(sn)).to eq "Chlorocyperus glaber fasciculariforme"
|
671
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Chlorocyperus"}, :species=>{:string=>"glaber"}, :infraspecies=>[{:string=>"fasciculariforme", :rank=>"form.", :authorship=>"(Lojac.) Soó", :combinationAuthorTeam=>{:authorTeam=>"Soó", :author=>["Soó"]}, :basionymAuthorTeam=>{:authorTeam=>"Lojac.", :author=>["Lojac."]}}]}]
|
672
|
+
expect(pos(sn)).to eq({0=>["genus", 13], 14=>["species", 20], 21=>["infraspecific_type", 26], 27=>["infraspecies", 43], 45=>["author_word", 51], 53=>["author_word", 56]})
|
457
673
|
sn = "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) Makino ex Shiros."
|
458
|
-
parse(sn).
|
459
|
-
value(sn).
|
460
|
-
canonical(sn).
|
461
|
-
details(sn).
|
462
|
-
pos(sn).
|
674
|
+
expect(parse(sn)).to_not be_nil
|
675
|
+
expect(value(sn)).to eq "Bambusa nana Roxb. fo. alphonse-karri (Mitford ex Satow) Makino ex Shiros."
|
676
|
+
expect(canonical(sn)).to eq "Bambusa nana alphonse-karri"
|
677
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Bambusa"}, :species=>{:string=>"nana", :authorship=>"Roxb.", :basionymAuthorTeam=>{:authorTeam=>"Roxb.", :author=>["Roxb."]}}, :infraspecies=>[{:string=>"alphonse-karri", :rank=>"fo.", :authorship=>"(Mitford ex Satow) Makino ex Shiros.", :combinationAuthorTeam=>{:authorTeam=>"Makino", :author=>["Makino"], :exAuthorTeam=>{:authorTeam=>"Shiros.", :author=>["Shiros."]}}, :basionymAuthorTeam=>{:authorTeam=>"Mitford", :author=>["Mitford"], :exAuthorTeam=>{:authorTeam=>"Satow", :author=>["Satow"]}}}]}]
|
678
|
+
expect(pos(sn)).to eq({0=>["genus", 7], 8=>["species", 12], 13=>["author_word", 18], 19=>["infraspecific_type", 22], 23=>["infraspecies", 37], 39=>["author_word", 46], 50=>["author_word", 55], 57=>["author_word", 63], 67=>["author_word", 74]})
|
463
679
|
sn = " Sphaerotheca fuliginea f. dahliae Movss. 1967 "
|
464
680
|
sn = "Sphaerotheca fuliginea f. dahliae Movss. 1967"
|
465
|
-
parse(sn).
|
466
|
-
value(sn).
|
467
|
-
canonical(sn).
|
468
|
-
details(sn).
|
469
|
-
pos(sn).
|
470
|
-
parse('Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay').
|
681
|
+
expect(parse(sn)).to_not be_nil
|
682
|
+
expect(value(sn)).to eq "Sphaerotheca fuliginea f. dahliae Movss. 1967"
|
683
|
+
expect(canonical(sn)).to eq "Sphaerotheca fuliginea dahliae"
|
684
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Sphaerotheca"}, :species=>{:string=>"fuliginea"}, :infraspecies=>[{:string=>"dahliae", :rank=>"f.", :authorship=>"Movss. 1967", :basionymAuthorTeam=>{:authorTeam=>"Movss.", :author=>["Movss."], :year=>"1967"}}]}]
|
685
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 16=>["species", 25], 29=>["infraspecific_type", 31], 36=>["infraspecies", 43], 47=>["author_word", 53], 58=>["year", 62]})
|
686
|
+
expect(parse('Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay')).to_not be_nil
|
471
687
|
end
|
472
688
|
|
473
|
-
it "
|
689
|
+
it "parses name with several subspecies names NOT BOTANICAL CODE BUT NOT INFREQUENT" do
|
474
690
|
sn = "Hydnellum scrobiculatum var. zonatum f. parvum (Banker) D. Hall & D.E. Stuntz 1972"
|
475
|
-
parse(sn).
|
476
|
-
value(sn).
|
477
|
-
details(sn).
|
478
|
-
pos(sn).
|
479
|
-
parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. expansus (Boiss. & Heldr.) Hayek').
|
480
|
-
parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. fuchsii').
|
691
|
+
expect(parse(sn)).to_not be_nil
|
692
|
+
expect(value(sn)).to eq "Hydnellum scrobiculatum var. zonatum f. parvum (Banker) D. Hall & D.E. Stuntz 1972"
|
693
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}, :infraspecies=>[{:string=>"zonatum", :rank=>"var."}, {:string=>"parvum", :rank=>"f.", :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"]}}]}]
|
694
|
+
expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 23], 24=>["infraspecific_type", 28], 29=>["infraspecies", 36], 37=>["infraspecific_type", 39], 40=>["infraspecies", 46], 48=>["author_word", 54], 56=>["author_word", 58], 59=>["author_word", 63], 66=>["author_word", 70], 71=>["author_word", 77], 78=>["year", 82]})
|
695
|
+
expect(parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. expansus (Boiss. & Heldr.) Hayek')).to_not be_nil
|
696
|
+
expect(parse('Senecio fuchsii C.C.Gmel. subsp. fuchsii var. fuchsii')).to_not be_nil
|
481
697
|
end
|
482
698
|
|
483
699
|
|
484
|
-
it "
|
700
|
+
it "parses status BOTANICAL RARE" do
|
485
701
|
#it is always latin abbrev often 2 words
|
486
702
|
sn = "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
|
487
|
-
parse(sn).
|
488
|
-
value(sn).
|
489
|
-
canonical(sn).
|
490
|
-
details(sn).
|
491
|
-
pos(sn).
|
703
|
+
expect(parse(sn)).to_not be_nil
|
704
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl.) R.C. Harris comb. nov."
|
705
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
706
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl.) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."]}}, :status=>"comb. nov."}]
|
707
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 31=>["author_word", 35], 36=>["author_word", 42]})
|
492
708
|
end
|
493
709
|
|
494
|
-
it "
|
710
|
+
it "parses revised (ex) names" do
|
495
711
|
#invalidly published
|
496
712
|
sn = "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
|
497
|
-
parse(sn).
|
498
|
-
value(sn).
|
499
|
-
canonical(sn).
|
500
|
-
details(sn).
|
501
|
-
pos(sn).
|
713
|
+
expect(parse(sn)).to_not be_nil
|
714
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Nyl. ex Banker) R.C. Harris"
|
715
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
716
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"(Nyl. ex Banker) R.C. Harris", :combinationAuthorTeam=>{:authorTeam=>"R.C. Harris", :author=>["R.C. Harris"]}, :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
|
717
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 29], 33=>["author_word", 39], 41=>["author_word", 45], 46=>["author_word", 52]})
|
502
718
|
sn = "Arthopyrenia hyalospora Nyl. ex Banker"
|
503
|
-
parse(sn).
|
504
|
-
details(sn).
|
719
|
+
expect(parse(sn)).to_not be_nil
|
720
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora", :authorship=>"Nyl. ex Banker", :basionymAuthorTeam=>{:authorTeam=>"Nyl.", :author=>["Nyl."], :exAuthorTeam=>{:authorTeam=>"Banker", :author=>["Banker"]}}}}]
|
505
721
|
sn = "Glomopsis lonicerae Peck ex C.J. Gould 1945"
|
506
|
-
parse(sn).
|
507
|
-
details(sn).
|
508
|
-
pos(sn).
|
509
|
-
parse("Acanthobasidium delicatum (Wakef.) Oberw. ex Jülich 1979").
|
722
|
+
expect(parse(sn)).to_not be_nil
|
723
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Glomopsis"}, :species=>{:string=>"lonicerae", :authorship=>"Peck ex C.J. Gould 1945", :basionymAuthorTeam=>{:authorTeam=>"Peck", :author=>["Peck"], :exAuthorTeam=>{:authorTeam=>"C.J. Gould", :author=>["C.J. Gould"], :year=>"1945"}}}}]
|
724
|
+
expect(pos(sn)).to eq({0=>["genus", 9], 10=>["species", 19], 20=>["author_word", 24], 28=>["author_word", 32], 33=>["author_word", 38], 39=>["year", 43]})
|
725
|
+
expect(parse("Acanthobasidium delicatum (Wakef.) Oberw. ex Jülich 1979")).to_not be_nil
|
510
726
|
sn = "Mycosphaerella eryngii (Fr. ex Duby) Johanson ex Oudem. 1897"
|
511
|
-
parse(sn).
|
512
|
-
details(sn).
|
513
|
-
pos(sn).
|
727
|
+
expect(parse(sn)).to_not be_nil
|
728
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Mycosphaerella"}, :species=>{:string=>"eryngii", :authorship=>"(Fr. ex Duby) Johanson ex Oudem. 1897", :combinationAuthorTeam=>{:authorTeam=>"Johanson", :author=>["Johanson"], :exAuthorTeam=>{:authorTeam=>"Oudem.", :author=>["Oudem."], :year=>"1897"}}, :basionymAuthorTeam=>{:authorTeam=>"Fr.", :author=>["Fr."], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
|
729
|
+
expect(pos(sn)).to eq({0=>["genus", 14], 15=>["species", 22], 24=>["author_word", 27], 31=>["author_word", 35], 37=>["author_word", 45], 49=>["author_word", 55], 56=>["year", 60]})
|
514
730
|
#invalid but happens
|
515
|
-
parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897").
|
516
|
-
parse("Mycosphaerella eryngii (Fr.ex Duby) ex Oudem. 1897").
|
731
|
+
expect(parse("Mycosphaerella eryngii (Fr. Duby) ex Oudem. 1897")).to_not be_nil
|
732
|
+
expect(parse("Mycosphaerella eryngii (Fr.ex Duby) ex Oudem. 1897")).to_not be_nil
|
517
733
|
sn = "Salmonella werahensis (Castellani) Hauduroy and Ehringer in Hauduroy 1937"
|
518
|
-
parse(sn).
|
519
|
-
details(sn).
|
520
|
-
pos(sn).
|
734
|
+
expect(parse(sn)).to_not be_nil
|
735
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Salmonella"}, :species=>{:string=>"werahensis", :authorship=>"(Castellani) Hauduroy and Ehringer in Hauduroy 1937", :combinationAuthorTeam=>{:authorTeam=>"Hauduroy and Ehringer", :author=>["Hauduroy", "Ehringer"], :exAuthorTeam=>{:authorTeam=>"Hauduroy", :author=>["Hauduroy"], :year=>"1937"}}, :basionymAuthorTeam=>{:authorTeam=>"Castellani", :author=>["Castellani"]}}}]
|
736
|
+
expect(pos(sn)).to eq({0=>["genus", 10], 11=>["species", 21], 23=>["author_word", 33], 35=>["author_word", 43], 48=>["author_word", 56], 60=>["author_word", 68], 69=>["year", 73]})
|
521
737
|
end
|
522
738
|
|
523
|
-
it '
|
739
|
+
it 'parses named hybrids' do
|
524
740
|
[
|
525
741
|
["×Agropogon P. Fourn. 1934", [{:uninomial=>{:string=>"Agropogon", :authorship=>"P. Fourn. 1934", :basionymAuthorTeam=>{:authorTeam=>"P. Fourn.", :author=>["P. Fourn."], :year=>"1934"}}}]],
|
526
742
|
["xAgropogon P. Fourn.", [{:uninomial=>{:string=>"Agropogon", :authorship=>"P. Fourn.", :basionymAuthorTeam=>{:authorTeam=>"P. Fourn.", :author=>["P. Fourn."]}}}]],
|
@@ -534,9 +750,9 @@ describe ScientificNameClean do
|
|
534
750
|
["x Heucherella tiarelloides", [{:genus=>{:string=>"Heucherella"}, :species=>{:string=>"tiarelloides"}}]],
|
535
751
|
["×Agropogon littoralis (Sm.) C. E. Hubb. 1946", [{:genus=>{:string=>"Agropogon"}, :species=>{:string=>"littoralis", :authorship=>"(Sm.) C. E. Hubb. 1946", :combinationAuthorTeam=>{:authorTeam=>"C. E. Hubb.", :author=>["C. E. Hubb."], :year=>"1946"}, :basionymAuthorTeam=>{:authorTeam=>"Sm.", :author=>["Sm."]}}}]]
|
536
752
|
].each do |res|
|
537
|
-
parse(res[0]).
|
538
|
-
parse(res[0]).hybrid.
|
539
|
-
details(res[0]).
|
753
|
+
expect(parse(res[0])).to_not be_nil
|
754
|
+
expect(parse(res[0]).hybrid).to eq true
|
755
|
+
expect(details(res[0])).to eq res[1]
|
540
756
|
end
|
541
757
|
[
|
542
758
|
['Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956)',[{:genus=>{:string=>"Asplenium"}, :species=>{:string=>"inexpectatum", :authorship=>"(E.L. Braun 1940) Morton (1956)", :combinationAuthorTeam=>{:authorTeam=>"Morton", :author=>["Morton"], :year=>"1956"}, :basionymAuthorTeam=>{:authorTeam=>"E.L. Braun", :author=>["E.L. Braun"], :year=>"1940"}}}]],
|
@@ -544,116 +760,116 @@ describe ScientificNameClean do
|
|
544
760
|
['Salix ×capreola Andersson (1867)',[{:genus=>{:string=>"Salix"}, :species=>{:string=>"capreola", :authorship=>"Andersson (1867)", :basionymAuthorTeam=>{:authorTeam=>"Andersson", :author=>["Andersson"], :year=>"1867"}}}]],
|
545
761
|
['Salix x capreola Andersson',[{:genus=>{:string=>"Salix"}, :species=>{:string=>"capreola", :authorship=>"Andersson", :basionymAuthorTeam=>{:authorTeam=>"Andersson", :author=>["Andersson"]}}}]]
|
546
762
|
].each do |res|
|
547
|
-
parse(res[0]).
|
548
|
-
parse(res[0]).hybrid.
|
549
|
-
details(res[0]).
|
763
|
+
expect(parse(res[0])).to_not be_nil
|
764
|
+
expect(parse(res[0]).hybrid).to eq true
|
765
|
+
expect(details(res[0])).to eq res[1]
|
550
766
|
end
|
551
767
|
sn = "Rosa alpina x pomifera"
|
552
|
-
canonical(sn).
|
553
|
-
parse(sn).details.
|
768
|
+
expect(canonical(sn)).to eq "Rosa alpina × pomifera"
|
769
|
+
expect(parse(sn).details).to eq [{:genus=>{:string=>"Rosa"}, :species=>{:string=>"alpina"}}, {:species=>{:string=>"pomifera"}, :genus=>{:string=>"Rosa"}}]
|
554
770
|
end
|
555
771
|
|
556
|
-
it "
|
772
|
+
it "parses hybrid combination" do
|
557
773
|
sn = "Arthopyrenia hyalospora X Hydnellum scrobiculatum"
|
558
|
-
parse(sn).
|
559
|
-
parse(sn).hybrid.
|
560
|
-
value(sn).
|
561
|
-
canonical(sn).
|
562
|
-
details(sn).
|
563
|
-
pos(sn).
|
774
|
+
expect(parse(sn)).to_not be_nil
|
775
|
+
expect(parse(sn).hybrid).to eq true
|
776
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora \303\227 Hydnellum scrobiculatum"
|
777
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
|
778
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, {:genus=>{:string=>"Hydnellum"}, :species=>{:string=>"scrobiculatum"}}]
|
779
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 26=>["genus", 35], 36=>["species", 49]})
|
564
780
|
sn = "Arthopyrenia hyalospora (Banker) D. Hall X Hydnellum scrobiculatum D.E. Stuntz"
|
565
|
-
parse(sn).
|
566
|
-
parse(sn).hybrid.
|
567
|
-
value(sn).
|
568
|
-
canonical(sn).
|
569
|
-
pos(sn).
|
570
|
-
value("Arthopyrenia hyalospora X").
|
781
|
+
expect(parse(sn)).to_not be_nil
|
782
|
+
expect(parse(sn).hybrid).to eq true
|
783
|
+
expect(value(sn)).to eq "Arthopyrenia hyalospora (Banker) D. Hall \303\227 Hydnellum scrobiculatum D.E. Stuntz"
|
784
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora × Hydnellum scrobiculatum"
|
785
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23], 25=>["author_word", 31], 33=>["author_word", 35], 36=>["author_word", 40], 43=>["genus", 52], 53=>["species", 66], 67=>["author_word", 71], 72=>["author_word", 78]})
|
786
|
+
expect(value("Arthopyrenia hyalospora X")).to eq "Arthopyrenia hyalospora \303\227 ?"
|
571
787
|
sn = "Arthopyrenia hyalospora x"
|
572
|
-
parse(sn).
|
573
|
-
parse(sn).hybrid.
|
574
|
-
canonical(sn).
|
575
|
-
details(sn).
|
576
|
-
pos(sn).
|
788
|
+
expect(parse(sn)).to_not be_nil
|
789
|
+
expect(parse(sn).hybrid).to eq true
|
790
|
+
expect(canonical(sn)).to eq "Arthopyrenia hyalospora"
|
791
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
|
792
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23]})
|
577
793
|
sn = "Arthopyrenia hyalospora × ?"
|
578
|
-
parse(sn).
|
579
|
-
parse(sn).hybrid.
|
580
|
-
details(sn).
|
581
|
-
pos(sn).
|
794
|
+
expect(parse(sn)).to_not be_nil
|
795
|
+
expect(parse(sn).hybrid).to eq true
|
796
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Arthopyrenia"}, :species=>{:string=>"hyalospora"}}, "?"]
|
797
|
+
expect(pos(sn)).to eq({0=>["genus", 12], 13=>["species", 23]})
|
582
798
|
end
|
583
799
|
|
584
|
-
it '
|
800
|
+
it 'parses names with taxon concept' do
|
585
801
|
sn = "Stenometope laevissimus sec. Eschmeyer 2004"
|
586
|
-
details(sn).
|
587
|
-
pos(sn).
|
802
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus"}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
|
803
|
+
expect(pos(sn)).to eq({0=>["genus", 11], 12=>["species", 23], 29=>["author_word", 38], 39=>["year", 43]})
|
588
804
|
sn = "Stenometope laevissimus Bibron 1855 sec. Eschmeyer 2004"
|
589
|
-
parse(sn).
|
590
|
-
details(sn).
|
591
|
-
pos(sn).
|
805
|
+
expect(parse(sn)).to_not be_nil
|
806
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Stenometope"}, :species=>{:string=>"laevissimus", :authorship=>"Bibron 1855", :basionymAuthorTeam=>{:authorTeam=>"Bibron", :author=>["Bibron"], :year=>"1855"}}, :taxon_concept=>{:authorship=>"Eschmeyer 2004", :basionymAuthorTeam=>{:authorTeam=>"Eschmeyer", :author=>["Eschmeyer"], :year=>"2004"}}}]
|
807
|
+
expect(pos(sn)).to eq({0=>["genus", 11], 12=>["species", 23], 24=>["author_word", 30], 31=>["year", 35], 41=>["author_word", 50], 51=>["year", 55]})
|
592
808
|
end
|
593
809
|
|
594
|
-
it '
|
595
|
-
parse(" Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956) ").
|
810
|
+
it 'parses names with spaces inconsistencies at the start and the end and in the middle' do
|
811
|
+
expect(parse(" Asplenium X inexpectatum (E.L. Braun 1940) Morton (1956) ")).to_not be_nil
|
596
812
|
end
|
597
813
|
|
598
|
-
it '
|
814
|
+
it 'parses names with any number of spaces' do
|
599
815
|
sn = "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
|
600
|
-
parse(sn).
|
601
|
-
value(sn).
|
602
|
-
canonical(sn).
|
603
|
-
details(sn).
|
604
|
-
pos(sn).
|
816
|
+
expect(parse(sn)).to_not be_nil
|
817
|
+
expect(value(sn)).to eq "Trematosphaeria phaeospora (E. Müll.) L. Holm 1957"
|
818
|
+
expect(canonical(sn)).to eq "Trematosphaeria phaeospora"
|
819
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Trematosphaeria"}, :species=>{:string=>"phaeospora", :authorship=>"(E. Müll.) L. Holm 1957", :combinationAuthorTeam=>{:authorTeam=>"L. Holm", :author=>["L. Holm"], :year=>"1957"}, :basionymAuthorTeam=>{:authorTeam=>"E. Müll.", :author=>["E. Müll."]}}}]
|
820
|
+
expect(pos(sn)).to eq({0=>["genus", 15], 16=>["species", 26], 28=>["author_word", 30], 31=>["author_word", 36], 46=>["author_word", 48], 61=>["author_word", 65], 66=>["year", 70]})
|
605
821
|
end
|
606
822
|
|
607
|
-
it '
|
608
|
-
parse("Pseudocercospora dendrobii (H.C. Burnett 1883) (Leight.) (Movss. 1967) U. Braun & Crous 2003").
|
823
|
+
it 'does not parse serveral authors groups with several years NOT CORRECT' do
|
824
|
+
expect(parse("Pseudocercospora dendrobii (H.C. Burnett 1883) (Leight.) (Movss. 1967) U. Braun & Crous 2003")).to be_nil
|
609
825
|
end
|
610
826
|
|
611
|
-
it "
|
612
|
-
parse("Érematosphaeria phaespora").
|
613
|
-
parse("Trematosphaeria phaeáapora").
|
614
|
-
parse("Trematоsphaeria phaeaapora").
|
827
|
+
it "does not parse unallowed utf-8 chars in name part" do
|
828
|
+
expect(parse("Érematosphaeria phaespora")).to be_nil
|
829
|
+
expect(parse("Trematosphaeria phaeáapora")).to be_nil
|
830
|
+
expect(parse("Trematоsphaeria phaeaapora")).to be_nil #cyrillic o
|
615
831
|
end
|
616
832
|
|
617
|
-
it "
|
833
|
+
it "parses new stuff" do
|
618
834
|
sn = 'Nesticus quelpartensis Paik & Namkung, in Paik, Yaginuma & Namkung, 1969'
|
619
|
-
details(sn).
|
620
|
-
parse('Dipoena yoshidai Ono, in Ono et al., 1991').
|
835
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Nesticus"}, :species=>{:string=>"quelpartensis", :authorship=>"Paik & Namkung, in Paik, Yaginuma & Namkung, 1969", :basionymAuthorTeam=>{:authorTeam=>"Paik & Namkung", :author=>["Paik", "Namkung"], :exAuthorTeam=>{:authorTeam=>"Paik, Yaginuma & Namkung", :author=>["Paik", "Yaginuma", "Namkung"], :year=>"1969"}}}}]
|
836
|
+
expect(parse('Dipoena yoshidai Ono, in Ono et al., 1991')).to_not be_nil
|
621
837
|
sn = 'Latrodectus mactans bishopi Kaston, 1938'
|
622
|
-
details(sn).
|
838
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Latrodectus"}, :species=>{:string=>"mactans"}, :infraspecies=>[{:string=>"bishopi", :rank=>"n/a", :authorship=>"Kaston, 1938", :basionymAuthorTeam=>{:authorTeam=>"Kaston", :author=>["Kaston"], :year=>"1938"}}]}]
|
623
839
|
sn = 'Thiobacillus x Parker and Prisk 1953' #have to figure out black lists for this one
|
624
840
|
sn = 'Bacille de Plaut, Kritchevsky and Séguin 1921'
|
625
|
-
details(sn).
|
841
|
+
expect(details(sn)).to eq [{:uninomial=>{:string=>"Bacille", :authorship=>"de Plaut, Kritchevsky and Séguin 1921", :basionymAuthorTeam=>{:authorTeam=>"de Plaut, Kritchevsky and Séguin", :author=>["de Plaut", "Kritchevsky", "Séguin"], :year=>"1921"}}}]
|
626
842
|
sn = 'Araneus van bruysseli Petrunkevitch, 1911'
|
627
|
-
details(sn).
|
843
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Araneus"}, :species=>{:string=>"van"}, :infraspecies=>[{:string=>"bruysseli", :rank=>"n/a", :authorship=>"Petrunkevitch, 1911", :basionymAuthorTeam=>{:authorTeam=>"Petrunkevitch", :author=>["Petrunkevitch"], :year=>"1911"}}]}]
|
628
844
|
sn = 'Sapromyces laidlawi ab Sabin 1941'
|
629
|
-
details(sn).
|
845
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Sapromyces"}, :species=>{:string=>"laidlawi", :authorship=>"ab Sabin 1941", :basionymAuthorTeam=>{:authorTeam=>"ab Sabin", :author=>["ab Sabin"], :year=>"1941"}}}]
|
630
846
|
sn = 'Nocardia rugosa di Marco and Spalla 1957'
|
631
|
-
details(sn).
|
847
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Nocardia"}, :species=>{:string=>"rugosa", :authorship=>"di Marco and Spalla 1957", :basionymAuthorTeam=>{:authorTeam=>"di Marco and Spalla", :author=>["di Marco", "Spalla"], :year=>"1957"}}}]
|
632
848
|
sn = 'Flexibacter elegans Lewin 1969 non Soriano 1945'
|
633
|
-
details(sn).
|
849
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Lewin 1969 non Soriano 1945", :basionymAuthorTeam=>{:authorTeam=>"Lewin", :author=>["Lewin"], :year=>"1969"}}}]
|
634
850
|
sn = 'Flexibacter elegans Soriano 1945, non Lewin 1969'
|
635
|
-
details(sn).
|
851
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Flexibacter"}, :species=>{:string=>"elegans", :authorship=>"Soriano 1945, non Lewin 1969", :basionymAuthorTeam=>{:authorTeam=>"Soriano", :author=>["Soriano"], :year=>"1945"}}}]
|
636
852
|
sn = 'Schottera nicaeënsis (J.V. Lamouroux ex Duby) Guiry & Hollenberg'
|
637
|
-
details(sn).
|
853
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Schottera"}, :species=>{:string=>"nicaeensis", :authorship=>"(J.V. Lamouroux ex Duby) Guiry & Hollenberg", :combinationAuthorTeam=>{:authorTeam=>"Guiry & Hollenberg", :author=>["Guiry", "Hollenberg"]}, :basionymAuthorTeam=>{:authorTeam=>"J.V. Lamouroux", :author=>["J.V. Lamouroux"], :exAuthorTeam=>{:authorTeam=>"Duby", :author=>["Duby"]}}}}]
|
638
854
|
sn = 'Deschampsia cespitosa ssp pumila'
|
639
|
-
details(sn).
|
855
|
+
expect(details(sn)).to eq [{:genus=>{:string=>"Deschampsia"}, :species=>{:string=>"cespitosa"}, :infraspecies=>[{:string=>"pumila", :rank=>"ssp"}]}]
|
640
856
|
end
|
641
857
|
|
642
|
-
# Combination genus names
|
643
|
-
it '
|
858
|
+
# Combination genus names merges without dash or capital letter
|
859
|
+
it 'parses hybrid names with capitalized second name in genus (botanical code error)' do
|
644
860
|
sn = 'Anacampti-Platanthera P. Fourn.'
|
645
|
-
parse(sn).
|
646
|
-
canonical(sn).
|
861
|
+
expect(parse(sn)).to_not be_nil
|
862
|
+
expect(canonical(sn)).to eq 'Anacamptiplatanthera'
|
647
863
|
sn = 'Anacampti-Platanthera vulgaris P. Fourn.'
|
648
|
-
parse(sn).
|
649
|
-
canonical(sn).
|
864
|
+
expect(parse(sn)).to_not be_nil
|
865
|
+
expect(canonical(sn)).to eq 'Anacamptiplatanthera vulgaris'
|
650
866
|
end
|
651
867
|
|
652
|
-
it '
|
868
|
+
it 'parses genus names starting with uppercase letters AE OE' do
|
653
869
|
sn = 'AEmona separata Broun 1921'
|
654
|
-
canonical(sn).
|
870
|
+
expect(canonical(sn)).to eq 'Aemona separata'
|
655
871
|
sn = 'OEmona simplex White, 1855'
|
656
|
-
canonical(sn).
|
872
|
+
expect(canonical(sn)).to eq 'Oemona simplex'
|
657
873
|
end
|
658
874
|
#"Arthrosamanea eriorhachis (Harms & sine ref. ) Aubrév." -- ignore & sine ref. (means without reference)
|
659
875
|
|
@@ -661,7 +877,7 @@ describe ScientificNameClean do
|
|
661
877
|
new stuff
|
662
878
|
|
663
879
|
sn = "Orchidaceae × Asconopsis hort."
|
664
|
-
canonical(sn).
|
880
|
+
expect(canonical(sn)).to eq "Orchidaceae x Asconopsis"
|
665
881
|
sn
|
666
882
|
Tamiops swinhoei near hainanus|Tamiops swinhoei near hainanus
|
667
883
|
Conus textile form archiepiscopus|Conus textile form archiepiscopus|
|