Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

migrated to ruby 1.9.3, made ë be converted to e in dirty parser

  • Loading branch information...
commit 4ef6eb76d1b9e672748cfc6a035a639b105a71fa 1 parent 04f871a
@dimus dimus authored
View
2  .rvmrc
@@ -1 +1 @@
-rvm use ruby-1.9.2-p290@biodiversity --create
+rvm use ruby-1.9.3-p194@biodiversity --create
View
2  CHANGELOG
@@ -1,3 +1,5 @@
+1.0.16 -- dirty mode now converts ë to e
+
1.0.15 -- additional rules added for names ending with ssp. sp sp. and cf.
1.0.14 -- canonical forms had allowed ë as a character until now. After this
View
15 Gemfile.lock
@@ -1,12 +1,16 @@
GEM
remote: http://rubygems.org/
specs:
+ archive-tar-minitar (0.5.2)
+ columnize (0.3.6)
diff-lcs (1.1.3)
git (1.2.5)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
parallel (0.5.9)
polyglot (0.3.3)
rake (0.9.2.2)
@@ -18,6 +22,16 @@ GEM
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
@@ -29,4 +43,5 @@ DEPENDENCIES
jeweler
parallel
rspec
+ ruby-debug19
treetop
View
13 lib/biodiversity/parser/scientific_name_dirty.treetop
@@ -115,7 +115,7 @@ grammar ScientificNameDirty
end
rule latin_word
- a:[a-z\-ëæœàâåãäáçčéèíìïňññóòôøõöúùüŕřŗššşž] b:valid_name_letters {
+ a:[a-z\-æœàâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž] b:valid_name_letters {
def value
res = ''
text_value.split('').each do |l|
@@ -123,14 +123,14 @@ grammar ScientificNameDirty
l = 'oe' if l == 'œ'
res << l
end
- res.tr('àâåãäáçčéèíìïňññóòôøõöúùüŕřŗššşž',
- 'aaaaaacceeiiinnnoooooouuurrrsssz')
+ res.tr('àâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž',
+ 'aaaaaacceeeiiinnnoooooouuurrrsssz')
end
}
end
rule valid_name_letters
- [a-z\-ëæœàâåãäáçčéèíìïňññóòôøõöúùüŕřŗššşž]+ {
+ [a-z\-æœàâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž]+ {
def value
res = ''
text_value.split('').each do |l|
@@ -138,8 +138,9 @@ grammar ScientificNameDirty
l = 'oe' if l == 'œ'
res << l
end
- res.tr('àâåãäáçčéèíìïňññóòôøõöúùüŕřŗššşž',
- 'aaaaaacceeiiinnnoooooouuurrrsssz')
+ res.tr('àâåãäáçčëéèíìïňññóòôøõöúùüŕřŗššşž',
+ 'aaaaaacceeeiiinnnoooooouuurrrsssz')
+
end
}
end
View
1  spec/parser/scientific_name_dirty.spec.rb
@@ -96,6 +96,7 @@
names = ["Rühlella","Sténométope laevissimus Bibron 1855", "Döringina Ihering 1929"].each do |name|
parse(name).should_not be_nil
end
+ details("Hirsutëlla mâle").should == [{:uninomial=>{:string=>"Hirsutella"}}]
end
# AsterophUa japonica
View
1  spec/parser/test_data.txt
@@ -56,6 +56,7 @@ Pseudocercospora dendrobii U. Braun & Crous|{"scientificName":{"parsed":true, "p
Pseudocercospora dendrobii U. Braun et Crous|{"scientificName":{"parsed":true, "parser_version":"test_version", "parser_run":1,"verbatim":"Pseudocercospora dendrobii U. Braun et Crous","normalized":"Pseudocercospora dendrobii U. Braun et Crous","canonical":"Pseudocercospora dendrobii","hybrid":false,"details":[{"genus":{"string":"Pseudocercospora"},"species":{"string":"dendrobii","authorship":"U. Braun et Crous","basionymAuthorTeam":{"authorTeam":"U. Braun et Crous","author":["U. Braun","Crous"]}}}],"positions":{"0":["genus",16],"17":["species",26],"27":["author_word",29],"30":["author_word",35],"39":["author_word",44]}}}
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]}}}
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]}}}
+Hirsutëlla mâle|{"scientificName":{"parsed":true, "parser_version":"test_version", "verbatim":"Hirsutëlla mâle", "normalized":"Hirsutella", "canonical":"Hirsutella", "hybrid":false, "details":[{"uninomial":{"string":"Hirsutella"}}], "parser_run":2, "positions":{"0":["uninomial", 10]}}}
#binomial with several authors and a year
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]}}}
Please sign in to comment.
Something went wrong with that request. Please try again.