biodiversity19 1.0.18 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.19
|
@@ -92,6 +92,44 @@ grammar ScientificNameDirty
|
|
92
92
|
super
|
93
93
|
end
|
94
94
|
|
95
|
+
rule infraspecies_string
|
96
|
+
sel:rank space_hard a:species_word {
|
97
|
+
def value
|
98
|
+
sel.apply(a)
|
99
|
+
end
|
100
|
+
def canonical
|
101
|
+
sel.canonical(a)
|
102
|
+
end
|
103
|
+
|
104
|
+
def pos
|
105
|
+
sel.pos(a)
|
106
|
+
end
|
107
|
+
|
108
|
+
def details
|
109
|
+
sel.details(a)
|
110
|
+
end
|
111
|
+
}
|
112
|
+
/
|
113
|
+
species_word ![\.] {
|
114
|
+
def value
|
115
|
+
text_value.tr('àâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž',
|
116
|
+
'aaaaaacceeeiiinnnoooooouuurrrsssz')
|
117
|
+
end
|
118
|
+
|
119
|
+
def canonical
|
120
|
+
value
|
121
|
+
end
|
122
|
+
|
123
|
+
def pos
|
124
|
+
{interval.begin => ['infraspecies', interval.end]}
|
125
|
+
end
|
126
|
+
|
127
|
+
def details
|
128
|
+
{:infraspecies => {:string => value, :rank => 'n/a'}}
|
129
|
+
end
|
130
|
+
}
|
131
|
+
end
|
132
|
+
|
95
133
|
rule species
|
96
134
|
a:species_string space b:year {
|
97
135
|
def value
|
@@ -97,6 +97,7 @@ describe ScientificNameDirty do
|
|
97
97
|
parse(name).should_not be_nil
|
98
98
|
end
|
99
99
|
details("Hirsutëlla mâle").should == [{:genus=>{:string=>"Hirsutella"}, :species=>{:string=>"male"}}]
|
100
|
+
details("Triticum repens vulgäre").should == [{:genus=>{:string=>"Triticum"}, :species=>{:string=>"repens"}, :infraspecies=>[{:string=>"vulgare", :rank=>"n/a"}]}]
|
100
101
|
end
|
101
102
|
|
102
103
|
# AsterophUa japonica
|
data/spec/parser/test_data.txt
CHANGED
@@ -57,6 +57,8 @@ Pseudocercospora dendrobii U. Braun et Crous|{"scientificName":{"parsed":true, "
|
|
57
57
|
Pseudocercospora dendrobii U. Braun and Crous|{"scientificName":{"parsed":true, "parser_version":"test_version", "parser_run":1,"verbatim":"Pseudocercospora dendrobii U. Braun and Crous","normalized":"Pseudocercospora dendrobii U. Braun et Crous","canonical":"Pseudocercospora dendrobii","hybrid":false,"details":[{"genus":{"string":"Pseudocercospora"},"species":{"string":"dendrobii","authorship":"U. Braun and Crous","basionymAuthorTeam":{"authorTeam":"U. Braun and Crous","author":["U. Braun","Crous"]}}}],"positions":{"0":["genus",16],"17":["species",26],"27":["author_word",29],"30":["author_word",35],"40":["author_word",45]}}}
|
58
58
|
Schottera nicaeënsis (J.V. Lamouroux ex Duby) Guiry & Hollenberg|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Schottera nicaeënsis (J.V. Lamouroux ex Duby) Guiry & Hollenberg", "normalized":"Schottera nicaeensis (J.V. Lamouroux ex Duby) Guiry et Hollenberg", "canonical":"Schottera nicaeensis", "hybrid":false, "details":[{"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"]}}}}], "parser_run":1, "positions":{"0":["genus", 9], "10":["species", 20], "22":["author_word", 26], "27":["author_word", 36], "40":["author_word", 44], "46":["author_word", 51], "54":["author_word", 64]}}}
|
59
59
|
Hirsutëlla mâle|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Hirsutëlla mâle", "normalized":"Hirsutella male", "canonical":"Hirsutella male", "hybrid":false, "details":[{"genus":{"string":"Hirsutella"}, "species":{"string":"male"}}], "parser_run":2, "positions":{"0":["genus", 10], "11":["species", 15]}}}
|
60
|
+
Triticum repens vulgäre|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Triticum repens vulgäre", "normalized":"Triticum repens vulgare", "canonical":"Triticum repens vulgare", "hybrid":false, "details":[{"genus":{"string":"Triticum"}, "species":{"string":"repens"}, "infraspecies":[{"string":"vulgare", "rank":"n/a"}]}], "parser_run":2, "positions":{"0":["genus", 8], "9":["species", 15], "16":["infraspecies", 23]}}}
|
61
|
+
Triticum repens var. vulgäre|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Triticum repens var. vulgäre", "normalized":"Triticum repens var. vulgare", "canonical":"Triticum repens vulgare", "hybrid":false, "details":[{"genus":{"string":"Triticum"}, "species":{"string":"repens"}, "infraspecies":[{"string":"vulgare", "rank":"var."}]}], "parser_run":2, "positions":{"0":["genus", 8], "9":["species", 15], "16":["infraspecific_type", 20], "21":["infraspecies", 28]}}}
|
60
62
|
|
61
63
|
#binomial with several authors and a year
|
62
64
|
Pseudocercospora dendrobii U. Braun & Crous 2003|{"scientificName":{"parsed":true, "parser_version":"test_version", "parser_run":1,"verbatim":"Pseudocercospora dendrobii U. Braun & Crous 2003","normalized":"Pseudocercospora dendrobii U. Braun et Crous 2003","canonical":"Pseudocercospora dendrobii","hybrid":false,"details":[{"genus":{"string":"Pseudocercospora"},"species":{"string":"dendrobii","authorship":"U. Braun & Crous 2003","basionymAuthorTeam":{"authorTeam":"U. Braun & Crous","author":["U. Braun","Crous"],"year":"2003"}}}],"positions":{"0":["genus",16],"17":["species",26],"27":["author_word",29],"30":["author_word",35],"38":["author_word",43],"44":["year",48]}}}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biodiversity19
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.19
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -162,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
segments:
|
164
164
|
- 0
|
165
|
-
hash: -
|
165
|
+
hash: -2276684114644108557
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
none: false
|
168
168
|
requirements:
|