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

@@ -611,7 +611,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output
short_pause = CLAUSE_SHORTCOMMA;

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 short_pause;
}
@@ -2000,7 +2000,7 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_
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 '?'
is_end_clause = 1;
}

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

@@ -1982,11 +1982,11 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change)
charix[charix_top+2] = 0x7fff;
charix[charix_top+3] = 0;

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

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

Loading…
Cancel
Save