add (optional) diff and text columns to output.
This commit is contained in:
@@ -16,10 +16,10 @@ import pywikidiff2
|
||||
class DiffToOperationMap:
|
||||
def __init__(self, diff, tokenizer):
|
||||
self.tokenizer = tokenizer
|
||||
self.diff = json.loads(diff)
|
||||
self.from_par_move_dict = {}
|
||||
self.to_par_move_dict = {}
|
||||
self.highlights_without_offset = []
|
||||
self.diff = diff
|
||||
# we need to keep track of the bytes of line numbers to recover when wikidiff2 loses offsets.
|
||||
self.to_linenumber_bytes_map: SortedDict[int, int] = SortedDict()
|
||||
self.from_linenumber_bytes_map: SortedDict[int, int] = SortedDict()
|
||||
@@ -375,7 +375,7 @@ class WikiDiffMatcher:
|
||||
numContextLines=1000000, moved_paragraph_detection_cutoff=200000
|
||||
)
|
||||
# Pre-compute diffs to reduce traffic overhead.
|
||||
self.diffs = differ.inline_json_diff_sequence(list(texts))
|
||||
self.diffs = [json.loads(diff) for diff in differ.inline_json_diff_sequence(list(texts))]
|
||||
self.tokenizer = tokenizer or TOKENIZER
|
||||
|
||||
class Processor(DiffEngine.Processor):
|
||||
|
||||
Reference in New Issue
Block a user