if (letter == 0xe000+'(') { | if (letter == 0xe000+'(') { | ||||
if (pre_pause < tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED]) | if (pre_pause < tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED]) | ||||
pre_pause = tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED]; // a bracket, already spoken by AnnouncePunctuation() | pre_pause = tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED]; // a bracket, already spoken by AnnouncePunctuation() | ||||
} | |||||
} | |||||
if (IsBracket(letter)) { | if (IsBracket(letter)) { | ||||
if (pre_pause < tr->langopts.param[LOPT_BRACKET_PAUSE]) | if (pre_pause < tr->langopts.param[LOPT_BRACKET_PAUSE]) | ||||
pre_pause = tr->langopts.param[LOPT_BRACKET_PAUSE]; | pre_pause = tr->langopts.param[LOPT_BRACKET_PAUSE]; | ||||
return 0; | return 0; | ||||
} | } | ||||
void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags) | |||||
{ | |||||
// apply after the translation is complete | |||||
int ix; | |||||
int len; | |||||
char *p; | |||||
len = strlen(phonemes); | |||||
if (tr->langopts.param[LOPT_ALT] & 2) { | |||||
for (ix = 0; ix < (len-1); ix++) { | |||||
if (phonemes[ix] == phonSTRESS_P) { | |||||
p = &phonemes[ix+1]; | |||||
if ((dict_flags & FLAG_ALT2_TRANS) != 0) { | |||||
if (*p == PhonemeCode('E')) | |||||
*p = PhonemeCode('e'); | |||||
if (*p == PhonemeCode('O')) | |||||
*p = PhonemeCode('o'); | |||||
} else { | |||||
if (*p == PhonemeCode('e')) | |||||
*p = PhonemeCode('E'); | |||||
if (*p == PhonemeCode('o')) | |||||
*p = PhonemeCode('O'); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
int TransposeAlphabet(Translator *tr, char *text) | int TransposeAlphabet(Translator *tr, char *text) | ||||
{ | { | ||||
// transpose cyrillic alphabet (for example) into ascii (single byte) character codes | // transpose cyrillic alphabet (for example) into ascii (single byte) character codes |
void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len); | void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len); | ||||
void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags); | |||||
int TranslateWord(Translator *tr, char *word1, WORD_TAB *wtab, char *word_out); | int TranslateWord(Translator *tr, char *word1, WORD_TAB *wtab, char *word_out); | ||||
void TranslateClause(Translator *tr, int *tone, char **voice_change); | void TranslateClause(Translator *tr, int *tone, char **voice_change); | ||||
static void addPluralSuffixes(int flags, Translator *tr, char last_char, char *word_phonemes); | static void addPluralSuffixes(int flags, Translator *tr, char last_char, char *word_phonemes); | ||||
static void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags); | |||||
static void ChangeWordStress(Translator *tr, char *word, int new_stress); | static void ChangeWordStress(Translator *tr, char *word, int new_stress); | ||||
static int CheckDottedAbbrev(char *word1); | static int CheckDottedAbbrev(char *word1); | ||||
static int NonAsciiNumber(int letter); | static int NonAsciiNumber(int letter); | ||||
} | } | ||||
void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags) | |||||
{ | |||||
// apply after the translation is complete | |||||
int ix; | |||||
int len; | |||||
char *p; | |||||
len = strlen(phonemes); | |||||
if (tr->langopts.param[LOPT_ALT] & 2) { | |||||
for (ix = 0; ix < (len-1); ix++) { | |||||
if (phonemes[ix] == phonSTRESS_P) { | |||||
p = &phonemes[ix+1]; | |||||
if ((dict_flags & FLAG_ALT2_TRANS) != 0) { | |||||
if (*p == PhonemeCode('E')) | |||||
*p = PhonemeCode('e'); | |||||
if (*p == PhonemeCode('O')) | |||||
*p = PhonemeCode('o'); | |||||
} else { | |||||
if (*p == PhonemeCode('e')) | |||||
*p = PhonemeCode('E'); | |||||
if (*p == PhonemeCode('o')) | |||||
*p = PhonemeCode('O'); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
static void ChangeWordStress(Translator *tr, char *word, int new_stress) | static void ChangeWordStress(Translator *tr, char *word, int new_stress) | ||||
{ | { | ||||
int ix; | int ix; |