Documentation
¶
Overview ¶
Package strutil contains string-related utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorrectPunctuation ¶ added in v0.1.14
CorrectPunctuation attempts to rewrite title to use typographically-correct punctuation characters.
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.
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.