Added map for save Group and Category values for each option

+ Some code refactoring in Tab (the translation of the titles moved to the OptionGroups) and Search
+ Fixed assert in fts_fuzzy_match
This commit is contained in:
YuSanka 2020-04-13 17:55:38 +02:00
parent 218abacb75
commit 167f7cf5de
11 changed files with 373 additions and 298 deletions

View file

@ -181,12 +181,14 @@ namespace fts {
// Check for bonuses based on neighbor character value
if (currIdx > 0) {
// Camel case
char neighbor = strBegin[currIdx - 1];
char curr = strBegin[currIdx];
if (::islower(neighbor) && ::isupper(curr))
// ::islower() expects an unsigned char in range of 0 to 255.
unsigned char uneighbor = ((unsigned char *)strBegin)[currIdx - 1];
unsigned char ucurr = ((unsigned char*)strBegin)[currIdx];
if (::islower(uneighbor) && ::isupper(ucurr))
outScore += camel_bonus;
// Separator
char neighbor = strBegin[currIdx - 1];
bool neighborSeparator = neighbor == '_' || neighbor == ' ';
if (neighborSeparator)
outScore += separator_bonus;