Open ash-lionell opened 3 years ago
I can confirm this issue. Here's my example in javascript:
var text1 = 'I ate a red apple.';
var text2 = 'I ate a green apple.';
var dmp = new diff_match_patch();
var diffs = dmp.diff_main(text1, text2);
dmp.diff_cleanupSemantic(diffs);
Result:
EQUAL "I ate a "
INSERT "g"
EQUAL "re"
DELETE "d"
INSERT "en"
EQUAL " apple."
Expected result:
EQUAL "I ate a "
INSERT "green"
DELETE "red"
EQUAL " apple."
@NeilFraser Please support this issue. 🙇🏻
For the following input:
The diff cleanup returns:
As expected.
But for some other texts like:
The diff cleanup returns:
Whereas, it should've cleaned up the last word text/test and shown it as one DELETE/INSERT operation.
Observed this behavior in both Java and Javascript bindings.