Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gf3/Levenshtein
Javascript implementation of the L-diggity.
https://github.com/gf3/Levenshtein
Last synced: 3 months ago
JSON representation
Javascript implementation of the L-diggity.
- Host: GitHub
- URL: https://github.com/gf3/Levenshtein
- Owner: gf3
- License: unlicense
- Created: 2010-08-30T19:39:42.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2021-04-22T21:46:46.000Z (over 3 years ago)
- Last Synced: 2024-05-22T20:46:17.716Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 213 KB
- Stars: 280
- Watchers: 10
- Forks: 44
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Levenshtein
[Levenshtein][wikipedia] string difference in Javascript.
![Screenshot](screenshot.png)
`Levenshtein` also does some neat things like coerce to a number and string
appropriately. So you can compare Levenshtein objects directly! Not to mention
it has specs!## API
* `new Levenshtein( m, n )` → `Levenshtein`
* m ( `String` ): First string.
* n ( `String` ): Second string.
* Initialise a new Levenshtein object.* `Levenshtein#distance` → `Number`
* Distance between strings.* `Levenshtein#inspect()` → `String`
* Pretty print Levenshtein table.* `Levenshtein#toString()` → `String`
* Alias of: `Levenshtein#inspect()`.* `Levenshtein#valueOf()` → `Number`
* Alias of: `Levenshtein#distance`.## Installation
Levenshtein works in both the browser and [node.js][node].
### Browser
Simply include `levenshtein.js`:
``` html
```
### NPM
Install via npm:
``` sh
npm install levenshtein
```Or put it in your `package.json`:
``` json
{ "levenshtein": "~1.0" }
```### Bower
``` sh
bower install levenshtein
```### Git
``` sh
git clone git://github.com/gf3/Levenshtein.git
```## License
Levenshtein is [UNLICENSED][unlicense].
## Author
Written by [Gianni Chiappetta][github] – [heavycorp.io][gf3]
[gf3]: https://heavycorp.io
[github]: https://github.com/gf3
[node]: http://nodejs.org/
[unlicense]: http://unlicense.org/
[wikipedia]: http://en.wikipedia.org/wiki/Levenshtein_distance