module Edits::Compare
Defined in:
edits/compare.crInstance Method Summary
-
#most_similar(prototype, strings : Enumerable)
Given a prototype string and an array of strings, determines which string is most similar to the prototype.
Instance Method Detail
def most_similar(prototype, strings : Enumerable)
#
Given a prototype string and an array of strings, determines which string is most similar to the prototype.
Klass.most_similar("foo", strings) is functionally equivalent to
strings.min_by { |s| Klass.distance("foo", s) }, leveraging a
max distance.