mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 22:39:26 +01:00
Make spelling distance check not care about case.
This commit is contained in:
parent
e8eb665900
commit
3f218ebb52
@ -12,7 +12,7 @@ var spelling = function(dbot) {
|
|||||||
var winnerDistance = Infinity;
|
var winnerDistance = Infinity;
|
||||||
|
|
||||||
for(var i=0;i<candidates.length;i++) {
|
for(var i=0;i<candidates.length;i++) {
|
||||||
var distance = String.prototype.distance(correction, candidates[i]);
|
var distance = String.prototype.distance(correction.toLowerCase(), candidates[i].toLowerCase());
|
||||||
if((distance < winnerDistance) && (distance > 0)) {
|
if((distance < winnerDistance) && (distance > 0)) {
|
||||||
winner = candidates[i];
|
winner = candidates[i];
|
||||||
winnerDistance = distance;
|
winnerDistance = distance;
|
||||||
|
Loading…
Reference in New Issue
Block a user