From 478d344fe2ab4489223fd6ec8abc432c0b426c0b Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 15 Jan 2013 16:05:04 +0000 Subject: [PATCH] Fix up spelling [#131] --- modules/spelling/spelling.js | 61 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/modules/spelling/spelling.js b/modules/spelling/spelling.js index 5c955ef..23db3cc 100644 --- a/modules/spelling/spelling.js +++ b/modules/spelling/spelling.js @@ -74,9 +74,13 @@ var distance = function(s1, s2) { }; var spelling = function(dbot) { - var last = {}; - var correct = function (event, correction, candidate, output_callback) { - var rawCandidates = allGroupings(last[event.channel.name][candidate].split(' ')); + this.name = 'spelling'; + this.ignorable = true; + + this.last = {}; + this.internalAPI = {}; + this.internalAPI.correct = function (event, correction, candidate, output_callback) { + var rawCandidates = allGroupings(this.last[event.channel.name][candidate].split(' ')); var candidates = []; for(var i=0;i