diff --git a/.hgignore b/.hgignore index e9176fa6..d109eef5 100644 --- a/.hgignore +++ b/.hgignore @@ -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 diff --git a/src/rcldb/expansiondbs.h b/src/rcldb/expansiondbs.h index 6ed0bea9..577aac21 100644 --- a/src/rcldb/expansiondbs.h +++ b/src/rcldb/expansiondbs.h @@ -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; diff --git a/src/rcldb/rclterms.cpp b/src/rcldb/rclterms.cpp index 909ba8f3..ab570dc7 100644 --- a/src/rcldb/rclterms.cpp +++ b/src/rcldb/rclterms.cpp @@ -260,6 +260,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++) { @@ -318,14 +320,14 @@ bool Db::termMatch(int typ_sens, const string &lang, const string &_term, // Expand the resulting list for case (all stemdb content // is lowercase) - vector exp1; - for (vector::const_iterator it = lexp.begin(); - it != lexp.end(); it++) { - synac.synExpand(*it, exp1); - } - exp1.swap(lexp); - sort(lexp.begin(), lexp.end()); - lexp.erase(unique(lexp.begin(), lexp.end()), lexp.end()); + vector exp1; + for (vector::const_iterator it = lexp.begin(); + it != lexp.end(); it++) { + synac.synExpand(*it, exp1); + } + exp1.swap(lexp); + sort(lexp.begin(), lexp.end()); + lexp.erase(unique(lexp.begin(), lexp.end()), lexp.end()); } // Filter the result and get the stats, possibly add prefixes. diff --git a/src/rcldb/searchdatatox.cpp b/src/rcldb/searchdatatox.cpp index fefbf1bd..35f9636c 100644 --- a/src/rcldb/searchdatatox.cpp +++ b/src/rcldb/searchdatatox.cpp @@ -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) diff --git a/src/rcldb/synfamily.cpp b/src/rcldb/synfamily.cpp index 770e4815..cf726839 100644 --- a/src/rcldb/synfamily.cpp +++ b/src/rcldb/synfamily.cpp @@ -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 { diff --git a/src/rcldb/synfamily.h b/src/rcldb/synfamily.h index 219eb0ee..5253a052 100644 --- a/src/rcldb/synfamily.h +++ b/src/rcldb/synfamily.h @@ -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