Changed fuzzy matching to favour matching case
This commit is contained in:
+2
-2
@@ -363,11 +363,11 @@ static int f_fuzzy_match(lua_State *L) {
|
|||||||
while (*str == ' ') { str++; }
|
while (*str == ' ') { str++; }
|
||||||
while (*ptn == ' ') { ptn++; }
|
while (*ptn == ' ') { ptn++; }
|
||||||
if (tolower(*str) == tolower(*ptn)) {
|
if (tolower(*str) == tolower(*ptn)) {
|
||||||
score += run;
|
score += run * 10 - (*str != *ptn);
|
||||||
run++;
|
run++;
|
||||||
ptn++;
|
ptn++;
|
||||||
} else {
|
} else {
|
||||||
score--;
|
score -= 10;
|
||||||
run = 0;
|
run = 0;
|
||||||
}
|
}
|
||||||
str++;
|
str++;
|
||||||
|
|||||||
Reference in New Issue
Block a user