Documentation ¶
Index ¶
- func DamerauLevenshtein(str1, str2 string, maxDist int) int
- func DamerauLevenshteinRunes(r1, r2 []rune, maxDist int) int
- func DamerauLevenshteinRunesBuffer(r1, r2 []rune, maxDist int, x, y []int) int
- func Levenshtein(str1, str2 string, maxDist int) int
- func LevenshteinRunes(r1, r2 []rune, maxDist int) int
- func LevenshteinRunesBuffer(r1, r2 []rune, maxDist int, x []int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DamerauLevenshtein ¶
DamerauLevenshtein distance is a string metric for measuring the edit distance between two sequences: https://en.wikipedia.org/wiki/Damerau%E3%80%93Levenshtein_distance
This implementation has been designed using the observations of Steve Hatchett: http://blog.softwx.net/2015/01/optimizing-damerau-levenshtein_15.html
Takes two strings and a maximum edit distance and returns the number of edits to transform one string to another, or -1 if the distance is greater than the maximum distance.
func DamerauLevenshteinRunes ¶
DamerauLevenshteinRunes is the same as DamerauLevenshtein but accepts runes instead of strings
func DamerauLevenshteinRunesBuffer ¶
DamerauLevenshteinRunesBuffer is the same as DamerauLevenshteinRunes but also accepts memory buffers x and y which should each be of size max(r1, r2).
func Levenshtein ¶
Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character https://en.wikipedia.org/wiki/Levenshtein_distance
This implementation has been designed using the observations of Steve Hatchett: https://blog.softwx.net/2014/12/optimizing-levenshtein-algorithm-in-c.html
Takes two strings and a maximum edit distance and returns the number of edits to transform one string to another, or -1 if the distance is greater than the maximum distance.
func LevenshteinRunes ¶
LevenshteinRunes is the same as Levenshtein but accepts runes instead of strings
Types ¶
This section is empty.