You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			|  | 5 months ago | |
|---|---|---|
| .. | ||
| LICENSE | 5 months ago | |
| README.md | 5 months ago | |
| index.d.ts | 5 months ago | |
| index.flow.js | 5 months ago | |
| index.js | 5 months ago | |
| index.mjs | 5 months ago | |
| package.json | 5 months ago | |
		
			
				
				README.md
			
		
		
			
			
		
	
	levenary
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?
- Based on leven, the fastest JS implementation of the Levenshtein distance algorithm
- Only 1 API. Simple and clean. If you want more, please use didyoumean2.
- Flow and TypeScript support.
Benchmark
$ npm run bench
  311,915 op/s » levenary
   74,030 op/s » didyoumean
  141,423 op/s » didyoumean2