small mods inocuous or auxiliary to case/diac sensitivity but which can live in main branch

This commit is contained in:
Jean-Francois Dockes
2012-09-13 12:25:01 +02:00
parent 25f4fc3b2c
commit e0bc65bfdd
12 changed files with 247 additions and 159 deletions
+2
View File
@@ -102,6 +102,8 @@ static char usage [] =
" -m : dump the whole document meta[] array for each result\n"
" -A : output the document abstracts\n"
" -S fld : sort by field <fld>\n"
" -s stemlang : set stemming language to use (must exist in index...)\n"
" Use -s \"\" to turn off stem expansion\n"
" -D : sort descending\n"
" -i <dbdir> : additional index, several can be given\n"
" -e use url encoding (%xx) for urls\n"
+13 -16
View File
@@ -166,6 +166,9 @@ static Rcl::SearchData *wasaQueryToRcl(RclConfig *config, WasaQuery *wasa,
}
// "Regular" processing follows:
unsigned int mods = (unsigned int)(*it)->m_modifiers;
nclause = 0;
switch ((*it)->m_op) {
case WasaQuery::OP_NULL:
case WasaQuery::OP_AND:
@@ -192,8 +195,6 @@ static Rcl::SearchData *wasaQueryToRcl(RclConfig *config, WasaQuery *wasa,
}
}
unsigned int mods = (unsigned int)(*it)->m_modifiers;
// I'm not sure I understand the phrase/near detection
// thereafter anymore, maybe it would be better to have an
// explicit flag. Mods can only be set after a double
@@ -216,12 +217,6 @@ static Rcl::SearchData *wasaQueryToRcl(RclConfig *config, WasaQuery *wasa,
LOGERR(("wasaQueryToRcl: out of memory\n"));
return 0;
}
if (mods & WasaQuery::WQM_NOSTEM) {
nclause->addModifier(Rcl::SearchDataClause::SDCM_NOSTEMMING);
}
if ((*it)->m_weight != 1.0)
nclause->setWeight((*it)->m_weight);
sdata->addClause(nclause);
}
break;
@@ -248,11 +243,6 @@ static Rcl::SearchData *wasaQueryToRcl(RclConfig *config, WasaQuery *wasa,
LOGERR(("wasaQueryToRcl: out of memory\n"));
return 0;
}
if ((*it)->m_modifiers & WasaQuery::WQM_NOSTEM)
nclause->setModifiers(Rcl::SearchDataClause::SDCM_NOSTEMMING);
if ((*it)->m_weight != 1.0)
nclause->setWeight((*it)->m_weight);
sdata->addClause(nclause);
break;
case WasaQuery::OP_OR:
@@ -272,10 +262,17 @@ static Rcl::SearchData *wasaQueryToRcl(RclConfig *config, WasaQuery *wasa,
reason = "Out of memory";
return 0;
}
if ((*it)->m_modifiers & WasaQuery::WQM_NOSTEM)
nclause->setModifiers(Rcl::SearchDataClause::SDCM_NOSTEMMING);
sdata->addClause(nclause);
}
if (mods & WasaQuery::WQM_NOSTEM)
nclause->addModifier(Rcl::SearchDataClause::SDCM_NOSTEMMING);
if (mods & WasaQuery::WQM_DIACSENS)
nclause->addModifier(Rcl::SearchDataClause::SDCM_DIACSENS);
if (mods & WasaQuery::WQM_CASESENS)
nclause->addModifier(Rcl::SearchDataClause::SDCM_CASESENS);
if ((*it)->m_weight != 1.0)
nclause->setWeight((*it)->m_weight);
sdata->addClause(nclause);
}
return sdata;