Make dehyphenate (co-worker->coworker) optional
This commit is contained in:
@@ -321,8 +321,9 @@ bool RclConfig::updateMainConfig()
|
||||
m_mdrstate.init(m_conf);
|
||||
|
||||
setKeyDir(cstr_null);
|
||||
bool nocjk = false;
|
||||
if (getConfParam("nocjk", &nocjk) && nocjk == true) {
|
||||
|
||||
bool bvalue = false;
|
||||
if (getConfParam("nocjk", &bvalue) && bvalue == true) {
|
||||
TextSplit::cjkProcessing(false);
|
||||
} else {
|
||||
int ngramlen;
|
||||
@@ -333,14 +334,18 @@ bool RclConfig::updateMainConfig()
|
||||
}
|
||||
}
|
||||
|
||||
bool nonum = false;
|
||||
if (getConfParam("nonumbers", &nonum) && nonum == true) {
|
||||
bvalue = false;
|
||||
if (getConfParam("nonumbers", &bvalue) && bvalue == true) {
|
||||
TextSplit::noNumbers();
|
||||
}
|
||||
|
||||
bool fnmpathname = true;
|
||||
if (getConfParam("skippedPathsFnmPathname", &fnmpathname)
|
||||
&& fnmpathname == false) {
|
||||
bvalue = false;
|
||||
if (getConfParam("dehyphenate", &bvalue)) {
|
||||
TextSplit::deHyphenate(bvalue);
|
||||
}
|
||||
|
||||
bvalue = true;
|
||||
if (getConfParam("skippedPathsFnmPathname", &bvalue) && bvalue == false) {
|
||||
FsTreeWalker::setNoFnmPathname();
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +212,7 @@ bool TextSplit::isCJK(int c)
|
||||
bool TextSplit::o_processCJK = true;
|
||||
unsigned int TextSplit::o_CJKNgramLen = 2;
|
||||
bool TextSplit::o_noNumbers = false;
|
||||
bool TextSplit::o_deHyphenate = false;
|
||||
|
||||
// Final term checkpoint: do some checking (the kind which is simpler
|
||||
// to do here than in the main loop), then send term to our client.
|
||||
@@ -309,7 +310,8 @@ bool TextSplit::words_from_span(int bp)
|
||||
// Byte position of the span start
|
||||
int spboffs = bp - m_span.size();
|
||||
|
||||
if (spanwords == 2 && m_span[m_words_in_span[0].second] == '-') {
|
||||
if (o_deHyphenate && spanwords == 2 &&
|
||||
m_span[m_words_in_span[0].second] == '-') {
|
||||
unsigned int s0 = m_words_in_span[0].first;
|
||||
unsigned int l0 = m_words_in_span[0].second - m_words_in_span[0].first;
|
||||
unsigned int s1 = m_words_in_span[1].first;
|
||||
|
||||
@@ -52,6 +52,13 @@ public:
|
||||
o_noNumbers = true;
|
||||
}
|
||||
|
||||
// Given [co-worker] as input, do we also generate [coworker] ?
|
||||
// Set by rclconfig
|
||||
static bool o_deHyphenate;
|
||||
static void deHyphenate(bool on) {
|
||||
o_deHyphenate = on;
|
||||
}
|
||||
|
||||
enum Flags {
|
||||
// Default: will return spans and words (a_b, a, b)
|
||||
TXTS_NONE = 0,
|
||||
|
||||
Reference in New Issue
Block a user