Sha256: 58bb95544db8709d2ba151945711d0f906cf9df77ff8e0bc556d731fffb87e6a

Contents?: true

Size: 333 Bytes

Versions: 4

Compression:

Stored size: 333 Bytes

Contents

require 'fuzzystringmatch'

module IdentityParade
  module Matchers
    # This matcher checks the similarity of two strings.
    class StringMatcher < Matcher
      def score
        jarow.getDistance(left.to_s, right.to_s)
      end

      def jarow
        FuzzyStringMatch::JaroWinkler.create(:native)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
identity_parade-1.0.1 lib/identity_parade/matchers/string_matcher.rb
identity_parade-1.0.0 lib/identity_parade/matchers/string_matcher.rb
identity_parade-0.1.1 lib/identity_parade/matchers/string_matcher.rb
identity_parade-0.1.0 lib/identity_parade/matchers/string_matcher.rb