Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// Min is the minimum similarity to return
Min float64
// TopN is the number of top matches to return
TopN int
}
Filter are the filters to apply to similarity
type Score ¶
type Score struct {
// Input is the sentence we are comparing against
Input string
// Similarity is the probability of the sentence being similar
Similarity float64
// Words is the word count against the input
Words map[string]int
}
Score is similarity score
type Similarity ¶
type Similarity struct {
// Input is the input sentence
Input string
// Scores is a list of scores
Scores []Score
// Tokens is the tokens of the sentence
Tokens []string
}
Similarity are the scores
func Closeness ¶
func Closeness(sentence string, list []string, filter Filter) Similarity
Closeness returns the closest string to the given string
func (*Similarity) Hightest ¶
func (h *Similarity) Hightest() Score
Hightest returns the highest score
Click to show internal directories.
Click to hide internal directories.