Documentation
¶
Index ¶
- func RunWorkers(count int, workerCount int, timeout time.Duration, ...) []*common.SearchResultLow
- func ScoreFuzzy(terms []string, args *ScoreFuzzyArgs, buff []uint16) uint8
- func ScoreSimpleFuzzy(terms []string, args *ScoreSimpleFuzzyArgs, buff []uint16) uint8
- func ScoreStartsWith(terms []string, query string) uint8
- func ScoreWordMatch(terms []string, query string) uint8
- func Similarity(r1 []rune, r2 []rune, buff []uint16, subtract uint8) uint8
- func SimilaritySlow(r1 []rune, r2 []rune, buff []uint16, subtract uint8) uint8
- type ScoreFuzzyArgs
- type ScoreSimpleFuzzyArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunWorkers ¶
func RunWorkers( count int, workerCount int, timeout time.Duration, worker func(int, int) []*common.SearchResultLow, ) []*common.SearchResultLow
func ScoreFuzzy ¶
func ScoreFuzzy( terms []string, args *ScoreFuzzyArgs, buff []uint16, ) uint8
ScoreFuzzy returns fuzzy score between query and term list Make sure you don't use the same buff in multiple goroutines Returns a number in 0..200 range, but 80 is a good minimum score to use which is equivalent of %70 similarity in single-word query and term Because we spread out %50 .. %100 similarity to scores of 100..200 for example "abstracted" is %70 similar to "abstrac" query, but gets score of 80
func ScoreSimpleFuzzy ¶
func ScoreSimpleFuzzy( terms []string, args *ScoreSimpleFuzzyArgs, buff []uint16, ) uint8
ScoreSimpleFuzzy returns fuzzy score between query and term list Make sure you don't use the same buff in multiple goroutines This is the same as ScoreFuzzy for single-word terms It does not look into words of a term. But it does check if term starts with the query.
func ScoreStartsWith ¶
func ScoreWordMatch ¶
ScoreWordMatch returns a score based on exact word match between query words and term words
func Similarity ¶
Similarity calculates a similarity score between 0 and 200 Except any score between 1 and 131 (<%66) will become zero as optimization SimilaritySlow func does not have this limitation Make sure you don't use the same buff in multiple goroutines