difflib on Ruby [closed]

2019-06-22 07:53发布

问题:

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?

回答1:

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.



回答2:

You can take a look at diff-lcs.