MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / rankByWordCount

Function rankByWordCount

plugin/wordcount/main.go:169–178  ·  view source on GitHub ↗
(wordFrequencies map[string]int)

Source from the content-addressed store, hash-verified

167}
168
169func rankByWordCount(wordFrequencies map[string]int) pairlist {
170 pl := make(pairlist, len(wordFrequencies))
171 i := 0
172 for k, v := range wordFrequencies {
173 pl[i] = pair{k, v}
174 i++
175 }
176 sort.Sort(sort.Reverse(pl))
177 return pl
178}
179
180type pair struct {
181 Key string

Callers 1

initFunction · 0.85

Calls 1

SortMethod · 0.80

Tested by

no test coverage detected