Result list: improve the spelling suggestions now presented as links which will replace the appropriate word inside the query
This commit is contained in:
@@ -290,17 +290,24 @@ void ResListPager::displayPage(RclConfig *config)
|
||||
vector<string>uterms;
|
||||
m_docSource->getUTerms(uterms);
|
||||
if (!uterms.empty()) {
|
||||
vector<string> spellings;
|
||||
map<string, vector<string> > spellings;
|
||||
suggest(uterms, spellings);
|
||||
if (!spellings.empty()) {
|
||||
chunk <<
|
||||
trans("<p><i>Alternate spellings (accents suppressed): </i>");
|
||||
for (vector<string>::iterator it = spellings.begin();
|
||||
it != spellings.end(); it++) {
|
||||
chunk << *it;
|
||||
chunk << " ";
|
||||
}
|
||||
chunk << "</p>";
|
||||
trans("<p><i>Alternate spellings (accents suppressed): </i>")
|
||||
<< "<br /><blockquote>";
|
||||
|
||||
for (map<string, vector<string> >::const_iterator it0 =
|
||||
spellings.begin(); it0 != spellings.end(); it0++) {
|
||||
chunk << "<b>" << it0->first << "</b> : ";
|
||||
for (vector<string>::const_iterator it =
|
||||
it0->second.begin();
|
||||
it != it0->second.end(); it++) {
|
||||
chunk << *it << " ";
|
||||
}
|
||||
chunk << "<br />";
|
||||
}
|
||||
chunk << "</blockquote></p>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -111,7 +111,8 @@ public:
|
||||
virtual string prevUrl();
|
||||
virtual string pageTop() {return string();}
|
||||
virtual string iconUrl(RclConfig *, Rcl::Doc& doc);
|
||||
virtual void suggest(const vector<string>, vector<string>&sugg) {
|
||||
virtual void suggest(const vector<string>,
|
||||
map<string, vector<string> >& sugg) {
|
||||
sugg.clear();
|
||||
}
|
||||
virtual string absSep() {return "…";}
|
||||
|
||||
Reference in New Issue
Block a user