/ piacw.com / dev / final / node_modules / levenary /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[   ]LICENSE2 years ago1.1K0fb859dc fixed mobile overflwo options [كارل مبارك]
[TXT]README.md2 years ago1.0K0fb859dc fixed mobile overflwo options [كارل مبارك]
[TXT]index.d.ts2 years ago322 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]index.flow.js2 years ago345 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]index.js2 years ago605 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]index.mjs2 years ago321 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2 years ago2.4K0fb859dc fixed mobile overflwo options [كارل مبارك]
README.md

levenary

npm-version github-actions

Given a string, A and an array of strings XS, return the string X from XS whose Levenshtein distance from A is minimal.

Install

$ npm install levenary

Usage

import levenary from 'levenary';

levenary('cat', ['cow', 'dog', 'pig']);
//=> 'cow'

Why levenary?

  1. Based on leven, the fastest JS implementation of the Levenshtein distance algorithm
  2. Only 1 API. Simple and clean. If you want more, please use didyoumean2.
  3. Flow and TypeScript support.

Benchmark

$ npm run bench
  311,915 op/s » levenary
   74,030 op/s » didyoumean
  141,423 op/s » didyoumean2
Apache/2.4.38 (Debian) Server at www.karls.computer Port 80