Sha256: 0af0dcd679bd0912090beccd16b595f2a208fcd268df357cc7b9db33defb0fc9
Contents?: true
Size: 655 Bytes
Versions: 5
Compression:
Stored size: 655 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 = Normalizer.normalize(string) {:epitheton => string, :normalized => normalized, :phonetized => Phonetizer.near_match(normalized)} end
Version data entries
5 entries across 5 versions & 1 rubygems