Levenshtein in Ruby 1.9

In Ruby 1.8, I would use the gem 'levenshtein'... well that doesn't work in 1.9. So you need to install the gem 'text'.

Then the call is as simple as:

Text::Levenshtein.distance('hello', 'hell')

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

If you made it this far, you should follow me on Twitter.

-JP

comments powered by Disqus