Are there java libraries to do a word-based diff?

六月ゝ 毕业季﹏ 提交于 2020-01-02 04:45:11

问题


I have two pieces of text. I would like to make a word-based diff between them (like whe unix utility wdiff does) but with more information in the output (I mean, the character's posizion where the added/delited word starts).

I need to do this in Java, so a simple output of the differences (like wdiff) doesn't suite for me: I would like to manipulate objects representing differences.


回答1:


There's Diff,Match,Patch - available in Java, and a demo is avilable - it seems to do word differences.



来源:https://stackoverflow.com/questions/2898612/are-there-java-libraries-to-do-a-word-based-diff

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