fast-levenshtein
Efficient implementation of Levenshtein algorithm with locale-specific collator support.
Last updated 4 years ago by hiddentao .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install fast-levenshtein 
SYNC missed versions from official npm registry.

fast-levenshtein - Levenshtein algorithm in Javascript

Build Status NPM module NPM downloads Follow on Twitter

A Javascript implementation of the Levenshtein algorithm with locale-specific collator support. This uses fastest-levenshtein under the hood.

Features

  • Works in node.js and in the browser.
  • Locale-sensitive string comparisons if needed.
  • Comprehensive test suite.

Installation

$ npm install fast-levenshtein

CDN

The latest version is now also always available at https://npm-cdn.com/pkg/fast-levenshtein/

Examples

Default usage

var levenshtein = require('fast-levenshtein');

var distance = levenshtein.get('back', 'book');   // 2
var distance = levenshtein.get('我愛你', '我叫你');   // 1

Locale-sensitive string comparisons

It supports using Intl.Collator for locale-sensitive string comparisons:

var levenshtein = require('fast-levenshtein');

levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true});
// 1

Building and Testing

To build the code and run the tests:

$ npm install -g grunt-cli
$ npm install
$ npm run build

Performance

This uses fastest-levenshtein under the hood.

Contributing

If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes.

See CONTRIBUTING.md for details.

License

MIT - see LICENSE.md

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

20 Versions

  • 3.0.0                                ...           4 years ago
  • 2.0.6                                ...           8 years ago
  • 2.0.5                                ...           8 years ago
  • 2.0.4                                ...           8 years ago
  • 2.0.3                                ...           8 years ago
  • 2.0.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.1.4                                ...           8 years ago
  • 1.1.3                                ...           9 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.7                                ...           9 years ago
  • 1.0.6                                ...           10 years ago
  • 1.0.5                                ...           10 years ago
  • 1.0.4                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (11)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |