Documentation
¶
Overview ¶
Package levenshtein is a Go implementation to calculate Levenshtein Distance.
Implementation taken from https://gist.github.com/andrei-m/982927#gistcomment-1931258
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeDistance ¶
ComputeDistance computes the levenshtein distance between the two strings passed as an argument. The return value is the levenshtein distance
Works on runes (Unicode code points) but does not normalize the input strings. See https://blog.golang.org/normalization and the golang.org/x/text/unicode/norm pacage.
func ComputeDistance64 ¶
func ComputeWordDistance ¶
Types ¶
type EditStats ¶
type EditStats = struct { Subs map[string]int `json:"subs"` Ins map[string]int `json:"ins"` Dels map[string]int `json:"dels"` }
EditStats stores information about the number of substitutions, insertions and deletions used in the optimal path between the two string
func ComputeDistWithCon64 ¶
func ComputeDistanceWithConstruction ¶
ComputeDistanceWithConstruction extends ComputeDistance to return information about the number of substitutions, insertions and deletions alongside the distance score