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