Improved dialog handling
This commit is contained in:
parent
05ef692706
commit
667edf9485
|
@ -175,10 +175,10 @@ vector<string> extractDialogWords(string dialog) {
|
|||
boost::algorithm::to_lower(dialog);
|
||||
|
||||
// Insert silences where appropriate
|
||||
dialog = regex_replace(dialog, regex("[,;.:!?] "), " <sil> ");
|
||||
dialog = regex_replace(dialog, regex("[,;.:!?] |-"), " <sil> ");
|
||||
|
||||
// Remove all undesired characters
|
||||
dialog = regex_replace(dialog, regex("[^a-z.'\\-0-9<>]"), " ");
|
||||
dialog = regex_replace(dialog, regex("[^a-z.'\\0-9<>]"), " ");
|
||||
|
||||
// Collapse whitespace
|
||||
dialog = regex_replace(dialog, regex("\\s+"), " ");
|
||||
|
|
Loading…
Reference in New Issue