module

Edits::Compare

Instance methods

most_similar(prototype, strings : Indexable)

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.

Source