|
|
hace 5 años | |
|---|---|---|
| .. | ||
| LICENSE | hace 5 años | |
| README.md | hace 5 años | |
| index.d.ts | hace 5 años | |
| index.flow.js | hace 5 años | |
| index.js | hace 5 años | |
| index.mjs | hace 5 años | |
| package.json | hace 5 años | |
Given a string, A and an array of strings XS, return the string X from XS whose Levenshtein distance from A is minimal.
$ npm install levenary
import levenary from 'levenary';
levenary('cat', ['cow', 'dog', 'pig']);
//=> 'cow'
levenary?$ npm run bench
311,915 op/s » levenary
74,030 op/s » didyoumean
141,423 op/s » didyoumean2