Questions tagged [google-diff-match-patch]

Diff, Match and Patch libraries for Plain Text

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

Currently available in Java, JavaScript, Dart, C++, C#, Objective C, Lua and Python. Regardless of language, each library features the same API and the same functionality. All versions also have comprehensive test harnesses.

40 questions
0
votes
0 answers

Read text format using diff patch match

I am using diff match patch https://github.com/google/diff-match-patch to compare text of a html file and its working as expected. But the user want's to add a functionality to compare the format (bold, italic, underline) But the diff match patch…
Ramon bihon
  • 385
  • 1
  • 5
  • 18
0
votes
0 answers

How to compare the following file format?

I have to compare the two files having 50K records in each file. The records are in text file but in following format : Each line is having records. If the records are same in both the files (comparing line by line) then we have to find the…
rockersdeal
  • 71
  • 12
0
votes
0 answers

How to work with google diffs in C#?

listBox1.Items.Clear(); var dmp = new diff_match_patch(); var diffs = dmp.diff_main(richTextBox1.Text, richTextBox2.Text, true); foreach (var i in diffs) { listBox1.Items.Add(i); ; …
gyaka
  • 9
  • 2
0
votes
0 answers

How can I merge multiple annotations to the same text file?

Let's say I have a file that represents a "source document" with the following text: Source/Original Document: A quick brown fox jumped over the log This source document has been annotated by different authors who each have highlighted different…
Shaheeb Roshan
  • 611
  • 1
  • 7
  • 17
0
votes
1 answer

Java : Checking if 2 text-paragraphs are different giving error at delete sentence

I am working on a Java application which is for note-taking. Now, whenever the user edits the text in the note, I want to find the difference between the oldText and the newText so I can add it to history of that note. For this I am dividing each…
We are Borg
  • 5,117
  • 17
  • 102
  • 225
0
votes
1 answer

Example using DiffMatchPatch

I hope I am not breaking any rules here. I have a question about another post, but I am not a big user on stackoverflow, so my reputation is too low to add a comment to questions or answers that are not my own. On this question: How to compare…
Scot
  • 121
  • 5
0
votes
1 answer

Comparing 2 paragraph changes in Java

I am working on a Java webapp in which the user can make changes to a text area. In this, he can either write one paragraph, one sentence. So what I am currently trying to do is to split the whole paragraph by a dot separator. Once that is done, I…
We are Borg
  • 5,117
  • 17
  • 102
  • 225
0
votes
1 answer

Get rid of the HttpUtility error when compiling google-diff-match-patch in C#.NET?

I am getting the following error at compile time when trying to include the C# port of google-diff-match-patch: Error 1: The name 'HttpUtility' does not exist in the current context How do I eliminate this error? I am using the following profile:…
Doug
  • 5,116
  • 10
  • 33
  • 42
-1
votes
1 answer

Side by side html diff_match_patch

import diff_match_patch old_string = """I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my…
PRIME
  • 73
  • 1
  • 3
  • 10
-1
votes
2 answers

How to set up google-diff-match-patch C# library

So I am a newbie and I couldn't find a proper answer to this on the internet. After digging a little bit here is what I came up with.
Priyanka
  • 107
  • 13
1 2
3