Sha256: ca5f1c891ff7bebfbaff6cd86ce78701f5b178b6df597cbb141385ea16c6c435

Contents?: true

Size: 569 Bytes

Versions: 22

Compression:

Stored size: 569 Bytes

Contents

require 'rspec'

$:.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

22 entries across 22 versions & 1 rubygems

Version Path
taxamatch_rb-1.0.1 spec/spec_helper.rb
taxamatch_rb-1.0.0 spec/spec_helper.rb
taxamatch_rb-0.9.10 spec/spec_helper.rb
taxamatch_rb-0.9.9 spec/spec_helper.rb
taxamatch_rb-0.9.8 spec/spec_helper.rb
taxamatch_rb-0.9.7 spec/spec_helper.rb
taxamatch_rb-0.9.6 spec/spec_helper.rb
taxamatch_rb-0.9.5 spec/spec_helper.rb
taxamatch_rb-0.9.4 spec/spec_helper.rb
taxamatch_rb-0.9.2 spec/spec_helper.rb
taxamatch_rb-0.9.0 spec/spec_helper.rb
taxamatch_rb-0.8.7 spec/spec_helper.rb
taxamatch_rb-0.8.6 spec/spec_helper.rb
taxamatch_rb-0.8.5 spec/spec_helper.rb
taxamatch_rb-0.8.4 spec/spec_helper.rb
taxamatch_rb-0.8.3 spec/spec_helper.rb
taxamatch_rb-0.8.2 spec/spec_helper.rb
taxamatch_rb-0.8.1 spec/spec_helper.rb
taxamatch_rb-0.8.0 spec/spec_helper.rb
taxamatch_rb-0.7.6 spec/spec_helper.rb