From e608491360b730fd9f0ce3eec04d6908c3e00bf3 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 15 Feb 2012 21:00:31 +0000 Subject: [PATCH] classify --- modules/drama.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/drama.js b/modules/drama.js index b607997..1e9ac31 100644 --- a/modules/drama.js +++ b/modules/drama.js @@ -40,6 +40,12 @@ var drama = function(dbot) { var msg = params.join(' '); bayes.train(msg, category); dbot.say(data.channel, '\'' + msg + '\' classified as \'' + category + '\''); + }, + + '~classify': function() { + bayes.classify(data.message, function(category) { + dbot.say(data.channel, 'Classified as: ' + category + '!'); + }.bind(this)); } } }