Sha256: 23676cb73326eb7050ef942b1298cf30c6bc1ee767c7662c55b17e7c269f50e6

Contents?: true

Size: 489 Bytes

Versions: 8

Compression:

Stored size: 489 Bytes

Contents

class FuzzyMatch
  class Score
    # be sure to `require 'amatch'` before you use this class
    class Amatch < Score

      def dices_coefficient_similar
        @dices_coefficient_similar ||= if str1 == str2
          1.0
        elsif str1.length == 1 and str2.length == 1
          0.0
        else
          str1.pair_distance_similar str2
        end
      end

      def levenshtein_similar
        @levenshtein_similar ||= str1.levenshtein_similar str2
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/fuzzy_match-2.0.4/lib/fuzzy_match/score/amatch.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/fuzzy_match-2.0.4/lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.1.0 lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.0.4 lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.0.3 lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.0.2 lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.0.1 lib/fuzzy_match/score/amatch.rb
fuzzy_match-2.0.0 lib/fuzzy_match/score/amatch.rb