Browse Source

Use defines instead of hard-coded numbers for more clause logic.

master
Reece H. Dunn 8 years ago
parent
commit
92f703d98b
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      src/libespeak-ng/readclause.c
  2. 2
    2
      src/libespeak-ng/translate.c

+ 2
- 2
src/libespeak-ng/readclause.c View File

short_pause = CLAUSE_SHORTCOMMA; short_pause = CLAUSE_SHORTCOMMA;


if ((bufix1 > 0) && !(tr->langopts.param[LOPT_ANNOUNCE_PUNCT] & 2)) { if ((bufix1 > 0) && !(tr->langopts.param[LOPT_ANNOUNCE_PUNCT] & 2)) {
if ((attributes & ~0x8000) == CLAUSE_SEMICOLON)
if ((attributes & ~CLAUSE_OPTIONAL_SPACE_AFTER) == CLAUSE_SEMICOLON)
return CLAUSE_SHORTFALL; return CLAUSE_SHORTFALL;
return short_pause; return short_pause;
} }
continue; continue;
} }


if ((iswspace(c2) || (punct_data & 0x8000) || IsBracket(c2) || (c2 == '?') || Eof() || (c2 == ctrl_embedded))) { // don't check for '-' because it prevents recognizing ':-)'
if ((iswspace(c2) || (punct_data & CLAUSE_OPTIONAL_SPACE_AFTER) || IsBracket(c2) || (c2 == '?') || Eof() || (c2 == ctrl_embedded))) { // don't check for '-' because it prevents recognizing ':-)'
// note: (c2='?') is for when a smart-quote has been replaced by '?' // note: (c2='?') is for when a smart-quote has been replaced by '?'
is_end_clause = 1; is_end_clause = 1;
} }

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

charix[charix_top+2] = 0x7fff; charix[charix_top+2] = 0x7fff;
charix[charix_top+3] = 0; charix[charix_top+3] = 0;


clause_pause = (terminator & 0xfff) * 10; // mS
clause_pause = (terminator & CLAUSE_PAUSE) * 10; // mS
if (terminator & CLAUSE_PAUSE_LONG) if (terminator & CLAUSE_PAUSE_LONG)
clause_pause = clause_pause * 32; // pause value is *320mS not *10mS clause_pause = clause_pause * 32; // pause value is *320mS not *10mS


tone = (terminator >> 12) & 0x7;
tone = (terminator & CLAUSE_INTONATION_TYPE) >> 12;
if (tone2 != 0) { if (tone2 != 0) {
// override the tone type // override the tone type
tone = tone2; tone = tone2;

Loading…
Cancel
Save