All Projects → words → levenshtein-edit-distance

words / levenshtein-edit-distance

Licence: MIT license
Levenshtein edit distance

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to levenshtein-edit-distance

similar-english-words
Give me a word and I’ll give you an array of words that differ by a single letter.
Stars: ✭ 25 (-57.63%)
Mutual labels:  distance, levenshtein, edit
simetric
String similarity metrics for Elixir
Stars: ✭ 59 (+0%)
Mutual labels:  distance, levenshtein
Stopwords
Removes most frequent words (stop words) from a text content. Based on a Curated list of language statistics.
Stars: ✭ 83 (+40.68%)
Mutual labels:  distance, levenshtein
Stringmetric
🎯 String metrics and phonetic algorithms for Scala (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein).
Stars: ✭ 481 (+715.25%)
Mutual labels:  distance, levenshtein
stringosim
String similarity functions, String distance's, Jaccard, Levenshtein, Hamming, Jaro-Winkler, Q-grams, N-grams, LCS - Longest Common Subsequence, Cosine similarity...
Stars: ✭ 47 (-20.34%)
Mutual labels:  distance, levenshtein
Textdistance
Compute distance between sequences. 30+ algorithms, pure python implementation, common interface, optional external libs usage.
Stars: ✭ 2,575 (+4264.41%)
Mutual labels:  distance, levenshtein
Distancepicker
Custom UIKit control to select a distance with a pan gesture, written in Swift
Stars: ✭ 118 (+100%)
Mutual labels:  distance
Geokit
Geo-Toolkit for PHP.
Stars: ✭ 223 (+277.97%)
Mutual labels:  distance
Geocalc
Helper classes to calculate Earth distances, bearing, etc.
Stars: ✭ 88 (+49.15%)
Mutual labels:  distance
Geolocation Python
Geolocation is simple google maps api for python users. This application allows you to get information about given location Application returns such information as: country, city, route/street, street number, reverse geocode, lat and lng, travel distance and time for a matrix of origins and destinations.
Stars: ✭ 77 (+30.51%)
Mutual labels:  distance
LibN3L
LibN3L: A light-weight neural network package for natural language
Stars: ✭ 81 (+37.29%)
Mutual labels:  natural-language
Distances.jl
A Julia package for evaluating distances (metrics) between vectors.
Stars: ✭ 251 (+325.42%)
Mutual labels:  distance
Distancemeasure
📷 An android demo which can measure the distance from user to something while taking photos ( Android 拍照测距 )
Stars: ✭ 185 (+213.56%)
Mutual labels:  distance
Stereo Vision
This program has been developed as part of a project at the University of Karlsruhe in Germany. The final purpose of the algorithm is to measure the distance to an object by combining two webcams and use them as a Stereo Camera.
Stars: ✭ 160 (+171.19%)
Mutual labels:  distance
Pubg mobile memory hacking examples
Pubg Mobile Emulator Gameloop Memory Hacking C++ code examples. Ex: Name, Coord, Bones, Weapons, Items, Box, Drop etc.
Stars: ✭ 224 (+279.66%)
Mutual labels:  distance
Mapbox Gl Controls
Stars: ✭ 93 (+57.63%)
Mutual labels:  distance
levenshtein finder
Similar string search in Levenshtein distance
Stars: ✭ 19 (-67.8%)
Mutual labels:  levenshtein
Smetrics
String metrics library written in Go.
Stars: ✭ 177 (+200%)
Mutual labels:  distance
Evfacetracker
Calculate the distance and angle of your device with regards to your face
Stars: ✭ 251 (+325.42%)
Mutual labels:  distance
Cheap Ruler Go
📏 cheapruler in Go: fast geodesic measurements
Stars: ✭ 176 (+198.31%)
Mutual labels:  distance

levenshtein-edit-distance

Build Coverage Downloads Size

Levenshtein distance (by Vladimir Levenshtein).

Contents

What is this?

This package exposes a string similarity algorithm. That means it gets two strings (typically words), and turns it into the minimum number of single-character edits (insertions, deletions or substitutions) needed to turn one string into the other.

When should I use this?

You’re probably dealing with natural language, and know you need this, if you’re here!

Install

This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:

npm install levenshtein-edit-distance

In Deno with esm.sh:

import {levenshteinEditDistance} from 'https://esm.sh/levenshtein-edit-distance@3'

In browsers with esm.sh:

<script type="module">
  import {levenshteinEditDistance} from 'https://esm.sh/levenshtein-edit-distance@3?bundle'
</script>

Use

import {levenshteinEditDistance} from 'levenshtein-edit-distance'

levenshteinEditDistance('levenshtein', 'levenshtein') // => 0
levenshteinEditDistance('sitting', 'kitten') // => 3
levenshteinEditDistance('gumbo', 'gambol') // => 2
levenshteinEditDistance('saturday', 'sunday') // => 3

// Insensitive to order:
levenshteinEditDistance('aarrgh', 'aargh') === levenshtein('aargh', 'aarrgh') // => true

// Sensitive to ASCII casing by default:
levenshteinEditDistance('DwAyNE', 'DUANE') !== levenshtein('dwayne', 'DuAnE') // => true
// Insensitive:
levenshteinEditDistance('DwAyNE', 'DUANE', true) === levenshtein('dwayne', 'DuAnE', true) // => true

API

This package exports the identifier levenshteinEditDistance. There is no default export.

levenshteinEditDistance(value, other[, insensitive])

Levenshtein edit distance.

value

Primary value (string, required).

other

Other value (string, required).

insensitive

Compare insensitive to ASCII casing (boolean, default: false).

Returns

Distance between value and other (number).

CLI

Usage: levenshtein-edit-distance [options] word word

Levenshtein edit distance.

Options:

  -h, --help           output usage information
  -v, --version        output version number
  -i, --insensitive    ignore casing

Usage:

# output distance
$ levenshtein-edit-distance sitting kitten
# 3

# output distance from stdin
$ echo "saturday,sunday" | levenshtein-edit-distance
# 3

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.

Related

Contribute

Yes please! See How to Contribute to Open Source.

Security

This package is safe.

License

MIT © Titus Wormer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].