2.1.2 • Published 9 years ago

up-levenshtein v2.1.2

Weekly downloads
22
License
MIT
Repository
github
Last release
9 years ago

#What? Lightweight implementation for Levenshtein distance calculation. Without dependencies.

#Install

$ npm install --save up-levenshtein

#API

getDistance(:string, :string) : number
getClosest(:string, :array) : string

#Where this library could be useful? You might consider this library if you want to measure distance between two strings. For example - emails comparison and getting correction suggestions.

Levenshtein.getClosest('@nekrasov.nl', [
  '@gmail.com',
  '@nekgasov.nl',
  '@nekasov.nl',
  '@ya.ru'
]);

returns: @nekgasov.nl.

#Tests Run npm t

#Benchmarks To run benchmarks locally: npm run benchmarks.

Tests performed on: MacBook Pro Early 2015 (2,7 GHz Intel Core i5, 8 GB 1867 MHz DDR3)

Results:

SizeStrings to compareResults
S'some1' and 'some2'x 6,729,838 ops/sec ±1.62% (84 runs sampled)
M'alexey@nekrasov.nl' and 'alexey@gmail.com'x 987,762 ops/sec ±0.82% (85 runs sampled)
XL'I don\'t really need to compare long texts' and 'But what wouldn\'t you do for good benchmarks?'x 158,916 ops/sec ±1.39% (81 runs sampled)

#License MIT

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.14

9 years ago

2.0.13

9 years ago

2.0.12

9 years ago

2.0.11

9 years ago

2.0.10

9 years ago

2.0.9

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago