是否有 java 库可以进行基于单词的差异?
我有两段文字。我想在它们之间进行基于单词的差异(就像 unix 实用程序 wdiff
所做的那样),但在输出中包含更多信息(我的意思是,添加/删除单词开始的字符位置)。
我需要在 Java 中执行此操作,因此差异的简单输出(例如 wdiff
)不适合我:我想操作表示差异的对象。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有 Diff,Match,Patch - 在 Java 中可用,还有一个演示是可用的 - 它似乎可以区分单词。
There's Diff,Match,Patch - available in Java, and a demo is avilable - it seems to do word differences.