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,748
  • 9
  • 39
  • 55
  • 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
  • 26,435
  • 6
  • 84
  • 110
kurumi
  • 24,217
  • 4
  • 43
  • 49
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,748
  • 9
  • 39
  • 55