Merge pull request #170 from velour/TLDR

Filter empty evidence, show scores
This commit is contained in:
Scott Kiesel 2019-03-22 06:53:05 -04:00 committed by GitHub
commit 3f99ebdc53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -38,10 +38,6 @@ func New(b bot.Bot) *TLDRPlugin {
func (p *TLDRPlugin) message(kind bot.Kind, message msg.Message, args ...interface{}) bool {
lowercaseMessage := strings.ToLower(message.Body)
if lowercaseMessage == "tl;dr" {
for _, str := range p.History {
fmt.Println(str)
}
nTopics := p.Bot.Config().GetInt("TLDR.Topics", 5)
vectoriser := nlp.NewCountVectoriser(THESE_ARE_NOT_THE_WORDS_YOU_ARE_LOOKING_FOR...)
@ -102,7 +98,9 @@ func (p *TLDRPlugin) message(kind bot.Kind, message msg.Message, args ...interfa
}
response += fmt.Sprintf("Topic #%d : %s\n", topic, bestTopic)
for i := range bestDocs[topic] {
response += fmt.Sprintf("\t<%s>%s\n", bestUsers[topic][i], bestDocs[topic][i])
if bestUsers[topic][i] != "" {
response += fmt.Sprintf("\t<%s>%s [%f]\n", bestUsers[topic][i], bestDocs[topic][i], bestScores[topic][i])
}
}
}