C# 比较算法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/65199/
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
C# compare algorithms
提问by public static
Are there any open source algorithms in c# that solve the problem of creating a difference between two text files?
c#中是否有任何开源算法可以解决在两个文本文件之间创建差异的问题?
It would be super cool if it had some way of highlighting what exact areas where changed in the text document also.
如果它有某种方式突出显示文本文档中发生更改的确切区域,那将是非常酷的。
回答by eladv
回答by cfeduke
There is Menees Diffwhich will provide you with a C# diff implementation. The source code is included. I've used it in the past with good success wrapping it in my own implemenation.
有Menees DIFF这将为您提供一个C#diff实现。包含源代码。我过去使用过它并成功地将它包装在我自己的实现中。
回答by Tarek Mohamed
check this link "good line by line Diff Algorithm " http://www.codeproject.com/KB/recipes/diffengine.aspx
检查此链接“良好的逐行差异算法” http://www.codeproject.com/KB/recipes/diffengine.aspx
回答by Goran
There's also a c# port of Google's (Neil Fraser) diff, match and patch.
还有谷歌 (Neil Fraser) diff, match 和 patch的 ac# 端口。