struct JaroWinkler

Defined in:

jaro_winkler.cr

Constant Summary

DEFAULT_ADJ_TABLE = [['A', 'E'], ['A', 'I'], ['A', 'O'], ['A', 'U'], ['B', 'V'], ['E', 'I'], ['E', 'O'], ['E', 'U'], ['I', 'O'], ['I', 'U'], ['O', 'U'], ['I', 'Y'], ['E', 'Y'], ['C', 'G'], ['E', 'F'], ['W', 'U'], ['W', 'V'], ['X', 'K'], ['S', 'Z'], ['X', 'S'], ['Q', 'C'], ['U', 'V'], ['M', 'N'], ['L', 'I'], ['Q', 'O'], ['P', 'R'], ['I', 'J'], ['2', 'Z'], ['5', 'S'], ['8', 'B'], ['1', 'I'], ['1', 'L'], ['0', 'O'], ['0', 'Q'], ['C', 'K'], ['G', 'J'], ['E', ' '], ['Y', ' '], ['S', ' ']].reduce(Set(Tuple(Char, Char)).new) do |set, elem| c1, c2 = elem set << {c1, c2} set << {c2, c1} set << {c1.downcase, c2.downcase} set << {c2.downcase, c1.downcase} set << {c1.downcase, c2} set << {c2, c1.downcase} set << {c1, c2.downcase} set << {c2.downcase, c1} set end
VERSION = "0.2"

Constructors

Instance Method Summary

Constructor Detail

def self.new(weight : Float64 = 0.1, threshold : Float64 = 0.7, ignore_case : Bool = false, adj_table : Bool = false) #

[View source]

Instance Method Detail

def distance(s1 : String, s2 : String) #

[View source]
def distance(s1 : Array(Char), s2 : Array(Char)) #

[View source]
def jaro_distance(s1 : String, s2 : String) #

[View source]
def jaro_distance(s1 : Array(Char), s2 : Array(Char)) #

[View source]