Class: FuzzyMatch::Score::Amatch
Overview
be sure to ‘require ’amatch’‘ before you use this class
Instance Attribute Summary
#str1, #str2
Instance Method Summary
collapse
#<=>, #initialize
Instance Method Details
#dices_coefficient_similar ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/fuzzy_match/score/amatch.rb', line 10
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
|
#inspect ⇒ Object
6
7
8
|
# File 'lib/fuzzy_match/score/amatch.rb', line 6
def inspect
%{#<FuzzyMatch::Score::Amatch: str1=#{str1.inspect} str2=#{str2.inspect} dices_coefficient_similar=#{dices_coefficient_similar} levenshtein_similar=#{levenshtein_similar}>}
end
|
#levenshtein_similar ⇒ Object
20
21
22
|
# File 'lib/fuzzy_match/score/amatch.rb', line 20
def levenshtein_similar
@levenshtein_similar ||= str1.levenshtein_similar str2
end
|