Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultMinimumSimilarityScore = 0.2
Variables ¶
This section is empty.
Functions ¶
func Score ¶
Score calculates the similarity score in the range of 0..1 of two strings. A score of 1 means the strings are identical, and 0 means they have nothing in common.
func Similar ¶
func Similar(builder *brigodier.SuggestionsBuilder, candidates []string) *brigodier.SuggestionsBuilder
Similar calls SimilarScore with DefaultMinimumSimilarityScore.
func SimilarScore ¶
func SimilarScore(builder *brigodier.SuggestionsBuilder, candidates []string, minScore float64) *brigodier.SuggestionsBuilder
SimilarScore sorts and suggests only similar matching candidates based on the current argument input.
It filters and sorts the best matching candidates based on the levenshtein similarity score of the current input so far.
A candidate Score below minScore is dropped from the suggestions. No candidates are dropped when minScore >= 1, this is useful for using this function for sorting candidates by score only.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.