Improved dialog handling

This commit is contained in:
Daniel Wolf 2016-02-10 21:53:58 +01:00
parent 05ef692706
commit 667edf9485
1 changed files with 2 additions and 2 deletions

View File

@ -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+"), " ");