Sha256: 99d149cc8822c531034f3364fae256cc3f38977f5b724043823d1ccd6b6057a5
Contents?: true
Size: 677 Bytes
Versions: 9
Compression:
Stored size: 677 Bytes
Contents
begin require 'spec' rescue LoadError require 'rubygems' unless ENV['NO_RUBYGEMS'] gem 'rspec' require 'spec' end $:.unshift(File.dirname(__FILE__) + '/../lib') require 'taxamatch_rb' def read_test_file(file, fields_num) f = open(file) f.each do |line| fields = line.split("|") if line.match(/^\s*#/) == nil && fields.size == fields_num fields[-1] = fields[-1].split('#')[0].strip yield(fields) else yield(nil) end end end def make_taxamatch_hash(string) normalized = Taxamatch::Normalizer.normalize(string) {:epitheton => string, :normalized => normalized, :phonetized => Taxamatch::Phonetizer.near_match(normalized)} end
Version data entries
9 entries across 9 versions & 2 rubygems