88namespace albert
99{
1010
11+ // Doxygen does not like raw strings
12+ // QRegularExpression(R"([\s\\\/\-\[\](){}#!?<>"'=+*.:,;_]+)");
13+ const QRegularExpression default_separator_regex (" ([\\ s\\\\ /\\ -\\ [\\ ](){}#!?<>\" '=+*.:,;_]+)" );
14+
1115// /
1216// / Configuration for string matching.
1317// /
18+ // / Initialize with designated initializers to avoid hard to find bugs on future changes.
19+ // /
1420// / \sa \ref Matcher, \ref IndexQueryHandler
1521// /
1622class ALBERT_EXPORT MatchConfig
1723{
1824public:
25+
1926 // /
20- // / The separator regex used to split the compared strings .
27+ // / Match strings error tolerant .
2128 // /
22- QRegularExpression separator_regex =
23- // QRegularExpression(R"([\s\\\/\-\[\](){}#!?<>"'=+*.:,;_]+)");
24- // make doxygen happy
25- QRegularExpression (" ([\\ s\\\\ /\\ -\\ [\\ ](){}#!?<>\" '=+*.:,;_]+)" );
29+ bool fuzzy = false ;
2630
2731 // /
2832 // / Match strings case insensitive.
2933 // /
3034 bool ignore_case = true ;
3135
3236 // /
33- // / Match strings normalized .
37+ // / Match strings independent of their order .
3438 // /
35- bool ignore_diacritics = true ;
39+ bool ignore_word_order = true ;
3640
3741 // /
38- // / Match strings independent of their order .
42+ // / Match strings normalized .
3943 // /
40- bool ignore_word_order = true ;
44+ bool ignore_diacritics = true ;
4145
4246 // /
43- // / Match strings error tolerant .
47+ // / The separator regex used to split the compared strings .
4448 // /
45- bool fuzzy = false ;
49+ QRegularExpression separator_regex = default_separator_regex ;
4650
4751 // /
4852 // / The error tolerance.
@@ -52,4 +56,4 @@ class ALBERT_EXPORT MatchConfig
5256 static const uint error_tolerance_divisor = 4 ;
5357};
5458
55- }
59+ } // namespace albert
0 commit comments