Skip to content

Commit b530190

Browse files
Made spelling suggestion case sensitive
... and fixed a bug in the test data. This reduced the count of failures in the Suggestion.spellingSuggestions unit test from 8 to 1: [ RUN ] Suggestion.spellingSuggestions Resolve redirect set index test/suggestion.cpp:841: Failure Expected equality of these values: getSpellingSuggestions(a, "Lax", 1) Which is: {} std::vector<std::string> ({"Lachs"}) Which is: { "Lachs" } [ FAILED ] Suggestion.spellingSuggestions (260 ms) The spelling correction "Lax -> Lachs" is not returned because the max edit distance is capped at (length(query_word) - 1) which reduces our passed value of the max edit distance argument from 3 to 2. It is not clear why the client's test works.
1 parent 04d82ad commit b530190

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/suggestion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ const TermCollection& SuggestionDataBase::getAllSuggestionTerms() const
406406
}
407407

408408
SuggestionSearch::Results SuggestionSearch::getSpellingSuggestions(uint32_t maxCount) const {
409-
QueryInfo queryInfo(removeAccents(m_query));
409+
QueryInfo queryInfo(m_query);
410410

411411
SuggestionSearch::Results r;
412412
if ( !queryInfo.wordBeingEdited().empty() ) {

test/suggestion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ TEST(Suggestion, spellingSuggestions) {
785785
"Umweltstandard",
786786
"Unfug",
787787
"Wohnzimmer",
788-
"Zunge"
788+
"Zunge",
789789
"aber",
790790
"abonnieren",
791791
"amtieren",

0 commit comments

Comments
 (0)