Browse Source

TranslateClauseWithTerminator: Look out for filling num_wtab (#2093)

master
Samuel Thibault 5 months ago
parent
commit
bf8d06c478
No account linked to committer's email address
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/libespeak-ng/translate.c

+ 3
- 3
src/libespeak-ng/translate.c View File

char *pn; char *pn;
char *pw; char *pw;
char number_buf[150]; char number_buf[150];
WORD_TAB num_wtab[50]; // copy of 'words', when splitting numbers into parts
WORD_TAB num_wtab[N_CLAUSE_WORDS]; // copy of 'words', when splitting numbers into parts


// start speaking at a specified word position in the text? // start speaking at a specified word position in the text?
count_words++; count_words++;
if ((n_digits > tr->langopts.max_digits) || (word[0] == '0')) if ((n_digits > tr->langopts.max_digits) || (word[0] == '0'))
words[ix].flags |= FLAG_INDIVIDUAL_DIGITS; words[ix].flags |= FLAG_INDIVIDUAL_DIGITS;


while (pn < &number_buf[sizeof(number_buf)-20]) {
while (pn < &number_buf[sizeof(number_buf)-20] && nw < N_CLAUSE_WORDS-1) {
if (!IsDigit09(c = *pw++) && (c != tr->langopts.decimal_sep)) if (!IsDigit09(c = *pw++) && (c != tr->langopts.decimal_sep))
break; break;


pn[16] = 0; pn[16] = 0;
nw = 0; nw = 0;


for (pw = &number_buf[3]; pw < pn;) {
for (pw = &number_buf[3]; pw < pn && nw < N_CLAUSE_WORDS;) {
// keep wflags for each part, for FLAG_HYPHEN_AFTER // keep wflags for each part, for FLAG_HYPHEN_AFTER
dict_flags = TranslateWord2(tr, pw, &num_wtab[nw++], words[ix].pre_pause); dict_flags = TranslateWord2(tr, pw, &num_wtab[nw++], words[ix].pre_pause);
while (*pw && *pw++ != ' ') while (*pw && *pw++ != ' ')

Loading…
Cancel
Save