lib/hotwater/ngram_ffi.rb
# compute N-Gram distance between 2 strings
# @param s1 [String] first string
# @param s2 [String] seconds string
# @param n [Integer] number of characters per gram, default is 2
# @return [Float] edit distance between 0.0 and 1.0
compute N-Gram distance between 2 strings
compute N - Gram distance between 2 strings
def ngram_distance(s1, s2, n = 2)
    result = C::ngram_distance(s1, s2, n)
    raise("memory allocation error") if result == -1
    result
  end
def ngram_distance ( s1 , s2 , n = 2 ) result = C :: ngram_distance ( s1 , s2 , n ) raise ( "memory allocation error" ) if result == - 1 result end
compute N-Gram distance between 2 strings
compute N - Gram distance between 2 strings
None
Float
s1
None
s2
None
n
number of characters per gram, default is 2
number of characters per gram default is 2