Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSliceFromAny ¶
func HasAnyPrefix ¶
func HexEscapeNonASCII ¶
HexEscapeNonASCII percent-encodes every non-ASCII byte (>= utf8.RuneSelf) in s and leaves ASCII bytes untouched. It mirrors the unexported net/http helper used to keep header values such as Location valid ASCII. Note that ASCII control bytes, including CR and LF, are not escaped.
func Levenshtein ¶ added in v1.47.0
Levenshtein is the edit distance between two rune slices: the fewest single-rune insertions, deletions and substitutions that turn one into the other.
Named for the metric rather than called an edit distance, because several distances answer to that description and they disagree. Damerau-Levenshtein counts a transposition as one edit where this counts two, and a caller comparing text a human typed usually wants the former.
Computed with two rows rather than the full matrix. The inputs this was written for are short — a sentence, a paragraph — but there are a great many of them, and the allocation is what would be felt rather than the arithmetic.
Types ¶
This section is empty.