mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-01 13:54:20 +00:00
Merge branch 'master' into android
Conflicts: platforms/windows/make_espeakedit.iss
This commit is contained in:
+12
-9
@@ -611,7 +611,7 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int
|
||||
break; // # is subscript-h, but only for consonants
|
||||
|
||||
// ignore digits after the first character
|
||||
if(!first && isdigit(c))
|
||||
if(!first && IsDigit09(c))
|
||||
continue;
|
||||
|
||||
if((c >= 0x20) && (c < 128))
|
||||
@@ -1499,8 +1499,8 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
|
||||
else
|
||||
{
|
||||
// no long vowels or consonant clusters
|
||||
if(vowel_count > 4)
|
||||
stressed_syllable = vowel_count - 3;
|
||||
if(vowel_count > 5)
|
||||
stressed_syllable = vowel_count - 3; // more than 4 syllables
|
||||
else
|
||||
stressed_syllable = vowel_count - 1;
|
||||
}
|
||||
@@ -2698,7 +2698,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c
|
||||
{
|
||||
if(tr->langopts.alt_alphabet == alphabet->offset)
|
||||
{
|
||||
sprintf(phonemes,"%c%s",phonSWITCH, tr->langopts.alt_alphabet_lang);
|
||||
sprintf(phonemes,"%c%s",phonSWITCH, WordToString2(tr->langopts.alt_alphabet_lang));
|
||||
return(0);
|
||||
}
|
||||
if(alphabet->flags & AL_WORDS)
|
||||
@@ -2988,6 +2988,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
const char *word_end;
|
||||
const char *word1;
|
||||
int wflags = 0;
|
||||
int lookup_symbol;
|
||||
char word_buf[N_WORD_BYTES+1];
|
||||
char dict_flags_buf[80];
|
||||
|
||||
@@ -2996,6 +2997,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
wflags = wtab->flags;
|
||||
}
|
||||
|
||||
lookup_symbol = flags[1] & FLAG_LOOKUP_SYMBOL;
|
||||
word1 = word;
|
||||
if(tr->transpose_min > 0)
|
||||
{
|
||||
@@ -3182,9 +3184,9 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
continue;
|
||||
}
|
||||
|
||||
if((dictionary_flags2 & FLAG_ATEND) && (word_end < translator->clause_end))
|
||||
if((dictionary_flags2 & FLAG_ATEND) && (word_end < translator->clause_end) && (lookup_symbol==0))
|
||||
{
|
||||
// only use this pronunciation if it's the last word of the clause
|
||||
// only use this pronunciation if it's the last word of the clause, or called from Lookup()
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3196,7 +3198,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
|
||||
if((dictionary_flags2 & FLAG_SENTENCE) && !(translator->clause_terminator & CLAUSE_BIT_SENTENCE))
|
||||
{
|
||||
// only uis this clause is a sentence , i.e. terminator is {. ? !} not {, : :}
|
||||
// only if this clause is a sentence , i.e. terminator is {. ? !} not {, : :}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3364,7 +3366,7 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f
|
||||
if(((c = *word1++)==0) || (c == ' '))
|
||||
break;
|
||||
|
||||
if((c=='.') && (length > 0) && (isdigit(word[length-1])))
|
||||
if((c=='.') && (length > 0) && (IsDigit09(word[length-1])))
|
||||
break; // needed for lang=hu, eg. "december 2.-ig"
|
||||
|
||||
word[length] = c;
|
||||
@@ -3475,7 +3477,8 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f
|
||||
int Lookup(Translator *tr, const char *word, char *ph_out)
|
||||
{//===================================================
|
||||
unsigned int flags[2];
|
||||
flags[0] = flags[1] = 0;
|
||||
flags[0] = 0;
|
||||
flags[1] = FLAG_LOOKUP_SYMBOL;
|
||||
char *word1 = (char *)word;
|
||||
return(LookupDictList(tr, &word1, ph_out, flags, 0, NULL));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user