julienmarie / google-diff-match-patch Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/google-diff-match-patch
License: Apache License 2.0
Automatically exported from code.google.com/p/google-diff-match-patch
License: Apache License 2.0
Diff, Match and Patch Library http://code.google.com/p/google-diff-match-patch/ Neil Fraser This library is currently available in seven different ports, all using the same API. Every version includes a full set of unit tests. C++: * Ported by Mike Slemmer. * Currently requires the Qt library. C#: * Ported by Matthaeus G. Chajdas. Dart: * The Dart language is still growing and evolving, so this port is only as stable as the underlying language. Java: * Included is both the source and a Maven package. JavaScript: * diff_match_patch_uncompressed.js is the human-readable version. Users of node.js should 'require' this uncompressed version since the compressed version is not guaranteed to work outside of a web browser. * diff_match_patch.js has been compressed using Google's internal JavaScript compressor. Non-Google hackers who wish to recompress the source can use: http://dean.edwards.name/packer/ Lua: * Ported by Duncan Cross. * Does not support line-mode speedup. Objective C: * Ported by Jan Weiss. * Includes speed test (this is a separate bundle for other languages). Python: * Two versions, one for Python 2.x, the other for Python 3.x. * Runs 10x faster under PyPy than CPython. Demos: * Separate demos for Diff, Match and Patch in JavaScript.
What steps will reproduce the problem?
1. create a node app
2. var diff = require("./lib/diff_match_patch.js");
3. run the app
What is the expected output? What do you see instead?
The app should run. Instead I get "ReferenceError: window is not defined".
Looks like this lib is assuming a browser environment.
What version of the product are you using? On what operating system?
Looks like diff_match_patch_20110603. OS X 10.6.8.
Please provide any additional information below.
Original issue reported on code.google.com by *[email protected]
on 12 Jul 2011 at 6:58
Diff sometimes doesn't find what should be trivial differences.
What steps will reproduce the problem?
1. Use the website to compare the two attached texts
2. Compare v1text to v2text
3. Compare v2text to v1text
What is the expected output? What do you see instead?
The only difference between these two texts is the years. 2009 vs 2010
In one case this is computed correctly.
In the other case, you see one large block of text inserted, and
another large block of text deleted. (timeout was set to 0)
What version of the product are you using? On what operating system?
http://neil.fraser.name/software/diff_match_patch/svn/trunk/demo/demo_diff.html
Please provide any additional information below.
Shouldn't the output be symmetric?
Original issue reported on code.google.com by [email protected]
on 19 Jan 2011 at 9:57
Attachments:
The C++ header file "diff_match_patch.h" doesn't include the QT types it uses,
which force users of this header to include then in the each file that include
the header.
IMO will be better to put the required QT includes in "diff_match_patch.h"
The required includes are
#include <QString>
#include <QList>
#include <QMap>
#include <QVariant>
Original issue reported on code.google.com by [email protected]
on 23 Dec 2010 at 9:34
By just copying and pasting the pure Python version of diff-match-patch to a
pyx file and compiling it with Cython, the time it takes to compare the
speedtest text files with the provided unit test, was cut in half.
Original issue reported on code.google.com by [email protected]
on 19 Jan 2011 at 10:40
[code]
# -*- coding: utf-8 -*-
from diff_match_patch import diff_match_patch
dmp = diff_match_patch()
str1 = """Привет!"""
str2 = """Привет and Welcome!"""
patches = dmp.patch_make(str1, str2)
#print dmp.patch_toText(patches)
print dmp.patch_apply(patches, str1)[0]
[\code]
$ python dmp.py
Traceback (most recent call last):
File "dmp.py", line 14, in <module>
print dmp.patch_apply(patches, str1)[0]
File "/data/Coding/Python/diff_match_patch.py", line 1401, in patch_apply
text = nullPadding + text + nullPadding
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0:
ordinal not in range(128)
Original issue reported on code.google.com by [email protected]
on 15 May 2008 at 6:44
Want to use Cyrillic characters with diff_match_patch (python version,
release), but got errors like:
"UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0:
unexpected end of data"
appending in some places to strings ".decode("utf-8").encode("utf-8")",
seem to solve the problems, but I guess not 100%.
see the attached patch (and for any case new file).
Alexandr.
Original issue reported on code.google.com by [email protected]
on 11 May 2008 at 1:12
Attachments:
pepone@sirius ~/projects/cmsdemo/server $ diff
/home/pepone/diff_match_patch_20101216/cpp/diff_match_patch.cpp
diff_match_patch.cpp
22a23
> #include <limits>
70c71
< qDebug(qPrintable(QString("Diff(") + strOperation(operation) +
QString(",\"")
---
> qDebug("%s", qPrintable(QString("Diff(") + strOperation(operation) +
QString(",\"")
Original issue reported on code.google.com by [email protected]
on 23 Dec 2010 at 9:16
While it *does* report differences, it tends to pick the largest diff that
it can (rather than more, smaller, diffs).
Choose a large (10MB or so) text file with lots of carriage returns -- an
XML file formatted for readability will do -- and permute it with the
following algorithm (this is Ruby code; $. is the current line in the
input, and gsub! alters the current string):
for x in STDIN
if $. % 1000 == 0
deleted = x
elsif $. % 100 == 0
puts deleted if deleted
elsif $. % 10 == 0
x.gsub!(/>.*</, ">XY<")
puts x
else
puts x
end
end
This deletes every 1000'th line, inserts the previously deleted line every
100'th line, and alters every 10'th line.
diff_match_patch reported the following changes:
Operation String size
EQUAL 339
DELETE 13934676
INSERT 13860601
EQUAL 92
So, basically, it reported that the whole file had changed. The same two
files run through GNU diff resulted in 36766 differences. A corresponding
patch made from diff_match_patch would have resulted in a patch file almost
as big as the original file (nearly 14MB); the patch file from GNU diff was
around 3MB, or 1/4 the size. This means that that the algorithm used by
diff_match_patch produces extremely inefficient patches.
Incidentally, setting the "checklines" flag to false actually results in a
*faster*, not slower, diff, although the resulting reported differences
don't vary greatly.
This is with 20090501 with Java 1.6.0 on Ubuntu Intrepid.
Original issue reported on code.google.com by seanerussell
on 7 Jun 2009 at 12:21
What steps will reproduce the problem?
1. Submit an issue (like issue #48 - a random totally unbiased example,
guaranteed)
2. Have someone awesome (like Neil Fraser himself!) answer your issue and mark
it "Done"
3. Post some additional trouble to your issue thread
What is the expected output? What do you see instead?
Unmarking the issue as "Done" is not possible, causing the issue's additional
trouble to go unnoticed and effectively leaving unresolved issues marked as
"Done"...
What version of the product are you using? On what operating system?
Google code, on the internet
Please provide any additional information below.
I like pizza.
Original issue reported on code.google.com by [email protected]
on 6 Jun 2011 at 1:29
diff_main accepts two Strings as arguments. When one of them is null, diff_main
fails with a NullPointerException.
How about making it null-pointer safe, like the apache-commons StringUtils?
Patch is attached
Original issue reported on code.google.com by [email protected]
on 10 Jun 2010 at 7:39
Attachments:
Sonatype has some good resources.
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage
+Guide
Being in Central would make it much easier to consume. With the corporate
build system I'm using, I can't even reference the SVN-based Maven repo that
dmp is currently in.
Original issue reported on code.google.com by [email protected]
on 7 Feb 2011 at 8:20
Please provide any additional information below.
First of all, thank you for your great work on this library.
I would like to be able to import the Python implementation as a module so
that I can keep a checkout of the python folder in our common directory
(which is on every system's Python path). If it functioned as a module,
then I wouldn't have to modify all Python paths and treat diff_match_patch
as an edge-case (it could just be checked out directly in the common, or
any folder on the path, and it will Just Work). This will also work for
anyone else who has a common directory already on their path and wants to
use diff_match_patch without modification of their path or creation of
symlinks.
Fix:
Create __init__.py in the python directory, with this inside:
from .diff_match_patch import diff_match_patch, patch_obj
As I understand it (via http://www.python.org/dev/peps/pep-0328/), this
relative import syntax should be compatible with 2.4 or greater. Thanks!
Original issue reported on code.google.com by [email protected]
on 28 Aug 2009 at 4:29
Problem:
Unchecked cast from Object to ArrayList<String> in diff_match_patch.java on
line 229 in function diff_compute.
What is the expected output? What do you see instead?
No warnings should be produced
What version of the product are you using?
diff_match_patch_20090615.zip
Solution:
Create a new class diff_linesToChars_result with public the following
signature:
public String chars1;
public String chars2;
public List<String> lineArray;
See attachement
Original issue reported on code.google.com by [email protected]
on 17 Jul 2009 at 7:12
Attachments:
Would be nice to have a method that print a diff like Google Code does:
http://code.google.com/p/google-diff-match-patch/source/diff?spec=svn85&r=85&for
mat=side&path=/trunk/javascript/diff_match_patch_uncompressed.js#sc_svn83_240
The changed lines are highlighted. The diff_prettyHtml method doesn't do that.
Original issue reported on code.google.com by [email protected]
on 11 Feb 2011 at 1:45
What steps will reproduce the problem?
1. use for compare diff in HTML (with tags)
What is the expected output? What do you see instead?
compare like knol
What version of the product are you using? On what operating system?
diff_match_patch_20090202
Please provide any additional information below.
any sugestion???
Original issue reported on code.google.com by [email protected]
on 5 Mar 2009 at 5:10
What steps will reproduce the problem?
I attached a JS file which reproduces the problem.
What is the expected output? What do you see instead?
Error: Pattern too long for this browser.
What version of the product are you using? On what operating system?
javascript running on Rhino, java 1.5
Please provide any additional information below.
the patch causing that problem is created by patch_fromText() and a
subsequent reverting of the patch (changing DELETES into INSERTS - that's
why the first status field says "-0").
Original issue reported on code.google.com by [email protected]
on 7 Sep 2009 at 11:26
Attachments:
What steps will reproduce the problem?
1. use java API: diff_main(String text1, String text2).
text1 = "this is a test";
text2 = "this is a test A";
2. LinkedList<Diff> diff = diff_main(String text1, String text2);
3. in "LinkedList<Diff> diff", I can't get "index" of in Diff Class.
What is the expected output? What do you see instead?
expected output: index = 16
but index always equal -1
What version of the product are you using? On what operating system?
version:20071106, java
OS: windows XP
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Dec 2007 at 2:55
There is an error in diff_match_patch.cpp on line 438:
436 if (!front) {
437 int k1 = delta - k2;
438 if (v2.contains(k2)) {
439 int x1 = v1.value(k1);
It should have been the following:
438 if (v1.contains(k1)) {
Original issue reported on code.google.com by [email protected]
on 12 Jan 2011 at 1:25
I'm getting an issue by calling the function diff_main, with the text in the
file first_arg in first arg and the text in the file second_arg in second arg,
it displays me the stack trace :
java.lang.ArrayIndexOutOfBoundsException: 2
diff_match_patch.diff_bisect(diff_match_patch.java:374)
diff_match_patch.diff_compute(diff_match_patch.java:296)
diff_match_patch.diff_main(diff_match_patch.java:198)
diff_match_patch.diff_compute(diff_match_patch.java:274)
diff_match_patch.diff_main(diff_match_patch.java:198)
diff_match_patch.diff_main(diff_match_patch.java:153)
diff_match_patch.diff_main(diff_match_patch.java:132)
Thanks in advance
Francis
Original issue reported on code.google.com by [email protected]
on 21 Jan 2011 at 9:25
Attachments:
It would be really awesome if there was a a ColdFusion implementation of this,
or a "how to use with ColdFusion". I know adding jar files to ColdFusion server
is very easy, but I'm not sure what would be required to integrate the utility
and use it with a UDF...
Anyone aware of any CF implementations out there?
Original issue reported on code.google.com by [email protected]
on 4 Jan 2011 at 3:51
---What steps will reproduce the problem?
1. Try implementing the "Word Mode" explained here
http://code.google.com/p/google-diff-match-patch/wiki/LineOrWordDiffs
2. Diff some stuff
3. Eat pizza
---What is the expected output? What do you see instead?
We should have the choice of determining what is a "word". Does it include the
delimiter (whitespace) before it? Does it include the delimiter following it?
Is the delimiter itself considered a separate 'word' in its own right?
Instead, the decision seems to have been hardcoded that the word-delimiter
(whitespace in my case) is part of the previous word.
---What version of the product are you using? On what operating system?
JavaScript version
Windows XP
Testing with IE8 and Chrome
---Please provide any additional information below.
I need every word-delimiter (whitespace in my case) to be considered a separate
'word' in its own right. Any quick fixes to do this please?
Original issue reported on code.google.com by [email protected]
on 19 May 2011 at 4:33
What steps will reproduce the problem?
1. download diff_match_patch.java
2. compile it
What is the expected output? What do you see instead?
expected: compiled
I see: no Diff class
Original issue reported on code.google.com by [email protected]
on 13 Jun 2007 at 3:34
I'm using the C# version of the code. I get a 'System.OutOfMemoryException'
with the two attached files. Note that these files are not similar at all,
apart from being XML files, and the one is very large. The exception occurs in:
protected List<Diff> diff_map(string text1, string text2)
This is the code I use to call it:
var dmp = new DiffMatchPatch.diff_match_patch();
dmp.Diff_Timeout = 0;
dmp.Diff_EditCost = 4;
dmp.Match_Threshold = 0.5F;
var diffs = dmp.diff_main(text1, text2, true);
Original issue reported on code.google.com by [email protected]
on 9 Aug 2010 at 11:11
Attachments:
On the diff demo I tried comparing edits in an article and it's highlighting
most of the text, instead of the minor changes.
http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html
text for left box: http://dl.dropbox.com/u/4055661/text1.txt
text for right box: http://dl.dropbox.com/u/4055661/text2.txt
Original issue reported on code.google.com by [email protected]
on 27 Apr 2011 at 8:03
Hello,
as I could see the library is very good.
I need one more functionality in diff, the CHANGED lines.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2008 at 10:27
I just downloaded the new diff_match_patch_20101028.zip.
I don't think this line (from r70) in diff_match_patch_test.cpp is correct:
896 + QString resultStr = + "\t" + sprintf(str, "%s\t%d", results.first,
boolArray.count());
Original issue reported on code.google.com by [email protected]
on 29 Oct 2010 at 1:34
when i compare the following two text on sit
"ZHEJIANG JIANGLONG TEXTILE PRINTING" and
"ZHEJIANG JIANGLIMEI KNITTING CLOTH"
with Match balance=0.6 and Match threshold: 0.4
i have two results:
The first when using Demo of Match on the site(JavaScript)the result is
don't match
the second result when using java code in my application the result is
match ok (found)
what is the difference?
Original issue reported on code.google.com by [email protected]
on 9 Sep 2008 at 12:12
In diff_match_patch::diff_cleanupMerge the 'if (count_delete != 0 &&
count_insert != 0)' is always true because it is proceeded by 'while
(count_delete-- > 0)' & 'while (count_insert-- > 0)'.
I think the test was supposed to be before the variables were decremented.
Luckily (or not) this only results in consuming extra cycles.
This same bug appears in the Java version, but not in the C#, JavaScript, Lua
or Python versions.
Patch for C++ attached.
Original issue reported on code.google.com by [email protected]
on 4 Nov 2010 at 1:36
Attachments:
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 28 Jun 2007 at 11:53
Awesome piece of implementation.
I would love to create the C# version myself but being ignorant about the
algorithms I could make silly mistakes.
Would you consider creating a C# version?
Original issue reported on code.google.com by [email protected]
on 6 Feb 2008 at 4:49
Compiling project generates a warning for line 221:
linearray = (ArrayList<String>) b[2];
results in:
Type safety: Unchecked cast from Object to ArrayList<String>
This can be worked around by ignoring warnings of course, so I'm not clear
on whether this is important or not (a relative noob at Java). My apologies
if this is normal behaviour.
What version of the product are you using? On what operating system?
Version 20080624
Built in Eclipse with java 1.6.0.10 on Ubuntu 8.10
Original issue reported on code.google.com by [email protected]
on 8 Nov 2008 at 6:23
What steps will reproduce the problem?
1. Download the attached sample files (two whitespace-simplified versions
of a generated source file in the Hadoop project).
2. Use the library to compute the diff. The diff timeout would have to be
increased significantly or set to 0.0f.
What is the expected output? What do you see instead?
GNU diff computes a diff with about 1260 edit steps in 0.125s on my
machine. diff-match-patch with the diff timeout removed fails to terminate
in both its C++ and Java versions, consuming all available system memory.
What version of the product are you using? On what operating system?
Latest svn trunk on GNU/Linux amd64.
Please provide any additional information below.
The attached files are just an extreme example; I have also found it
infeasible to compute a diff between two files of about 2000 lines each in
Java with a 2G heap. The timeout prevents all memory from being used, but
results in a trivial "delete A, insert B" diff, which is not useful.
Original issue reported on code.google.com by [email protected]
on 20 Jan 2010 at 12:03
Attachments:
What steps will reproduce the problem?
var dmp = new diff_match_patch();
var last = 'abcdefghij , h : 1 , t : 1 abcdefghij , h : 1 , t :
1 abcdefghij , h : 0 , t : 1';
var current = 'abcdefghij , h : 0 , t : 1 abcdefghij , h : 0
, t : 1 abcdefghij , h : 0 , t : 1';
var patches = dmp.patch_make(current, last);
var mod_current = 'abcdefghij , h : 0 , t : 1 abcdefghij , h : 1
, t : 1 abcdefghij , h : 0 , t : 1';
var res = dmp.patch_apply(patches, mod_current);
What is the expected output? What do you see instead?
Expect patch to succeed or fail. Actually it throws an error "Pattern too
long for this browser". Only affects JavaScript version (the bug is also
in the Python version but is never expressed).
Fathei Ali reported this error and I tracked it down to an indexing bug in
patch_splitMax. Most of the time this would have no effect, but very
occasionally it fails to split a long patch.
A new version has been pushed which corrects this bug and unit tests have
been added in all languages for verification.
Original issue reported on code.google.com by [email protected]
on 4 Dec 2008 at 5:50
Consider the left text :
AAA
BBB EEE
and the right text
AAA
BBB DDD
BBB EEE
To the human eye, it's obvious that the middle was added.
However, gdmp (and other character level diff algorithms I tried) see it
differently, spanning the
added string ("DDD\nBBB") over two lines.
Of course it makes sense from a computational standpoint, but that should at
least be cleaned
up by the cleanup functions, which should try to minimize the number of lines.
What do you think ?
Original issue reported on code.google.com by [email protected]
on 20 Jun 2008 at 9:35
Google Code does not currently send any notification to me when a new issue
is added to this list. Since there are virtually no issues with my code
(gloat), I don't visit this page often.
So if you don't want to be ignored, send me an email to let me know that
you've filed a new bug:
http://neil.fraser.name
Thanks!
Original issue reported on code.google.com by [email protected]
on 29 Jun 2007 at 1:32
The comments on the API page hint that at least a partial PHP conversion is
available.
It should be committed to the repository with the other code.
Make sure to clearly specify the license for PHP code.
Original issue reported on code.google.com by mikko.rantalainen
on 1 Jul 2010 at 7:46
What steps will reproduce the problem?
1. Create a solution including projects in C# language
2. Reference the nUnit framework and Microsoft Test Framework in a test project
3. Run TestMethod named: 'diff_bisectTest'
What is the expected output? What do you see instead?
Excpected output is a 'success'
What version of the product are you using? On what operating system?
I'm using VS 2008 running on a Windows 7 32bit. The code for google diff was
downloaded from: 'diff_match_patch_20110217.zip'
Please provide any additional information below.
The problem is simple and was solved changing one line of code that occours
twice on the same test method named 'diff_bisectTest':
from: Assert.AreEqual(diffs, dmp.diff_bisect(a, b, DateTime.MaxValue));
to: CollectionAssert.AreEqual(diffs, dmp.diff_bisect(a, b, DateTime.MaxValue));
Original issue reported on code.google.com by [email protected]
on 4 Apr 2011 at 5:56
Usually diff_cleanupSemantic does an excellent job :-).
However, in this case it appears to have a problem.
What steps will reproduce the problem?
In JavaScript (with default settings):
var a='\tS += "</table><pre style=\'display:none\'>";\n'+
'\tS += text.replace(/>/g, \'>\');\n'+
'\tS += "</pre></li></ul></div>\\n";';
var b='\n'+'\tt = lines.join(\'\\n\').replace(/>/g, \'>\');\n'+
'\tS += "</table><pre style=\'display:none\'>".concat(t, "</pre></li></ul></div>\\n");';
var DMP = new diff_match_patch;
var d=DMP.diff_main(a,b);
DMP.diff_cleanupSemantic(d);
for (var i in d) print('{',d[i][0],', "',d[i][1],'"}');
The output is as follows (which is basically the same as with no cleanup):
{ -1 , " S "}
{ 1 , "
t "}
{ 0 , " "}
{ -1 , " + "}
{ 0 , " = "}
{ -1 , " "</tab "}
{ 0 , " l "}
{ 1 , " in "}
{ 0 , " e "}
{ -1 , " ><pre "}
{ 0 , " s "}
{ -1 , " tyle='d "}
{ 1 , " .jo "}
{ 0 , " i "}
{ -1 , " splay: "}
{ 0 , " n "}
{ -1 , " o "}
{ 1 , " ('\ "}
{ 0 , " n "}
{ -1 , " e "}
{ 0 , " ' "}
{ -1 , " >";
S += text "}
{ 1 , " ) "}
{ 0 , " .replace(/>/g, '>');
S += "}
{ 1 , " "</table><pre style='display:none'>".concat(t, "}
{ 0 , " "</pre></li></ul></div>\n" "}
{ 1 , " ) "}
{ 0 , " ; "}
What version of the product are you using? On what operating system?
diff_match_patch_20080520.zip on Mac OS X 10.4.7
Please provide any additional information below.
Deleting the '\n' at the beginning of var b reduces the diff from 31 to 9
elements. As follows:
{ 0 , " "}
{ -1 , " S += "</table><pre style='display:none'>";
S += text.replace(/>/g, '>');
S += "}
{ 1 , " t = lines.join('\n').replace(/>/g, '>');
S += "</table><pre style='display:none'>".concat(t, "}
{ 0 , " "</pre></li></ul></div>\n" "}
{ 1 , " ) "}
{ 0 , " ; "}
Original issue reported on code.google.com by [email protected]
on 25 May 2008 at 12:42
I haven't tried the new version yet, but this looks, to me, like it leaks:
380: int *v1 = new int[v_length];
381: int *v2 = new int[v_length];
<http://code.google.com/p/google-diff-match-patch/source/browse/trunk/cpp/diff_m
atch_patch.cpp?spec=svn85&r=85#380>
I don't see any `delete [] v1;` or `delete [] v2;`.
After all this is only C++ ... no garbage collectors here ;-).
Original issue reported on code.google.com by [email protected]
on 22 Jan 2011 at 8:50
It would be extremely handy if users could use "pip install diff-match-patch"
or "easy_install diff-match-patch" to install install the Python library from
http://pypi.python.org/
Original issue reported on code.google.com by [email protected]
on 13 Apr 2011 at 1:48
A pointer to the previous Diff is only assigned once and never advances.
Try to double delete/insert pair in the test for overlap elimination:
<del>abcxx</del><ins>xxdef</ins><del>abcxx</del><ins>xxdef</ins>
Original issue reported on code.google.com by [email protected]
on 14 Jan 2011 at 9:22
Hello,
i like it and would use it in Flex so can you write a actionscript
implementation?
Original issue reported on code.google.com by [email protected]
on 11 Feb 2008 at 2:16
* What steps will reproduce the problem?
I have attached a demonstration of the issue. This creates a patch between
two strings. It then tries to apply the patch to the first string to get
the second string.
* What is the expected output? What do you see instead?
When applying the patch, an IllegalArgumentException is thrown. The patch
created has the following invalid header on the second chunk:
@@ --2,32 +9,36 @@
* What version of the product are you using? On what operating system?
Latest version (20090202) on OS/X, Java 6 - but also occurs on Linux.
* Please provide any additional information below.
None.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2009 at 6:58
Attachments:
In browser-side JavaScript, file size matters a lot. It would be nice if there
was a well-documented easy way to get rid of the code that wasn't needed for
Match and Patch if all you care about is the Diff features, for instance.
Original issue reported on code.google.com by philfreo
on 4 May 2011 at 10:01
Why is it required to have the QT Library for C++? That's a big chunk of
code just to use QList and QString (Maybe there is more I'm not seeing).
Why not use the C++ Standard Library?
Original issue reported on code.google.com by bradleelandis
on 8 Sep 2009 at 8:42
This is a great piece of code. I have one concern on the compariosn. Is it
possible to chnage the logic in such a way that it does word by word
comparison?
I have written following test code in java
========================================================================
String text1="Hello how are you. <br/> My name is Prathyusha. Shravanthi
is my friend.";
String text2="Hello. <br/>My name is Shravanthi. Prathyusha was my
friend.";
diff_match_patch diff = new diff_match_patch();
LinkedList<diff_match_patch.Diff> diffs = diff.diff_main(text1, text2);
diff.diff_cleanupSemantic(diffs);
String result = diff.diff_prettyHtml(diffs);
System.out.println(result);
=====================================================================
I see the following output
--------------------------------------------------------
Hello<DEL> how are you</DEL>. <br/><DEL> </DEL>My name is <DEL>Prathyusha.
Shravanthi i</DEL><INS>Shravanthi. Prathyusha wa</INS>s my friend.
--------------------------------------------------------
As the output shows the logic doesn't break the differences into logical
words. Rather it does comparison on a chunk of string. Word by word
comparison would help in getting a precise count of the newly added words
and the deleted words. Additinally if we check the deleted
<DEL>Prathyusha. Shravanthi i</DEL> text and the inserted <INS>Shravanthi.
Prathyusha wa</INS> text, the middle chars ' ' and '.' are common. They
should not be considered as deleted and inserted. This problem wouldn't
have arised if we do a word by word comparison. The word count in all is
increased by 4 conidering ' ' and '.' as 2 words.
Is it possible to do a word by word comparison?
Regards,
Pratap
Original issue reported on code.google.com by [email protected]
on 4 Jul 2009 at 1:51
Do you plan to implement Perl version?
If not, I would like to do.
Is it OK?
Original issue reported on code.google.com by [email protected]
on 26 Jan 2011 at 5:49
I may be interested helping.
Original issue reported on code.google.com by [email protected]
on 8 Apr 2008 at 8:06
diff_match_patch.py:430: SyntaxWarning: assertion is always true, perhaps
remove parentheses?
assert (text1[x] == text2[y],
diff_match_patch.py:475: SyntaxWarning: assertion is always true, perhaps
remove parentheses?
assert (text1[-x - 1] == text2[-y - 1],
diff_match_patch.py:1158: SyntaxWarning: assertion is always true, perhaps
remove parentheses?
assert (self.Match_MaxBits == 0 or len(pattern) <= self.Match_MaxBits,
SyntaxWarning: assertion is always true, perhaps remove parentheses?
assert (False, "Unknown call format to patch_make.")
Original issue reported on code.google.com by [email protected]
on 2 May 2009 at 12:54
What steps will reproduce the problem?
1. Look at the source code
What is the expected output? What do you see instead?
Given the datestamp in the filename, I would assume that the copyright
notice would be dated 2008 instead of 2006.
Note that the JavaScript file hasn't got any copyright notice at all.
What version of the product are you using? On what operating system?
diff_match_patch_20080426.zip
Please provide any additional information below.
This is obviously a purely cosmetic issue.
Original issue reported on code.google.com by [email protected]
on 29 Apr 2008 at 7:56
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.