vb.net “最佳”差异算法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3144/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'Best' Diff Algorithm
提问by Chris Roberts
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.
我需要在 VB.NET 中实现一个 Diff 算法来查找一段文本的两个不同版本之间的变化。我在网上找了一个侦察员,发现了几种不同的算法。
Does anybody here know of a 'best' algorithm that I could implement?
这里有人知道我可以实现的“最佳”算法吗?
采纳答案by Calanus
Well I've used the c# version on codeproject and its really good for what I wanted...
嗯,我在 codeproject 上使用了 c# 版本,它非常适合我想要的......
http://www.codeproject.com/KB/recipes/diffengine.aspx
http://www.codeproject.com/KB/recipes/diffengine.aspx
You can probably get this translated into VB.net via an online converterif you can't do it yourself...
如果您不能自己完成,您可能可以通过在线转换器将其翻译成 VB.net ...
回答by Christian Lescuyer
I like An O(ND) Difference Algorithm and Its Variationsby Eugene Myers. I believe it's the algorithm that was used in GNU diff. For a good background see Wikipedia.
我喜欢Eugene Myers的 O(ND) 差分算法及其变体。我相信这是 GNU diff 中使用的算法。有关良好的背景,请参阅Wikipedia。
This is quite theoretical and you might wish to find source code, but I'm not aware of any in VB.
这是非常理论化的,您可能希望找到源代码,但我不知道 VB 中有任何源代码。
回答by Paul
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
我不确定它是否是最好的差异算法,但您可能想查看那些讨论 SOCT4 和 SOCT6 的链接
http://dev.libresource.org/home/doc/so6-user-manual/concepts
http://dev.libresource.org/home/doc/so6-user-manual/concepts
and also:
http://www.loria.fr/~molli/pmwiki/uploads/Main/so6group03.pdfhttp://www.loria.fr/~molli/pmwiki/uploads/Main/diffalgo.pdf
还有:
http: //www.loria.fr/~molli/pmwiki/uploads/Main/so6group03.pdf http://www.loria.fr/~molli/pmwiki/uploads/Main/diffalgo.pdf

