levenshteinmatrix

package
v0.0.0-...-df810dd Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LMatrixSearch

type LMatrixSearch struct {
	SearchLibrary []string
	Keys          []interface{}
	CaseSensitive bool
}

LMatrixSearch contains the search target and and data required for a levenshtein matrix search

func NewLMatrixSearch

func NewLMatrixSearch(library []string, keys []interface{}, caseSensitive bool) *LMatrixSearch

NewLMatrixSearch returns a new LMatrixSerachStruct

func (*LMatrixSearch) GetMatchingKeys

func (s *LMatrixSearch) GetMatchingKeys(searchTerm string, maxDiff int) map[interface{}]int

GetMatchingKeys returns a map of keys which are sufficiently close to the searchTerm paired with their distance

func (*LMatrixSearch) SearchForSubstring

func (s *LMatrixSearch) SearchForSubstring(searchTerm string) []int

SearchForSubstring returns a slice containing match distance for each of the items in the SearchLibrary

Jump to

Keyboard shortcuts

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