fuzzy

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package fuzzy includes a Levenshtein automaton as well as a traditional implementation to calculate Levenshtein Distance. Some code is borrowed from https://github.com/agnivade/levenshtein

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDistance

func ComputeDistance(a, b string) int

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 GetTrie

func GetTrie(triePath string, db *sql.DB) *levenshtein.MinTree

GetTrie generates an in-memory trie for levenshtein automata. Such tree can either be constructed from database or from a dump file. The tree consists stemmed canonical forms of _gnames_ database.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL