lib/taxamatch_rb/parser.rb in dimus-taxamatch_rb-0.1.2 vs lib/taxamatch_rb/parser.rb in dimus-taxamatch_rb-0.1.4

- old
+ new

@@ -1,9 +1,9 @@ # encoding: UTF-8 require 'biodiversity' -class Parser +class TaxamatchParser def initialize @parser = ScientificNameParser.new @parsed_raw = nil @res = {} end @@ -26,10 +26,10 @@ d = pr['details'][0] process_node(:uninomial, d['uninomial']) process_node(:genus, d['genus']) process_node(:species, d['species'], true) process_infraspecies(d['infraspecies']) - @res[:all_authors].uniq! + @res[:all_authors] = @res[:all_authors].uniq.map {|a| Normalizer.normalize(a)} @res[:all_years].uniq! @res.keys.size > 2 ? @res : nil end def process_node(name, node, is_species = false) \ No newline at end of file