lib/name-spotter/scientific_name.rb in name-spotter-0.2.4 vs lib/name-spotter/scientific_name.rb in name-spotter-0.3.0
- old
+ new
@@ -1,11 +1,11 @@
class NameSpotter
class ScientificName
attr_reader :verbatim, :scientific, :start_pos, :end_pos, :score
def self.normalize(name)
- name = name.gsub(",", " ")
+ name = name.gsub(",", " ")
name = name.gsub(/\s+/, " ")
end
def initialize(verbatim_name, options={})
@verbatim = verbatim_name
@@ -20,11 +20,11 @@
# Use this in specs
def eql?(other_name)
other_name.is_a?(Name) &&
other_name.verbatim.eql?(verbatim) &&
other_name.scientific.eql?(scientific) &&
- other_name.start_pos.eql?(start_pos) &&
- other_name.end_pos.eql?(end_pos) &&
+ other_name.start_pos.eql?(start_pos) &&
+ other_name.end_pos.eql?(end_pos) &&
other_name.score.eql?(score)
end
def to_hash
name_hash = {:verbatim => verbatim}