|
a/src/rcldb/stemdb.cpp |
|
b/src/rcldb/stemdb.cpp |
|
... |
|
... |
233 |
list<string>& result)
|
233 |
list<string>& result)
|
234 |
{
|
234 |
{
|
235 |
try {
|
235 |
try {
|
236 |
Xapian::Stem stemmer(lang);
|
236 |
Xapian::Stem stemmer(lang);
|
237 |
string stem = stemmer(term);
|
237 |
string stem = stemmer(term);
|
238 |
LOGDEB(("stemExpand: [%s] stem-> [%s]\n", term.c_str(), stem.c_str()));
|
238 |
LOGDEB(("stemExpand:%s: [%s] stem-> [%s]\n",
|
|
|
239 |
lang.c_str(), term.c_str(), stem.c_str()));
|
239 |
|
240 |
|
240 |
// Open stem database
|
241 |
// Open stem database
|
241 |
string stemdbdir = stemdbname(dbdir, lang);
|
242 |
string stemdbdir = stemdbname(dbdir, lang);
|
242 |
Xapian::Database sdb(stemdbdir);
|
243 |
Xapian::Database sdb(stemdbdir);
|
243 |
LOGDEB0(("stemExpand: %s lastdocid: %d\n",
|
244 |
LOGDEB0(("stemExpand: %s lastdocid: %d\n",
|
|
... |
|
... |
274 |
result.push_back(term);
|
275 |
result.push_back(term);
|
275 |
}
|
276 |
}
|
276 |
if (find(result.begin(), result.end(), stem) == result.end()) {
|
277 |
if (find(result.begin(), result.end(), stem) == result.end()) {
|
277 |
result.push_back(stem);
|
278 |
result.push_back(stem);
|
278 |
}
|
279 |
}
|
279 |
LOGDEB0(("stemExpand: %s -> %s\n", stem.c_str(),
|
280 |
LOGDEB0(("stemExpand:%s: %s -> %s\n", lang.c_str(), stem.c_str(),
|
280 |
stringlistdisp(result).c_str()));
|
281 |
stringlistdisp(result).c_str()));
|
281 |
|
282 |
|
282 |
} catch (...) {
|
283 |
} catch (...) {
|
283 |
LOGERR(("stemExpand: error accessing stem db. dbdir [%s] lang [%s]\n",
|
284 |
LOGERR(("stemExpand: error accessing stem db. dbdir [%s] lang [%s]\n",
|
284 |
dbdir.c_str(), lang.c_str()));
|
285 |
dbdir.c_str(), lang.c_str()));
|