Documentation ¶
Overview ¶
Package strutil contains string-related utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize normalizes characters using NFKD form. Unicode characters are decomposed (runes are broken into their components) and replaced for compatibility equivalence (characters that represent the same characters but have different visual representations, e.g. '9' and '⁹', are equal). Characters are also de-accented. TODO: Maybe go farther and e.g. replace smart quotes with dumb quotes?
Types ¶
type Edits ¶
type Edits struct{ Ins, Dels, Subs int }
Edits holds information about edits needed to transform one string into another.
func Levenshtein ¶
Levenshtein computes the Levenshtein distance between a and b using the Wagner–Fischer algorithm. It's based on pseudocode from https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm.