Browse Source

Fix dictionary_skipwords bug. It should be injected when re-structing method TranslateWord3.

master
Cameron Wong 2 years ago
parent
commit
45f25b5564
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/libespeak-ng/translate.c

+ 5
- 0
src/libespeak-ng/translate.c View File

wtab->flags &= ~FLAG_FIRST_UPPER; wtab->flags &= ~FLAG_FIRST_UPPER;
} }


// dictionary_skipwords is a global variable and TranslateWord3 will reset it to 0 at the beginning.
// However, dictionary_skipwords value is still needed outside this scope.
// So we backup and restore it at the end of this scope.
int skipwords = dictionary_skipwords;
TranslateWord3(tr, word_out, wtab, NULL, &any_stressed_words, current_alphabet, word_phonemes, sizeof(word_phonemes)); TranslateWord3(tr, word_out, wtab, NULL, &any_stressed_words, current_alphabet, word_phonemes, sizeof(word_phonemes));


int n; int n;
while (!isspace(*word_out)) ++word_out; while (!isspace(*word_out)) ++word_out;
while (isspace(*word_out)) ++word_out; while (isspace(*word_out)) ++word_out;
} }
dictionary_skipwords = skipwords;
} }


// If the list file contains a text replacement to another // If the list file contains a text replacement to another

Loading…
Cancel
Save