Documentation
¶
Overview ¶
Package levenshtein calculates the Levenshtein edit distance between strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is the object which allows to calculate the Levenshtein distance with Distance() method. It is needed to ensure 0 memory allocations.
func (*Context) Distance ¶
Distance calculates the Levenshtein distance between two strings. It uses a bit-parallel algorithm (Myers) for strings up to 64 runes, providing significant performance speedup (SIMD-within-a-register). For longer strings, it falls back to the standard optimized DP algorithm.
Click to show internal directories.
Click to hide internal directories.