mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-04 22:38:33 +00:00
[1.26.06] Fixed check for dot in abbreviations, for multibyte characters.
Defined a Revision number macro in speak_lib.h for interface changes. Changes to formant rate smoothing so that it's proportional to frequency. Add phoneme translations for mbrola "it3" "it4" Italian voices. Added rule in *_rules files for "word starts with capital letter". git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@49 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+20
-7
@@ -1342,7 +1342,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
if(v_stress > 0)
|
||||
*output++ = stress_phonemes[v_stress]; // mark stress of all vowels except 0 (unstressed)
|
||||
|
||||
while((ph->reduce_to != 0) && !(dictionary_flags & FLAG_FOUND))
|
||||
while((ph->reduce_to != 0) && (((dictionary_flags & FLAG_FOUND)==0) || (langopts.param[LOPT_REDUCE] & 1)))
|
||||
{
|
||||
// this vowel can be reduced to another if the stress is below a specified value
|
||||
int reduce = 0;
|
||||
@@ -1368,8 +1368,9 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
|
||||
}
|
||||
|
||||
if(max_stress == 1) max_stress = 0;
|
||||
if(unstressed_word && langopts.param[LOPT_KEEP_UNSTR_VOWEL] && (v_stress >= max_stress))
|
||||
if(unstressed_word && (langopts.param[LOPT_REDUCE] & 0x2) && (v_stress >= max_stress))
|
||||
{
|
||||
// don't reduce the most stressed syllable in an unstressed word
|
||||
reduce = 0;
|
||||
}
|
||||
|
||||
@@ -2071,6 +2072,13 @@ void Translator::MatchRule(char *word[], const char *group, char *rule, MatchRec
|
||||
failed = 1;
|
||||
break;
|
||||
|
||||
case RULE_CAPITAL:
|
||||
if(word_flags & FLAG_FIRST_UPPER)
|
||||
match.points += 1;
|
||||
else
|
||||
failed = 1;
|
||||
break;
|
||||
|
||||
case '.':
|
||||
// dot in pre- section, match on any dot before this point in the word
|
||||
for(p=pre_ptr; *p != ' '; p--)
|
||||
@@ -2802,23 +2810,28 @@ int Translator::LookupDictList(char *word1, char *ph_out, unsigned int *flags, i
|
||||
int found;
|
||||
char *word2;
|
||||
unsigned char c;
|
||||
int nbytes;
|
||||
int c2;
|
||||
char word[N_WORD_BYTES];
|
||||
|
||||
length = 0;
|
||||
word2 = word1;
|
||||
while((word2[1]==' ') && (word2[2]=='.'))
|
||||
|
||||
while((word2[nbytes = utf8_in(&c2,word2,0)]==' ') && (word2[nbytes+1]=='.'))
|
||||
{
|
||||
// look for an abbreviation of the form a.b.c
|
||||
// try removing the spaces between the dots and looking for a match
|
||||
word[length++] = word2[0];
|
||||
memcpy(&word[length],word2,nbytes);
|
||||
length += nbytes;
|
||||
word[length++] = '.';
|
||||
word2 += 4;
|
||||
word2 += nbytes+3;
|
||||
}
|
||||
if(length > 0)
|
||||
{
|
||||
// found an abbreviation containing dots
|
||||
word[length] = word2[0];
|
||||
word[length+1] = 0;
|
||||
nbytes = utf8_in(&c2,word2,0);
|
||||
memcpy(&word[length],word2,nbytes);
|
||||
word[length+nbytes] = 0;
|
||||
found = LookupDict2(word,word2,ph_out,flags,end_flags);
|
||||
if(found)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user