Private
calculateCalculate the Levenshtein distance between the start and end strings.
The initial string.
The resulting string.
The matrix to store the distances.
The matrix to store the path.
Private
calculateCalculate the matrix with the Levenshtein distance between the start and end strings.
The initial string.
The resulting string.
Whether to calculate the path or not.
The matrix with the distances and the path.
Optional
path?: Position[][]Private
compactCalculate differences between start string and end string and return the transformations list
The initial string.
The resulting string.
The list of operations to transform the start string into the end string.
Private
insert
Levenshtein algorithm. The Levenshtein algorithm is a method for finding the minimum number of operations needed to transform a string into another string. The allowed operations are insertion, deletion, and substitution.
See
https://en.wikipedia.org/wiki/Levenshtein_distance