Make max winner distance proportional to correction length, so long strings can match.

This commit is contained in:
Psychedelic Squid 2012-03-06 22:58:04 +00:00
parent 85bc47c152
commit 68943d6c8f

View File

@ -19,7 +19,7 @@ var spelling = function(dbot) {
}
}
if(winnerDistance < 7) {
if(winnerDistance < Math.ceil(correction.length * 1.33)) {
if(winner !== correction) {
var fix = last[data.channel][candidate].replace(winner, correction);
if (/^.ACTION/.test(fix)) {