dimus-biodiversity 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1833,6 +1833,7 @@ module ScientificName
1833
1833
  def b
1834
1834
  elements[3]
1835
1835
  end
1836
+
1836
1837
  end
1837
1838
 
1838
1839
  module NamePart5
@@ -1930,6 +1931,22 @@ module ScientificName
1930
1931
  if r16
1931
1932
  r17 = _nt_latin_word
1932
1933
  s13 << r17
1934
+ if r17
1935
+ i18 = index
1936
+ if input.index(Regexp.new('[^\\.]'), index) == index
1937
+ r19 = (SyntaxNode).new(input, index...(index + 1))
1938
+ @index += 1
1939
+ else
1940
+ r19 = nil
1941
+ end
1942
+ if r19
1943
+ self.index = i18
1944
+ r18 = SyntaxNode.new(input, index...index)
1945
+ else
1946
+ r18 = nil
1947
+ end
1948
+ s13 << r18
1949
+ end
1933
1950
  end
1934
1951
  end
1935
1952
  end
@@ -1944,13 +1961,13 @@ module ScientificName
1944
1961
  if r13
1945
1962
  r0 = r13
1946
1963
  else
1947
- r18 = _nt_species_name
1948
- if r18
1949
- r0 = r18
1964
+ r20 = _nt_species_name
1965
+ if r20
1966
+ r0 = r20
1950
1967
  else
1951
- r19 = _nt_cap_latin_word
1952
- if r19
1953
- r0 = r19
1968
+ r21 = _nt_cap_latin_word
1969
+ if r21
1970
+ r0 = r21
1954
1971
  else
1955
1972
  self.index = i0
1956
1973
  r0 = nil
@@ -285,7 +285,7 @@ grammar ScientificName
285
285
  end
286
286
  }
287
287
  /
288
- space a:species_name space b:latin_word {
288
+ space a:species_name space b:latin_word &[^\.] {
289
289
  def value
290
290
  a.value + " " + b.value
291
291
  end
@@ -108,9 +108,10 @@ describe ScientificName do
108
108
  parse("Tuber liui A S. Xu 1999").should_not be_nil
109
109
  parse("Agaricus squamula Berk. & M.A. Curtis 1860").should_not be_nil
110
110
  parse("Peltula coriacea Büdel, Henssen & Wessels 1986").should_not be_nil
111
+ #had to add no dot rule for trinomials without a rank to make it to work
112
+ parse("Saccharomyces drosophilae anon.").should_not be_nil
111
113
  end
112
114
 
113
-
114
115
  it 'should parse several authors with several years' do
115
116
  parse("Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003").should_not be_nil
116
117
  value("Pseudocercospora dendrobii(H.C. Burnett1883)U. Braun & Crous 2003").should == "Pseudocercospora dendrobii (H.C. Burnett 1883) U. Braun & Crous 2003"
@@ -131,7 +132,6 @@ describe ScientificName do
131
132
  end
132
133
 
133
134
  it "should parse name with f." do
134
-
135
135
  parse("Sphaerotheca fuliginea f. dahliae Movss. 1967").should_not be_nil
136
136
  value(" Sphaerotheca fuliginea f. dahliae Movss. 1967 ").should == "Sphaerotheca fuliginea f. dahliae Movss. 1967"
137
137
  canonical("Sphaerotheca fuliginea f. dahliae Movss. 1967").should == "Sphaerotheca fuliginea dahliae"
@@ -238,7 +238,4 @@ describe ScientificName do
238
238
 
239
239
  end
240
240
 
241
- it "should not have this problems, but it has them" do
242
- parse("Saccharomyces drosophilae anon.").should be_nil
243
- end
244
241
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimus-biodiversity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Mozzherin