difflib on Ruby [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-10 14:42:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!