Class: FuzzyMatch::Score::Amatch

Inherits:
FuzzyMatch::Score show all
Defined in:
lib/fuzzy_match/score/amatch.rb

Overview

be sure to ‘require ’amatch’‘ before you use this class

Instance Attribute Summary

Attributes inherited from FuzzyMatch::Score

#str1, #str2

Instance Method Summary collapse

Methods inherited from FuzzyMatch::Score

#<=>, #initialize, #inspect

Constructor Details

This class inherits a constructor from FuzzyMatch::Score

Instance Method Details

#dices_coefficient_similarObject



6
7
8
9
10
11
12
13
14
# File 'lib/fuzzy_match/score/amatch.rb', line 6

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

#levenshtein_similarObject



16
17
18
# File 'lib/fuzzy_match/score/amatch.rb', line 16

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