Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. levenshtein

levenshtein

MITGo

A high-performance Go library for calculating Levenshtein distance between strings, including Unicode support.

GitHubGitHub
469 stars29 forks0 contributors

What is levenshtein?

levenshtein is a Go implementation of the Levenshtein distance algorithm that calculates the minimum number of edits needed to transform one string into another. It solves the problem of measuring string similarity for applications like spell checking, fuzzy searching, and natural language processing. The library is optimized for performance and supports Unicode characters across different languages.

Target Audience

Go developers who need efficient string comparison functionality for text processing, search engines, data deduplication, or natural language applications. It's particularly useful for those working with international text and requiring high-performance similarity calculations.

Value Proposition

Developers choose this library because it offers superior performance compared to alternatives, with benchmarks showing 55-60% faster execution and zero allocations for many cases. Its clean API and Unicode support make it a reliable choice for production applications needing accurate string distance calculations.

Overview

Go implementation to calculate Levenshtein Distance.

Use Cases

Best For

  • Implementing fuzzy search algorithms in Go applications
  • Building spell checkers or autocorrect systems
  • Data deduplication by identifying similar text entries
  • Natural language processing tasks requiring string similarity
  • Creating recommendation systems based on text similarity
  • Benchmarking string distance algorithms in Go

Not Ideal For

  • Applications processing strings longer than 65,536 characters (runes)
  • Projects requiring automatic Unicode normalization without manual pre-processing
  • Use cases needing alternative string similarity metrics like Jaro-Winkler or Damerau–Levenshtein
  • Developers seeking a comprehensive string utility library with multiple algorithms

Pros & Cons

Pros

High Performance

Benchmarks show it's 55-60% faster than alternatives like dgryski/trifles and arbovm/levenshtein, with significant speed improvements across ASCII, French, Nordic, and Tibetan strings.

Memory Efficiency

Operates with zero allocations for many cases, reducing garbage collection pressure, as evidenced by benchmark results showing 0 B/op for common string types.

Unicode Support

Handles non-ASCII strings including French, Nordic, and Tibetan characters seamlessly, though normalization is left to the user for flexibility.

Simple API

Provides a single ComputeDistance function with clear documentation and examples, making integration straightforward for basic use cases.

Cons

String Length Limitation

As a performance optimization, it caps strings at 65,536 runes; longer strings require pinning to version 1.0.3, which may involve breaking changes or reduced functionality.

No Built-in Normalization

The library doesn't normalize strings, forcing users to manually handle Unicode normalization with external packages, adding complexity for international text.

Narrow Scope

Focuses solely on Levenshtein distance, lacking support for other string similarity algorithms that might be needed in broader text analysis applications.

Frequently Asked Questions

Quick Stats

Stars469
Forks29
Contributors0
Open Issues1
Last commit2 months ago
CreatedSince 2014

Tags

#algorithm#computational-linguistics#unicode#go-library#levenshtein-distance#text-processing#golang#string-distance#levenshtein#performance

Built With

G
Go

Included in

Go169.1k
Auto-fetched 21 hours ago

Related Projects

blevebleve

A modern text/numeric/geo-spatial/vector indexing library for go

Stars11,033
Forks700
Last commit12 days ago
trietrie

Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching.

Stars789
Forks115
Last commit3 months ago
go-edlibgo-edlib

📚 String comparison and edit distance algorithms library, featuring : Levenshtein, LCS, Hamming, Damerau levenshtein (OSA and Adjacent transpositions algorithms), Jaro-Winkler, Cosine, etc...

Stars599
Forks28
Last commit3 months ago
go-adaptive-radix-treego-adaptive-radix-tree

Adaptive Radix Trees implemented in Go

Stars413
Forks63
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub