5

Is there a library similar to Python's difflib on Ruby?

Particularly, I need one that has a method similar to difflib.get_close_matches. Any recommendations?

fjsj
  • 10,995
  • 11
  • 41
  • 57
  • 1
    possible duplicate of [diff a ruby string or array](http://stackoverflow.com/questions/80091/diff-a-ruby-string-or-array) – sawa May 23 '11 at 08:22

2 Answers2

0

You can take a look at diff-lcs.

knut
  • 27,320
  • 6
  • 84
  • 112
kurumi
  • 25,121
  • 5
  • 44
  • 52
0

After some research, I suggest using amatch or SimMetrics (with JRuby) and manually implement the get_close_matches method. Both libs offer implementations of many string similarity algorithms.

fjsj
  • 10,995
  • 11
  • 41
  • 57