3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

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