From bb934fb1db81354694c676d6d8aac81c736173ad Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 9 Jan 2012 14:46:09 +0000 Subject: [PATCH] fix spelling bug with replacing parts of words instead of the word if the letter sequence occurs first --- modules/spelling.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/spelling.js b/modules/spelling.js index a2c8d1f..69e2189 100644 --- a/modules/spelling.js +++ b/modules/spelling.js @@ -17,7 +17,7 @@ var spelling = function(dbot) { if(winnerDistance < 7) { if(winner !== correction) { - var fix = last[data.channel][candidate].replace(winner, correction); + var fix = last[data.channel][candidate].replace(' ' + winner + ' ', correction); if (/^.ACTION/.test(fix)) { fix = fix.replace(/^.ACTION/, '/me'); }