问题
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.
来源:https://stackoverflow.com/questions/4916966/difflib-on-ruby