mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-08 07:32:32 +00:00
The next_pause parameter of TranslateWord is not used, so remove it.
This commit is contained in:
@@ -552,7 +552,7 @@ static int compile_line(char *linebuf, char *dict_line, int *hash)
|
||||
|
||||
// PROBLEM vowel reductions are not applied to the translated phonemes
|
||||
// condition rules are not applied
|
||||
TranslateWord(translator, phonetic, 0, NULL, NULL);
|
||||
TranslateWord(translator, phonetic, NULL, NULL);
|
||||
text_not_phonemes = 0;
|
||||
strncpy0(encoded_ph, word_phonemes, N_WORD_BYTES-4);
|
||||
|
||||
|
||||
@@ -2909,7 +2909,7 @@ int Lookup(Translator *tr, const char *word, char *ph_out)
|
||||
option_sayas = 0; // don't speak replacement word as letter names
|
||||
text[0] = 0;
|
||||
strncpy0(&text[1], word1, sizeof(text));
|
||||
flags0 = TranslateWord(tr, &text[1], 0, NULL, NULL);
|
||||
flags0 = TranslateWord(tr, &text[1], NULL, NULL);
|
||||
strcpy(ph_out, word_phonemes);
|
||||
option_sayas = say_as;
|
||||
}
|
||||
|
||||
@@ -985,7 +985,7 @@ static int CheckDotOrdinal(Translator *tr, char *word, char *word_end, WORD_TAB
|
||||
// lang=hu don't treat dot as ordinal indicator if the next word is a month name ($alt). It may have a suffix.
|
||||
nextflags = 0;
|
||||
if (IsAlpha(c2))
|
||||
nextflags = TranslateWord(tr, &word_end[2], 0, NULL, NULL);
|
||||
nextflags = TranslateWord(tr, &word_end[2], NULL, NULL);
|
||||
|
||||
if ((tr->prev_dict_flags[0] & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG_COMMA_AFTER) || iswdigit(c2)))
|
||||
ordinal = 0; // TEST 09.02.10
|
||||
|
||||
@@ -764,7 +764,7 @@ int ChangeEquivalentPhonemes(Translator *tr, int lang2, char *phonemes)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wtab, char *word_out)
|
||||
int TranslateWord(Translator *tr, char *word_start, WORD_TAB *wtab, char *word_out)
|
||||
{
|
||||
// word1 is terminated by space (0x20) character
|
||||
|
||||
@@ -1531,7 +1531,7 @@ int SetTranslator2(const char *new_language)
|
||||
return new_phoneme_tab;
|
||||
}
|
||||
|
||||
static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pause, int next_pause)
|
||||
static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pause)
|
||||
{
|
||||
int flags = 0;
|
||||
int stress;
|
||||
@@ -1654,7 +1654,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
word_copy_len = ix;
|
||||
|
||||
word_replaced[2] = 0;
|
||||
flags = TranslateWord(translator, word, next_pause, wtab, &word_replaced[2]);
|
||||
flags = TranslateWord(translator, word, wtab, &word_replaced[2]);
|
||||
|
||||
if (flags & FLAG_SPELLWORD) {
|
||||
// re-translate the word as individual letters, separated by spaces
|
||||
@@ -1684,7 +1684,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
if (ok != 0) {
|
||||
strcpy(ph_buf, word_phonemes);
|
||||
|
||||
flags2[0] = TranslateWord(translator, p2+1, 0, wtab+1, NULL);
|
||||
flags2[0] = TranslateWord(translator, p2+1, wtab+1, NULL);
|
||||
if ((flags2[0] & FLAG_WAS_UNPRONOUNCABLE) || (word_phonemes[0] == phonSWITCH))
|
||||
ok = 0;
|
||||
|
||||
@@ -1706,11 +1706,11 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
if (ok) {
|
||||
*p2 = '-'; // replace next space by hyphen
|
||||
wtab[0].flags &= ~FLAG_ALL_UPPER; // prevent it being considered an abbreviation
|
||||
flags = TranslateWord(translator, word, next_pause, wtab, NULL); // translate the combined word
|
||||
flags = TranslateWord(translator, word, wtab, NULL); // translate the combined word
|
||||
if ((sylimit > 0) && (CountSyllables(p) > (sylimit & 0x1f))) {
|
||||
// revert to separate words
|
||||
*p2 = ' ';
|
||||
flags = TranslateWord(translator, word, next_pause, wtab, NULL);
|
||||
flags = TranslateWord(translator, word, wtab, NULL);
|
||||
} else {
|
||||
if (flags == 0)
|
||||
flags = flags2[0]; // no flags for the combined word, so use flags from the second word eg. lang-hu "nem december 7-e"
|
||||
@@ -1739,9 +1739,9 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
if (word_replaced[2] != 0) {
|
||||
word_replaced[0] = 0; // byte before the start of the word
|
||||
word_replaced[1] = ' ';
|
||||
flags = TranslateWord(translator2, &word_replaced[1], next_pause, wtab, NULL);
|
||||
flags = TranslateWord(translator2, &word_replaced[1], wtab, NULL);
|
||||
} else
|
||||
flags = TranslateWord(translator2, word, next_pause, wtab, &word_replaced[2]);
|
||||
flags = TranslateWord(translator2, word, wtab, &word_replaced[2]);
|
||||
}
|
||||
|
||||
if (p[0] != phonSWITCH)
|
||||
@@ -2865,7 +2865,7 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t
|
||||
|
||||
for (pw = &number_buf[1]; pw < pn;) {
|
||||
// keep wflags for each part, for FLAG_HYPHEN_AFTER
|
||||
dict_flags = TranslateWord2(tr, pw, &num_wtab[nw++], words[ix].pre_pause, 0);
|
||||
dict_flags = TranslateWord2(tr, pw, &num_wtab[nw++], words[ix].pre_pause);
|
||||
while (*pw++ != ' ')
|
||||
;
|
||||
words[ix].pre_pause = 0;
|
||||
@@ -2873,7 +2873,7 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t
|
||||
} else {
|
||||
pre_pause = 0;
|
||||
|
||||
dict_flags = TranslateWord2(tr, word, &words[ix], words[ix].pre_pause, words[ix+1].pre_pause);
|
||||
dict_flags = TranslateWord2(tr, word, &words[ix], words[ix].pre_pause);
|
||||
|
||||
if (pre_pause > words[ix+1].pre_pause) {
|
||||
words[ix+1].pre_pause = pre_pause;
|
||||
@@ -2886,7 +2886,7 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t
|
||||
memset(number_buf, ' ', 9);
|
||||
nx = utf8_in(&c_temp, pw);
|
||||
memcpy(&number_buf[2], pw, nx);
|
||||
TranslateWord2(tr, &number_buf[2], &words[ix], 0, 0);
|
||||
TranslateWord2(tr, &number_buf[2], &words[ix], 0);
|
||||
pw += nx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,7 +765,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy);
|
||||
int Unpronouncable(Translator *tr, char *word, int posn);
|
||||
void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, int tonic, int prev_stress);
|
||||
int TranslateRules(Translator *tr, char *p, char *phonemes, int size, char *end_phonemes, int end_flags, unsigned int *dict_flags);
|
||||
int TranslateWord(Translator *tr, char *word1, int next_pause, WORD_TAB *wtab, char *word_out);
|
||||
int TranslateWord(Translator *tr, char *word1, WORD_TAB *wtab, char *word_out);
|
||||
void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *tone, char **voice_change);
|
||||
int ReadClause(Translator *tr, FILE *f_in, char *buf, short *charix, int *charix_top, int n_buf, int *tone_type, char *voice_change);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user