Changed fuzzy matching to favour matching case
This commit is contained in:
parent
28b1844a8b
commit
61092fbb99
|
@ -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++;
|
||||||
|
|
Loading…
Reference in New Issue