GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - google/diff-match-patch: Diff Match Patch is a high-performance library in multiple languages that manipulates plain text.

This repository was archived by the owner on Aug 5, 2024. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

44 Commits
44 Commits

Folders and files

NameName
Last commit message
Last commit date
cpp
cpp
 
 
csharp
csharp
 
 
dart
dart
 
 
demos
demos
 
 
java
java
 
 
javascript
javascript
 
 
lua
lua
 
 
objectivec
objectivec
 
 
python2
python2
 
 
python3
python3
 
 
.gitignore
.gitignore
 
 
AUTHORS
AUTHORS
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

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

  • API - Common API across all languages.
  • Line or Word Diffs - Less detailed diffs.
  • Plain Text vs. Structured Content - How to deal with data like XML.
  • Unidiff - The patch serialization format.
  • Support - Newsgroup for developers.

Languages

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

  • C++
  • C#
  • Dart
  • Java
  • JavaScript
  • Lua
  • Objective-C
  • Python

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.

About

Diff Match Patch is a high-performance library in multiple languages that manipulates plain text.

Topics

diffdifferencematchpatchtext-processing

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

8.1k stars

Watchers

2 watching

Forks

1.2k forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.