This commit is contained in:
Jean-Francois Dockes 2020-10-14 11:57:18 +02:00
parent ceecf5ff43
commit 2d21d4a460
4 changed files with 111 additions and 116 deletions

View File

@ -1115,20 +1115,19 @@ set<string> RclConfig::getIndexedFields() const
string RclConfig::fieldCanon(const string& f) const string RclConfig::fieldCanon(const string& f) const
{ {
string fld = stringtolower(f); string fld = stringtolower(f);
map<string, string>::const_iterator it = m_aliastocanon.find(fld); const auto it = m_aliastocanon.find(fld);
if (it != m_aliastocanon.end()) { if (it != m_aliastocanon.end()) {
LOGDEB1("RclConfig::fieldCanon: [" << f << "] -> [" << it->second << LOGDEB1("RclConfig::fieldCanon: [" << f << "] -> [" << it->second <<
"]\n"); "]\n");
return it->second; return it->second;
} }
LOGDEB1("RclConfig::fieldCanon: [" << (f) << "] -> [" << (fld) << "]\n"); LOGDEB1("RclConfig::fieldCanon: [" << f << "] -> [" << fld << "]\n");
return fld; return fld;
} }
string RclConfig::fieldQCanon(const string& f) const string RclConfig::fieldQCanon(const string& f) const
{ {
string fld = stringtolower(f); const auto it = m_aliastoqcanon.find(stringtolower(f));
map<string, string>::const_iterator it = m_aliastoqcanon.find(fld);
if (it != m_aliastoqcanon.end()) { if (it != m_aliastoqcanon.end()) {
LOGDEB1("RclConfig::fieldQCanon: [" << f << "] -> [" << it->second << LOGDEB1("RclConfig::fieldQCanon: [" << f << "] -> [" << it->second <<
"]\n"); "]\n");

View File

@ -442,5 +442,3 @@ bool recoll_ismainthread()
{ {
return std::this_thread::get_id() == mainthread_id; return std::this_thread::get_id() == mainthread_id;
} }

View File

@ -96,11 +96,11 @@ Extractor_init(rclx_ExtractorObject *self, PyObject *args, PyObject *kwargs)
} }
PyDoc_STRVAR(doc_Extractor_textextract, PyDoc_STRVAR(doc_Extractor_textextract,
"textextract(ipath)\n" "textextract(ipath)\n"
"Extract document defined by ipath and return a doc object. The doc.text\n" "Extract document defined by ipath and return a doc object. The doc.text\n"
"field has the document text as either text/plain or text/html\n" "field has the document text as either text/plain or text/html\n"
"according to doc.mimetype.\n" "according to doc.mimetype.\n"
); );
static PyObject * static PyObject *
Extractor_textextract(rclx_ExtractorObject* self, PyObject *args, Extractor_textextract(rclx_ExtractorObject* self, PyObject *args,
@ -153,9 +153,9 @@ Extractor_textextract(rclx_ExtractorObject* self, PyObject *args,
} }
PyDoc_STRVAR(doc_Extractor_idoctofile, PyDoc_STRVAR(doc_Extractor_idoctofile,
"idoctofile(ipath='', mimetype='', ofilename='')\n" "idoctofile(ipath='', mimetype='', ofilename='')\n"
"Extract document defined by ipath into a file, in its native format.\n" "Extract document defined by ipath into a file, in its native format.\n"
); );
static PyObject * static PyObject *
Extractor_idoctofile(rclx_ExtractorObject* self, PyObject *args, Extractor_idoctofile(rclx_ExtractorObject* self, PyObject *args,
PyObject *kwargs) PyObject *kwargs)
@ -224,11 +224,11 @@ static PyMethodDef Extractor_methods[] = {
}; };
PyDoc_STRVAR(doc_ExtractorObject, PyDoc_STRVAR(doc_ExtractorObject,
"Extractor()\n" "Extractor()\n"
"\n" "\n"
"An Extractor object can extract data from a native simple or compound\n" "An Extractor object can extract data from a native simple or compound\n"
"object.\n" "object.\n"
); );
static PyTypeObject rclx_ExtractorType = { static PyTypeObject rclx_ExtractorType = {
PyVarObject_HEAD_INIT(NULL, 0) PyVarObject_HEAD_INIT(NULL, 0)
"rclextract.Extractor", /*tp_name*/ "rclextract.Extractor", /*tp_name*/
@ -318,8 +318,8 @@ PyInit_rclextract(void)
#else #else
#define INITERROR return #define INITERROR return
PyMODINIT_FUNC PyMODINIT_FUNC
initrclextract(void) initrclextract(void)
#endif #endif
{ {
// We run recollinit. It's responsible for initializing some static data // We run recollinit. It's responsible for initializing some static data
@ -380,4 +380,3 @@ initrclextract(void)
return module; return module;
#endif #endif
} }

View File

@ -1066,7 +1066,7 @@ Query_executesd(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
// Move some data from the dedicated fields to the meta array to make // Move some data from the dedicated fields to the meta array to make
// fetching attributes easier. Needed because we only use the meta // fetching attributes easier. Needed because we only use the meta
// array when enumerating keys. Also for url which is also formatted. // array when enumerating keys. Also for url which is also formatted.
// But not that some fields are not copied, and are only reachable if // But note that some fields are not copied, and are only reachable if
// one knows their name (e.g. xdocid). // one knows their name (e.g. xdocid).
static void movedocfields(const RclConfig* rclconfig, Rcl::Doc *doc) static void movedocfields(const RclConfig* rclconfig, Rcl::Doc *doc)
{ {
@ -2205,4 +2205,3 @@ PyInit_recoll(void)
return module; return module;
#endif #endif
} }