|
|
@@ -919,7 +919,9 @@ static int UpperCaseInWord(Translator *tr, char *word, int c) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
// Same as TranslateClause except we also get the clause terminator used (full stop, comma, etc.). |
|
|
|
// Used by espeak_TextToPhonemesWithTerminator. |
|
|
|
void TranslateClauseWithTerminator(Translator *tr, int *tone_out, char **voice_change, int *terminator_out) |
|
|
|
{ |
|
|
|
int ix; |
|
|
|
int c; |
|
|
@@ -983,6 +985,10 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
MAKE_MEM_UNDEFINED(&source, sizeof(source)); |
|
|
|
terminator = ReadClause(tr, source, charix, &charix_top, N_TR_SOURCE, &tone, voice_change_name); |
|
|
|
|
|
|
|
if (terminator_out != NULL) { |
|
|
|
*terminator_out = terminator; |
|
|
|
} |
|
|
|
|
|
|
|
if (tone_out != NULL) { |
|
|
|
if (tone == 0) |
|
|
|
*tone_out = (terminator & CLAUSE_INTONATION_TYPE) >> 12; // tone type not overridden in ReadClause, use default |
|
|
@@ -1265,7 +1271,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
} else { |
|
|
|
if (iswlower(prev_in)) { |
|
|
|
// lower case followed by upper case, possibly CamelCase |
|
|
|
if ((prev_out != ' ') && UpperCaseInWord(tr, &sbuf[ix], c) == 0) { // start a new word |
|
|
|
if (UpperCaseInWord(tr, &sbuf[ix], c) == 0) { // start a new word |
|
|
|
c = ' '; |
|
|
|
space_inserted = true; |
|
|
|
prev_in_save = c; |
|
|
@@ -1276,7 +1282,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
|
|
|
|
if ((tr->translator_name == L('n', 'l')) && (letter_count == 2) && (c == 'j') && (prev_in == 'I')) { |
|
|
|
// Dutch words may capitalise initial IJ, don't split |
|
|
|
} else if ((prev_out != ' ') && IsAlpha(next2_in)) { |
|
|
|
} else if (IsAlpha(next2_in)) { |
|
|
|
// changing from upper to lower case, start new word at the last uppercase, if 3 or more letters |
|
|
|
c = ' '; |
|
|
|
space_inserted = true; |
|
|
@@ -1601,7 +1607,6 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
if (dict_flags & FLAG_SPELLWORD) { |
|
|
|
// redo the word, speaking single letters |
|
|
|
for (pw = word; *pw != ' ';) { |
|
|
|
memset(number_buf, 0, sizeof(number_buf)); |
|
|
|
memset(number_buf, ' ', 9); |
|
|
|
nx = utf8_in(&c_temp, pw); |
|
|
|
memcpy(&number_buf[2], pw, nx); |
|
|
@@ -1669,6 +1674,11 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void TranslateClause(Translator *tr, int *tone_out, char **voice_change) |
|
|
|
{ |
|
|
|
TranslateClauseWithTerminator(tr, tone_out, voice_change, NULL); |
|
|
|
} |
|
|
|
|
|
|
|
static int CalcWordLength(int source_index, int charix_top, short int *charix, WORD_TAB *words, int word_count) { |
|
|
|
int j; |
|
|
|
int k; |