From 22ba451d4cb5f2a2e86ffb19b59c02335ce30829 Mon Sep 17 00:00:00 2001 From: skiesel Date: Fri, 22 Mar 2019 06:49:24 -0400 Subject: [PATCH] Filter empty evidence, show scores --- plugins/tldr/tldr.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/tldr/tldr.go b/plugins/tldr/tldr.go index 731ea72..25c5c37 100644 --- a/plugins/tldr/tldr.go +++ b/plugins/tldr/tldr.go @@ -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]) + } } }