Closed kilianshi closed 1 month ago
I have the same issue
@kilianshi Not sure if you're still working on this, but I think I figured it out. The default timeout is 1 second, after which point dmp just gives you whatever it got through--which, since you and I are both working with long strings, results it it lumping the last part of the string together as one big change.
Before you run diff_main
, set the timeout to something bigger than 1 (or set to 0 for no timeout). Like this:
dmp = diff_match_patch()
dmp.Diff_Timeout = 0 # unlimited
dmp.diff_main(text1, text2)
Not sure why the demo site is so much more efficient, but there ya go
Thank you very much @lizfischer . it is very helpful.
Hello Team, first, thank you very much for creating this package.
I tested for one example, and I found different result on this demo website: https://neil.fraser.name/software/diff_match_patch/demos/diff.html
Differences
For two texts, i used the demo website, and this package, you can see from below the differences. And I have to reproduce the result from the demo website.
On the demo website I also noticed that there is this cost edit for efficiency cleanup. and it seems that in this package, we do not have this option.
With this package, since a big chunk is considered "deleted", I cut the screenshot into two parts:
Example texts and code
For reproduction purpose, there is the code :
Question
Could you please help me to find out why there is such difference?
Thank you