Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 740
Mycol Avatar asked Oct 25 '22 14:10

Mycol


1 Answers

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

like image 156
mdma Avatar answered Nov 11 '22 15:11

mdma