From 8d52e928d1e8ce7d1103a4edc25d96a0639edf44 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 20 Oct 2011 13:25:33 +0200 Subject: [PATCH] increase slack for automatic phrases --- src/rcldb/searchdata.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp index 11cc713f..774a2854 100644 --- a/src/rcldb/searchdata.cpp +++ b/src/rcldb/searchdata.cpp @@ -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);