GitShow/sindresorhus/leven
sindresorhus

leven

Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm

by sindresorhus
Star on GitHubForknpm

JavaScript

734 stars31 forks8 contributorsQuiet · 9mo agoSince 2014v4.1.0MIT

Meet the team

See all 8 on GitHub →
sindresorhus
sindresorhus30 contributions
Yomguithereal
Yomguithereal3 contributions
BendingBender
BendingBender2 contributions
bnjmnt4n
bnjmnt4n1 contribution
gustf
gustf1 contribution
kevva
kevva1 contribution
Richienb
Richienb1 contribution
fisker
fisker1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
fisker
Add support for find closest stringClosedIssue

Without this feature, we'll have to calculate all distances to find the closest. If we know all the options, we can skip unnecessary calculations. To support this, we'll need to implement #14 first.

fisker · 9mo ago
bittlingmayer
parameter for maximum distanceClosedIssue

This is the most performant Levenshtein implementation for NodeJS of which I know, and I have a though on how to make it faster for many applications. When testing many string pairs by similarity (for example, when sorting, or filtering strings above or below a threshold), often we are happy to short-circuit on any pair with a distance greater than . At scale, given that the least similar strings are also very expensive to compute, there is a big potential savings. (For one, just comparing length is enough to discard many candidates.) (For pairs with a distance above , the distance returned can be , or - I don't have a strong opinion on which is best, but probably is the most useful, as it would require not extra handling for sorting or filtering.)

bittlingmayer · 9mo ago
fisker
Fix benchmark scriptMergedPR
fisker · 1y ago
Structured data for AI agents

Repository: sindresorhus/leven. Description: Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm Stars: 734, Forks: 31. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v4.1.0 (9mo ago). Open PRs: 0, open issues: 0. Last activity: 9mo ago. Community health: 85%. Top contributors: sindresorhus, Yomguithereal, BendingBender, bnjmnt4n, gustf, kevva, Richienb, fisker.

·@ofershap

Replace github.com with gitshow.dev