Apache License 2.0

项目介绍

google/diff-match-patch 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 8.1k 个 Star、1.2k 次 Fork。

仓库全名
google/diff-match-patch
开源许可证
Apache License 2.0
Star 数
8.1k
Fork 数
1.2k
未关闭 Issue
98

README 摘要

The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text. 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

diff-match-patch 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 8.1k 个 Star。

diff-match-patch 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 diff-match-patch 的源码?

可以直接克隆仓库:git clone https://github.com/google/diff-match-patch.git;安装与运行步骤见仓库 README。

diff-match-patch 最近还在维护吗?

仓库最近一次更新为 2024年5月23日,当前有 98 个未关闭 Issue;Star 数为 8.1k,可作为社区活跃度的参考。

简要分析

热度分
18610
价值分
6040
活跃状态
归档

语言占比

C
C#
C++
Dart
HTML
Java
JavaScript
Lua
Objective-C
Python
QMake

README

The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text.

  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

Originally built in 2006 to power Google Docs, this library is now available in C++, C#, Dart, Java, JavaScript, Lua, Objective C, and Python.

Reference

Languages

Although each language port of Diff Match Patch uses the same API, there are some language-specific notes.

A standardized speed test tracks the relative performance of diffs in each language.

Algorithms

This library implements Myer’s diff algorithm which is generally considered to be the best general-purpose diff. A layer of pre-diff speedups and post-diff cleanups surround the diff algorithm, improving both performance and output quality.

This library also implements a Bitap matching algorithm at the heart of a flexible matching and patching strategy.

评论

暂无评论