add underscoreasletter config variable to process _ as a letter

This commit is contained in:
Jean-Francois Dockes
2020-09-13 15:40:28 +02:00
parent efaa4796b1
commit df09d65a4e
4 changed files with 33 additions and 6 deletions
+8 -1
View File
@@ -118,6 +118,13 @@ void TextSplit::staticConfInit(RclConfig *config)
}
}
bvalue = false;
if (config->getConfParam("underscoreasletter", &bvalue)) {
if (bvalue) {
charclasses[int('_')] = A_LLETTER;
}
}
string kotagger;
config->getConfParam("hangultagger", kotagger);
if (!kotagger.empty()) {
@@ -855,7 +862,7 @@ bool TextSplit::text_to_words(const string &in)
goto SPACE;
case '@':
case '_':
case '_': // If underscoreasletter is set, we'll never get this
case '\'':
// If in word, potential span: o'brien, jf@dockes.org,
// else just ignore