--- a/src/qtgui/reslist.cpp
+++ b/src/qtgui/reslist.cpp
@@ -190,32 +190,26 @@
LOGERR(("QtGuiResListPager:: aspell not initialized\n"));
return;
}
+
for (vector<string>::const_iterator uit = uterms.begin();
uit != uterms.end(); uit++) {
list<string> asuggs;
string reason;
- // If the term is in the index, we don't suggest alternatives.
- // Actually, we may want to check the frequencies and propose something
- // anyway if a possible variation is much more common (as google does)
-#warning need to take case and diacs sensibility into account somehow
- // Maybe use the xapian index instead ? How to retrieve the
- // sensitivity flags ?
-
- // We used to call aspell->check() here and continue if it
- // succeeded. but this does not work if we are in
- // case-sensitive mode and the term was not found because of a
- // case difference (our aspell is all lowercase).
- // if (aspell->check(*uit, reason))
- // continue;
- // else if (!reason.empty())
- // return;
-
+ // If the term is in the dictionary, Aspell::suggest won't
+ // list alternatives. In fact we may want to check the
+ // frequencies and propose something anyway if a possible
+ // variation is much more common (as google does) ?
if (!aspell->suggest(*rcldb, *uit, asuggs, reason)) {
LOGERR(("QtGuiResListPager::suggest: aspell failed: %s\n",
reason.c_str()));
continue;
}
+
+ // We should check that the term stems differently from the
+ // base word (else it's not useful to expand the search). Or
+ // is it ? This should depend if stemming is turned on or not
+
if (!asuggs.empty()) {
sugg[*uit] = vector<string>(asuggs.begin(), asuggs.end());
if (sugg[*uit].size() > 5)