JoshData / fast_diff_match_patch

Python package for Google's diff-match-patch native C++ implementation.
https://pypi.org/project/fast-diff-match-patch/
Apache License 2.0
73 stars 27 forks source link

Lines diff #23

Closed edgarsgogolevs closed 7 months ago

edgarsgogolevs commented 2 years ago

Is it possible to get difference of the lines of two strings? In default diff-match-patch python library I used diff_linesToChars_ and diff_charsToLines methods. Is there something similar I can do with this library?

JoshData commented 7 months ago

Better late than never?

You could implement the same strategy as DMP, which is that it splits the input into lines, assigns each unique line a character, and then performs a character diff on those lines-as-characters inputs. After the diff, each character in the output can be re-expanded to its original line.

Since it's been a year and a half and you've probably moved on :), I'm closing this issue.