mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
[1.39.36]
*_list files: add attribute $max3 to limit repetitions of a symbol to 3. -v command option, if the voice-name is not found, lookup using it as a language name. Windows: allow longer path names for espeak-data. -m option: Ignore text within <script> and <style> tags. Reduce default pitch to 80-117. WavegenCloseSound() check if there remain items to be spoken and re-open the sound channel. Reduce voicing before voiced plosives. Corrections to mbrola translation for lang=hi. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@205 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+51
-1
@@ -684,6 +684,7 @@ int Translator::IsLetterGroup(char *word, int group, int pre)
|
||||
// match the word against a list of utf-8 strings
|
||||
char *p;
|
||||
char *w;
|
||||
int len;
|
||||
|
||||
p = letterGroups[group];
|
||||
if(p == NULL)
|
||||
@@ -691,14 +692,26 @@ int Translator::IsLetterGroup(char *word, int group, int pre)
|
||||
|
||||
while(*p != RULE_GROUP_END)
|
||||
{
|
||||
w = word;
|
||||
if(pre)
|
||||
{
|
||||
len = strlen(p);
|
||||
w = word - len + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = word;
|
||||
}
|
||||
while(*p == *w)
|
||||
{
|
||||
w++;
|
||||
p++;
|
||||
}
|
||||
if(*p == 0)
|
||||
{
|
||||
if(pre)
|
||||
return(len);
|
||||
return(w-word); // matched a complete string
|
||||
}
|
||||
|
||||
while(*p++ != 0); // skip to end of string
|
||||
}
|
||||
@@ -1023,6 +1036,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
|
||||
unsigned char vowel_stress[N_WORD_PHONEMES/2];
|
||||
char syllable_weight[N_WORD_PHONEMES/2];
|
||||
char vowel_length[N_WORD_PHONEMES/2];
|
||||
unsigned char phonetic[N_WORD_PHONEMES];
|
||||
|
||||
static char consonant_types[16] = {0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0};
|
||||
@@ -1079,6 +1093,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
// long vowel, increase syllable weight
|
||||
weight++;
|
||||
}
|
||||
vowel_length[ix] = weight;
|
||||
|
||||
if(lengthened) p++; // advance over phonLENGTHEN
|
||||
|
||||
@@ -1150,6 +1165,14 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
}
|
||||
}
|
||||
}
|
||||
if(langopts.stress_flags & 0x80000)
|
||||
{
|
||||
// stress on last syllable if it has a long vowel, but previous syllable has a short vowel
|
||||
if(vowel_length[vowel_count - 1] > vowel_length[vowel_count - 2])
|
||||
{
|
||||
stressed_syllable = vowel_count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(vowel_stress[stressed_syllable] == 1)
|
||||
{
|
||||
@@ -2547,6 +2570,10 @@ int Translator::TranslateRules(char *p_start, char *phonemes, int ph_size, char
|
||||
}
|
||||
p += (wc_bytes-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
phonemes_repeat_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2590,6 +2617,7 @@ int Translator::TranslateRules(char *p_start, char *phonemes, int ph_size, char
|
||||
// any language specific changes ?
|
||||
ApplySpecialAttribute(phonemes,dict_flags0);
|
||||
memcpy(p_start,word_copy,strlen(word_copy));
|
||||
|
||||
return(0);
|
||||
} /* end of TranslateRules */
|
||||
|
||||
@@ -3127,6 +3155,28 @@ int Translator::LookupDictList(char **wordptr, char *ph_out, unsigned int *flags
|
||||
|
||||
found = LookupDict2(word, word1, ph_out, flags, end_flags, wtab);
|
||||
|
||||
if(flags[0] & FLAG_MAX3)
|
||||
{
|
||||
if(strcmp(ph_out, phonemes_repeat) == 0)
|
||||
{
|
||||
phonemes_repeat_count++;
|
||||
if(phonemes_repeat_count > 3)
|
||||
{
|
||||
ph_out[0] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy0(phonemes_repeat, ph_out, sizeof(phonemes_repeat));
|
||||
phonemes_repeat_count = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
phonemes_repeat_count = 0;
|
||||
}
|
||||
|
||||
|
||||
if((found == 0) && (flags[1] & FLAG_ACCENT))
|
||||
{
|
||||
int letter;
|
||||
|
||||
Reference in New Issue
Block a user