From 4e2d4017d0a855f1a18bab8c53e8e3e32811ece5 Mon Sep 17 00:00:00 2001 From: Psychedelic Squid Date: Tue, 6 Mar 2012 22:02:52 +0000 Subject: [PATCH] Check all groupings of words for corrections; makes multi-word corrections behave properly. --- modules/spelling.js | 12 +++++++----- snippets.js | 13 +++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/spelling.js b/modules/spelling.js index 3dc85e1..0f286cc 100644 --- a/modules/spelling.js +++ b/modules/spelling.js @@ -3,23 +3,25 @@ var spelling = function(dbot) { var last = {}; var correct = function (data, correction, candidate, output_callback) { - var candidates = last[data.channel][candidate].split(' '); + var rawCandidates = last[data.channel][candidate].split(' ').allGroupings(); + var candidates = []; + for(var i=0;i