fix spelling bug with replacing parts of words instead of the word if the letter sequence occurs first

This commit is contained in:
Luke Slater 2012-01-09 14:46:09 +00:00
parent 9b00578a60
commit bb934fb1db

View File

@ -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');
}