google-diff-match-patch

yzmm
606 阅读
一个google多语言diff源码和测试类,支持的语言有:Java, JavaScript, Dart, C++, C#, Objective C, Lua and Python。这货很方便,对比之后还可以生成html的diif代码片段。不是什么新玩意,项目最后更新时间是2012年。

项目地址:https://code.google.com/p/google-diff-match-patch/

源码和测试类:

http://pan.baidu.com/s/1ntG6kat

google-diff-match-patch:用于对文本进行比对,匹配和补缀。它提供了强大的算法来进行同步纯文本所需的操作。

  1. Diff:

    • Compare two blocks of plain text and efficiently return a list of differences.
    • Diff Demo

  2. Match:

    • Given a search string, find its best fuzzy match in a block of plain text. Weighted for both accuracy and location.
    • Match Demo

  3. Patch:

    • Apply a list of patches onto plain text. Use best-effort to apply patch even when the underlying text doesn't match.
    • Patch Demo

当前支持Java, JavaScript, Dart, C++, C#, Objective C, Lua 和Python等编程语言。所提供的每种语言版本都具有相同的API和相同的API。

评论 (0)

发表评论