Sha256: de8ba7721393c0a056387ca03f72b1ecc09d9d6daa1cfa3d4214e75949540ee7
Contents?: true
Size: 434 Bytes
Versions: 8
Compression:
Stored size: 434 Bytes
Contents
module SlideRule module DistanceCalculators class Levenshtein def calculate(first, second) ::Vladlev.get_normalized_distance(first, second).to_f # Lower bound is difference in length # distance = matrix.last.last.to_f - (first.length - second.length).abs # Upper bound is length of longest string # This will decrease distance more for longer strings. end end end end
Version data entries
8 entries across 8 versions & 1 rubygems