This module implements an algorithm to compute the diff between two sequences of lines.
Procs
proc diffInt(arrayA, arrayB: openArray[int]): seq[Item] {...}{.raises: [], tags: [].}
-
Find the difference in 2 arrays of integers.
arrayA A-version of the numbers (usualy the old one)
arrayB B-version of the numbers (usualy the new one)
Returns a array of Items that describe the differences.
Source Edit proc diffText(textA, textB: string): seq[Item] {...}{.raises: [KeyError], tags: [].}
-
Find the difference in 2 text documents, comparing by textlines.
The algorithm itself is comparing 2 arrays of numbers so when comparing 2 text documents each line is converted into a (hash) number. This hash-value is computed by storing all textlines into a common hashtable so i can find dublicates in there, and generating a new number each time a new textline is inserted.
textA A-version of the text (usually the old one)
textB B-version of the text (usually the new one)
Returns a seq of Items that describe the differences.
Source Edit