是否有java库来做基于单词的差异? [英] Are there java libraries to do a word-based diff?

查看:151
本文介绍了是否有java库来做基于单词的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两段文字。我想在它们之间做一个基于单词的差异(比如当unix实用程序 wdiff 那么)但输出中有更多信息(我的意思是,字符的位置添加了/ delited word starts)。

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).

我需要在Java中这样做,所以差异的简单输出(如 wdiff )不适合我:我想操纵表示差异的对象。

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.

推荐答案

差异,匹配,修补程序 - 以Java提供,并且可以使用演示 - 似乎做差异。

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

这篇关于是否有java库来做基于单词的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆