Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClosestMatch ¶
type ClosestMatch struct { SubstringSizes []int SubstringToID map[string]map[uint32]struct{} ID map[uint32]IDInfo }
ClosestMatch is the structure that contains the substring sizes and carrys a map of the substrings for easy lookup
func Load ¶
func Load(filename string) (*ClosestMatch, error)
Load can load a previously saved ClosestMatch object from disk
func New ¶
func New(possible []string, subsetSize []int) *ClosestMatch
New returns a new structure for performing closest matches
func (*ClosestMatch) AccuracyMutatingLetters ¶
func (cm *ClosestMatch) AccuracyMutatingLetters() float64
AccuracyMutatingLetters runs some basic tests against the wordlist to see how accurate this bag-of-characters method is against the target dataset when mutating individual letters (adding, removing, changing)
func (*ClosestMatch) AccuracyMutatingWords ¶
func (cm *ClosestMatch) AccuracyMutatingWords() float64
AccuracyMutatingWords runs some basic tests against the wordlist to see how accurate this bag-of-characters method is against the target dataset
func (*ClosestMatch) Closest ¶
func (cm *ClosestMatch) Closest(searchWord string) string
Closest searches for the `searchWord` and returns the closest match
func (*ClosestMatch) ClosestN ¶
func (cm *ClosestMatch) ClosestN(searchWord string, n int) []string
ClosestN searches for the `searchWord` and returns the n closests matches
func (*ClosestMatch) Save ¶
func (cm *ClosestMatch) Save(filename string) error
Save writes the current ClosestSave object as a gzipped JSON file