var spelling = function(dbot) { var dbot = dbot; var last = {}; var correct = function (data, correction, candidate, output_callback) { var candidates = last[data.channel][candidate].split(' '); var winner = false; var winnerDistance = Infinity; for(var i=0;i