Documentation ¶
Index ¶
- func Score(needle, haystack string) float64
- func ScoreAndSortChannels(searchTerm string, searchables []*discordgo.Channel) []*discordgo.Channel
- func ScoreAndSortEmoji(searchTerm string, unicodeEmoji []string, customEmoji []*discordgo.Emoji) []string
- func ScoreAndSortMembers(searchTerm string, searchables []*discordgo.Member) []*discordgo.Member
- func ScoreAndSortRoles(searchTerm string, searchables []*discordgo.Role) []*discordgo.Role
- func ScoreAndSortUsers(searchTerm string, searchables []*discordgo.User) []*discordgo.User
- func ScoreSearch(searchTerm string, searchItems []string) map[string]float64
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Score ¶
Returns: -1 if the needle contains letters the haystack does not contain, or if the needle length exceeds the haystack length.
0 if no similarities were found
> 0 based on similarities between the needle and haystack (increasing)
func ScoreAndSortChannels ¶
func ScoreAndSortEmoji ¶
func ScoreAndSortMembers ¶
func ScoreAndSortRoles ¶
func ScoreAndSortUsers ¶
Types ¶
type SearchResult ¶
func SortSearchResults ¶
func SortSearchResults(results map[string]float64) []SearchResult
Click to show internal directories.
Click to hide internal directories.