Turn synonyms expansion off if the search is sensitive to either case or diacritics. + misc trace improvements

This commit is contained in:
Jean-Francois Dockes 2015-09-01 08:13:11 +02:00
parent aa676151a5
commit a0d7c41888
6 changed files with 28 additions and 11 deletions

View file

@ -66,6 +66,7 @@ src/filters/rclexecm.pyc
src/filters/rcllatinclass.pyc
src/recollindex
src/recollq
src/xadump
src/kde/kioslave/kio_recoll/builddir
src/python/recoll/build
src/python/recoll/recoll/__init__.pyc

View file

@ -43,6 +43,14 @@ public:
: m_op(op)
{
}
virtual std::string name() {
std::string nm("Unac: ");
if (m_op & UNACOP_UNAC)
nm += "UNAC ";
if (m_op & UNACOP_FOLD)
nm += "FOLD ";
return nm;
}
virtual std::string operator()(const std::string& in)
{
string out;

View file

@ -258,6 +258,8 @@ bool Db::termMatch(int typ_sens, const string &lang, const string &_term,
}
if (matchtyp == ET_STEM || (typ_sens & ET_SYNEXP)) {
// Note: if any of the above conds is true, we are insensitive to
// diacs and case (enforced in searchdatatox:termexpand
// Need stem expansion. Lowercase the result of accent and case
// expansion for input to stemdb.
for (unsigned int i = 0; i < lexp.size(); i++) {

View file

@ -464,8 +464,10 @@ bool SearchDataClauseSimple::expandTerm(Rcl::Db &db,
// If we are sensitive to case or diacritics turn stemming off
if (diac_sensitive || case_sensitive) {
LOGDEB0(("expandTerm: diac or case sens set -> stemexpand off\n"));
LOGDEB0(("expandTerm: diac or case sens set -> "
"stemexpand and synonyms off\n"));
nostemexp = true;
synonyms = false;
}
if (!case_sensitive || !diac_sensitive)

View file

@ -144,8 +144,11 @@ bool XapComputableSynFamMember::synExpand(const string& term,
string key = m_prefix + root;
LOGDEB(("XapCompSynFamMbr::synExpand([%s]): term [%s] root [%s] \n",
m_prefix.c_str(), term.c_str(), root.c_str()));
LOGDEB(("XapCompSynFamMbr::synExpand([%s]): term [%s] root [%s] "
"m_trans: %s filter: %s\n",
m_prefix.c_str(), term.c_str(), root.c_str(),
m_trans->name().c_str(),
filtertrans ? filtertrans->name().c_str() : "none"));
string ermsg;
try {

View file

@ -118,6 +118,7 @@ protected:
class SynTermTrans {
public:
virtual std::string operator()(const std::string&) = 0;
virtual std::string name() { return "SynTermTrans: unknown";}
};
/** A member (set of root-synonyms associations) of a SynFamily for