Issue #10882 has been updated by Kouhei Sutou.


How about implementing `did_you_mean` feature by a plugin of Rake? (I don'tknow Rake supports plugin. Sorry.)
You can use text gem in the plugin.


----------------------------------------
Feature #10882: Provide Levenshtein distance implementation as part of stdlib
https://bugs.ruby-lang.org/issues/10882#change-51584

* Author: Yuki Nishijima
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
[Levenshtein distance algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) has been used by Rubygems, Bundler, did_you_mean and Rails and I think it's popular enough to provide it as part of Ruby's stdlib. It still seems a bit too high-level though, but definitely useful (e.g. [adding "did you mean?" to rake](https://github.com/ruby/rake/pull/29)).

API-wise, I would like to propose something like the following, but I'm totally open to hear the core team's opinions as I'm not sue if this is great.

```ruby
require 'distance'

Distance.levenshtein(str1, str2)
```

It would also be interesting to have `#distance` method on `String`:

```ruby
"word".distance("other")
```

which is implemented as:

```ruby
def distance(str, algorithm = :levenshtein)
  # calculate the distance here.
end
```

so it can allow to change the algorythm when we add more (e.g. [JaroWinkler distance](http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance)).




-- 
https://bugs.ruby-lang.org/