increase slack for automatic phrases

This commit is contained in:
Jean-Francois Dockes 2011-10-20 13:25:33 +02:00
parent 6c72454396
commit 8d52e928d1

View File

@ -385,11 +385,16 @@ bool SearchData::maybeAddAutoPhrase(Rcl::Db& db, double freqThreshold)
}
// We can't make a phrase with a single word :)
if (TextSplit::countWords(swords) <= 1) {
int nwords = TextSplit::countWords(swords);
if (nwords <= 1) {
LOGDEB2(("SearchData::maybeAddAutoPhrase: ended with 1 word\n"));
return false;
}
// Increase the slack: we want to be a little more laxist than for
// an actual user-entered phrase
slack += 1 + nwords / 3;
SearchDataClauseDist *nclp =
new SearchDataClauseDist(SCLT_PHRASE, swords, slack, field);