Text Diff Algorithm

来源:百度文库 编辑:神马文学网 时间:2024/04/30 00:14:09

Text Diff Algorithm

I'm looking for a text diff algorithm.  I have searched Googlehowever it seems there really is no source code implementation orclearly spelled out algorithm available.  Any links or suggestions areappreciated.Ω
Wednesday, April 13, 2005  Deleting … Approving …  I guess u can find some info for the diff stuff in the following links that I found in Google...

http://raleigh.pm.org/talks/algorithm_diff/code.html

http://meta-diff.sourceforge.net/Ricky
Wednesday, April 13, 2005  Deleting … Approving …  You might want to start here:

http://c2.com/cgi/wiki?DiffAlgorithm

The Eugene Myers paper mentioned there is on the web:

http://citeseer.ist.psu.edu/myers86ond.html

It's not directly code, but if you work through the paper you'll understand what you need to do.Chris Tavares
Wednesday, April 13, 2005  Deleting … Approving …  There's the gnu diffutils package:

http://www.gnu.org/software/diffutils/diffutils.html

Rsync only sends the diff between 2 text files, it might also provide a good example:

http://samba.anu.edu.au/rsync/John Eikenberry
Wednesday, April 13, 2005  Deleting … Approving …  Here's one that helped me write a diff for a moribund Fortran environment some time ago:

http://www.ics.uci.edu/~eppstein/161/960229

and a Perl that refers to it:

http://perl.plover.com/diff/Diff.pm

Best of luck.trollop
Wednesday, April 13, 2005  Deleting … Approving …  I've used a component called TextDiff within our application.Although it's for Delphi, the download not only includes the source, butthe Myers Diff paper (mentioned above), information about the GenericDiff Format Spec and a nice text file diff application showing how touse the component.

http://www.users.on.net/johnson/delphi/textdiff.html

Hope this helps.Ian H
Wednesday, April 13, 2005  Deleting … Approving …  Subversion has a better diff algorithm (i.e.: one which is nothorrendous when dealing with non european text, unlike GNU's diff.) It'sopen source as well.Alexandre Carmel-Veilleux
Wednesday, April 13, 2005  Deleting … Approving …  

This topic is archived. No further replies will be accepted.