tags:

views:

1707

answers:

4

Hi,

I need to implement a Diff algorithm in VB.NET to find the changes between two different versions of a piece of text. I've had a scout around the web and have found a couple of different algorithms.

Does anybody here know of a 'best' algorithm that I could implement?

Thanks, - Chris

+6  A: 

Well I've used the c# version on codeproject and its really good for what I wanted...

http://www.codeproject.com/KB/recipes/diffengine.aspx

You can probably get this translated into VB.net via an online converter if you can't do it yourself...

Calanus
+3  A: 

I don't know for sure if it's the best diff algorithms but you might want to check out those links that talks about SOCT4 and SOCT6

http://dev.libresource.org/home/doc/so6-user-manual/concepts

and also:
http://www.loria.fr/~molli/pmwiki/uploads/Main/so6group03.pdf http://www.loria.fr/~molli/pmwiki/uploads/Main/diffalgo.pdf

Paul Celi
+2  A: 

I like An O(ND) Difference Algorithm and Its Variations by Eugene Myers. I believe it's the algorithm that was used in GNU diff. For a good background see Wikipedia.

This is quite theoretical and you might wish to find source code, but I'm not aware of any in VB.

Christian Lescuyer
A: 

I need to implement a Difference algorithm in C# or Vb.net to find the changes between two different versions of a piece of text.

I have used the c# version on codeproject and its really good for what I wanted...

http://www.codeproject.com/KB/recipes/diffengine.aspx

but in this code I am only getting the "Character Wise Difference" feature. But the one for which I am looking is "word wise difference" similar what you must have seen a wiki page does

Kamal Jindal