functional_edit_distance
v1.0.7
Published
A simple edit distance implementation in Typescript
Downloads
2
Readme
String Compare Package
This is a package that allows you to find the quickest possible differences between two strings.
We use the levenshtein distance formula to find the least amount of possible changes between two string. With these differences We then map them into an array of objects that provide you with the error location and content.
DP Table:
ex: nick -> justin
Through this method we determine where the 'divergences' in the paths between the two strings are and proceed to start from the end solution.
We start at the bottom right corner and traverse up finding the smallest number of changes until we get back to the origin.
We transform the results into the error of errors through this process and return an array of the following type:
where grouped errors (char 1-3 && all are 'delete' operations) are grouped together as one object in the array.
EX: nick -> justin
Co-authored-by: Justin [email protected] && Nick [email protected]