Sha256: 3cffb0a909f0d92c16339f196d52db3706244bcf0b06fdf867a7f9bdbacb76f9

Contents?: true

Size: 519 Bytes

Versions: 5

Compression:

Stored size: 519 Bytes

Contents

require 'fuzzy_match/score/pure_ruby'
require 'fuzzy_match/score/amatch'

class FuzzyMatch
  class Score
    attr_reader :str1
    attr_reader :str2

    def initialize(str1, str2)
      @str1 = str1.downcase
      @str2 = str2.downcase
    end

    def <=>(other)
      by_dices_coefficient = (dices_coefficient_similar <=> other.dices_coefficient_similar)
      if by_dices_coefficient == 0
        levenshtein_similar <=> other.levenshtein_similar
      else
        by_dices_coefficient
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fuzzy_match-1.4.0 lib/fuzzy_match/score.rb
fuzzy_match-1.3.3 lib/fuzzy_match/score.rb
fuzzy_match-1.3.2 lib/fuzzy_match/score.rb
fuzzy_match-1.3.1 lib/fuzzy_match/score.rb
fuzzy_match-1.3.0 lib/fuzzy_match/score.rb