Fuzzy matching of parameters in the search box:

Fix of https://github.com/forrestthewoods/lib_fts/issues/21 finally applied,
disabled CamelCase matching as we are not using CamelCase in Slicer parameters.
This commit is contained in:
bubnikv 2020-05-04 16:18:20 +02:00
parent 28c0880b24
commit 95cf8c2d30

View file

@ -93,7 +93,7 @@ namespace fts {
// Recursion count is input / output to track the maximum depth reached. // Recursion count is input / output to track the maximum depth reached.
// Was given by reference &recursionCount, see discussion in https://github.com/forrestthewoods/lib_fts/issues/21 // Was given by reference &recursionCount, see discussion in https://github.com/forrestthewoods/lib_fts/issues/21
// int & recursionCount, // int & recursionCount,
int & recursionCount, int recursionCount,
int recursionLimit) int recursionLimit)
{ {
// Count recursions // Count recursions
@ -202,10 +202,12 @@ namespace fts {
if (i > 0 && currIdx == matches[i - 1] + 1) if (i > 0 && currIdx == matches[i - 1] + 1)
// Sequential // Sequential
outScore += sequential_bonus; outScore += sequential_bonus;
/*
// Camel case // Camel case
char_type prev = strBegin[currIdx - 1]; char_type prev = strBegin[currIdx - 1];
if (std::islower(prev) && std::isupper(strBegin[currIdx])) if (std::islower(prev) && std::isupper(strBegin[currIdx]))
outScore += camel_bonus; outScore += camel_bonus;
*/
// Separator // Separator
if (prev == '_' || prev == ' ') if (prev == '_' || prev == ' ')
outScore += separator_bonus; outScore += separator_bonus;