@velocitycareerlabs/string-matching
v1.24.3
Published
returns the closest suggestion from an inputted array using levenshtein distance
Downloads
955
Readme
Levenshtein Distance package
Finds the closest suggestion using shortest Levenshtein Distance from fastest-levenshtein npm package
Exposes 'getClosest' function which takes two parameters, the inputted incorrect string, and an array of correct possibilities.
Example
add "@velocitycareerlabs/string-matching": "0.5.0-build" to package.json
const { getClosest } = require('@velocitycareerlabs/string-matching');
const closestLevenshteinDistance = await getClosest('fast', ['slow', 'faster', 'fastest']);
Returns
faster
