mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 14:17:12 +00:00
[1.45.45]
Fixed bug where SSML voice change didn't remember an initially specified Klatt variant. Removed some unused variables and redundant initializations. Patch to fix a spike from Klatt function setzeroabc() git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@275 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+6
-16
@@ -832,7 +832,6 @@ int Unpronouncable(Translator *tr, char *word, int posn)
|
||||
int vowel_posn=9;
|
||||
int index;
|
||||
int count;
|
||||
int apostrophe=0;
|
||||
|
||||
utf8_in(&c,word);
|
||||
if((tr->letter_bits_offset > 0) && (c < 0x241))
|
||||
@@ -868,10 +867,7 @@ int Unpronouncable(Translator *tr, char *word, int posn)
|
||||
break;
|
||||
}
|
||||
|
||||
if(c == '\'')
|
||||
apostrophe = 1;
|
||||
else
|
||||
if(!iswalpha(c))
|
||||
if((c != '\'') && !iswalpha(c))
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1123,7 +1119,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
|
||||
int final_ph2;
|
||||
int mnem;
|
||||
int mnem2;
|
||||
int post_tonic;
|
||||
int post_tonic; // currently not used
|
||||
int opt_length;
|
||||
int done;
|
||||
int stressflags;
|
||||
@@ -1387,7 +1383,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
|
||||
{
|
||||
int wt;
|
||||
int max_weight = -1;
|
||||
int prev_stressed;
|
||||
// int prev_stressed;
|
||||
|
||||
// find the heaviest syllable, excluding the final syllable
|
||||
for(ix = 1; ix < (vowel_count-1); ix++)
|
||||
@@ -1397,7 +1393,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
|
||||
if((wt = syllable_weight[ix]) >= max_weight)
|
||||
{
|
||||
max_weight = wt;
|
||||
prev_stressed = stressed_syllable;
|
||||
// prev_stressed = stressed_syllable;
|
||||
stressed_syllable = ix;
|
||||
}
|
||||
}
|
||||
@@ -2166,7 +2162,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
|
||||
// next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length
|
||||
end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f);
|
||||
|
||||
if((tr->word_vowel_count == 0) && !(end_type & SUFX_P))
|
||||
if((tr->word_vowel_count == 0) && !(end_type & SUFX_P) && (tr->langopts.param[LOPT_SUFFIX] & 1))
|
||||
failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr).
|
||||
else
|
||||
{
|
||||
@@ -2435,9 +2431,8 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
|
||||
Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */
|
||||
|
||||
unsigned char c, c2;
|
||||
unsigned int c12, c123;
|
||||
unsigned int c12;
|
||||
int wc=0;
|
||||
int wc_prev;
|
||||
int wc_bytes;
|
||||
char *p2; /* copy of p for use in double letter chain match */
|
||||
int found;
|
||||
@@ -2497,7 +2492,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
|
||||
|
||||
while(((c = *p) != ' ') && (c != 0))
|
||||
{
|
||||
wc_prev = wc;
|
||||
wc_bytes = utf8_in(&wc,p);
|
||||
if(IsAlpha(wc))
|
||||
any_alpha++;
|
||||
@@ -2540,7 +2534,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
|
||||
/* there are some 2 byte chains for this initial letter */
|
||||
c2 = p[1];
|
||||
c12 = c + (c2 << 8); /* 2 characters */
|
||||
c123 = c12 + (p[2] << 16);
|
||||
|
||||
g1 = tr->groups2_start[c];
|
||||
for(g=g1; g < (g1+n); g++)
|
||||
@@ -3213,13 +3206,10 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
|
||||
if(option_phonemes == 2)
|
||||
{
|
||||
unsigned int flags1 = 0;
|
||||
char ph_decoded[N_WORD_PHONEMES];
|
||||
int textmode;
|
||||
|
||||
DecodePhonemes(phonetic,ph_decoded);
|
||||
if(flags != NULL)
|
||||
flags1 = flags[0];
|
||||
|
||||
if((dictionary_flags & FLAG_TEXTMODE) == 0)
|
||||
textmode = 0;
|
||||
|
||||
Reference in New Issue
Block a user