Documentation
¶
Overview ¶
Package fuzzy is the fuzzystrmatch extension: phonetic and edit-distance matching. Needs CREATE EXTENSION fuzzystrmatch.
Index ¶
- Variables
- func Difference(a, b sqlb.Expr[string]) sqlb.Expr[int32]
- func Dmetaphone(e sqlb.Expr[string]) sqlb.Expr[string]
- func DmetaphoneAlt(e sqlb.Expr[string]) sqlb.Expr[string]
- func Levenshtein(a, b sqlb.Expr[string]) sqlb.Expr[int32]
- func LevenshteinLessEqual(a, b sqlb.Expr[string], maxDistance int) sqlb.Expr[int32]
- func Metaphone(e sqlb.Expr[string], maxLen int) sqlb.Expr[string]
- func Soundex(e sqlb.Expr[string]) sqlb.Expr[string]
Constants ¶
This section is empty.
Variables ¶
var Extension = pg.Extension{Name: "fuzzystrmatch"}
Extension is the fuzzystrmatch extension this package's constructs need, for pg.CreateExtension(Extension), so a library installs what it uses without spelling its name.
Functions ¶
func Difference ¶
Difference renders difference(a, b): how many soundex positions agree, 0 to 4.
func Dmetaphone ¶
Dmetaphone renders dmetaphone(e), the primary double-metaphone code. Two names match phonetically when their codes are equal.
func DmetaphoneAlt ¶
DmetaphoneAlt renders dmetaphone_alt(e), the alternate code. A name with two accepted pronunciations matches on either code.
func Levenshtein ¶
Levenshtein renders levenshtein(a, b), the full edit distance. Use LevenshteinLessEqual when a threshold is known, because it stops early.
func LevenshteinLessEqual ¶
LevenshteinLessEqual stops counting at maxDistance, which is what makes it cheap for a threshold search: the server abandons a pair once it knows the distance exceeds the bound instead of computing the exact value.
Types ¶
This section is empty.