[1.25.11] Fix problem with temporary language change when using a voice-variant.

lang=hu  Merge "nem" with next word.
lang=ro  Many additions to ro_list.  Change phoneme [o].
lang=af  Update phoneme [R], which also appears as [R3] in general consonants.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@27 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-05-29 17:05:46 +00:00
parent e4ab27025d
commit aeca951879
23 changed files with 346 additions and 94 deletions
+11 -1
View File
@@ -892,6 +892,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
int mnem;
int post_tonic;
int opt_length;
int done;
unsigned char vowel_stress[N_WORD_PHONEMES/2];
char syllable_type[N_WORD_PHONEMES/2];
@@ -1131,6 +1132,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
}
#endif
done = 0;
for(v=1; v<vowel_count; v++)
{
if(vowel_stress[v] == 0)
@@ -1140,6 +1142,13 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
// flag: don't give secondary stress to final vowel
}
else
if((langopts.stress_flags & 0x8000) && (done == 0))
{
vowel_stress[v] = (char)stress;
done =1;
stress = 3; /* use secondary stress for remaining syllables */
}
else
if((vowel_stress[v-1] <= 1) && (vowel_stress[v+1] <= 1))
{
/* trochaic: give stress to vowel surrounded by unstressed vowels */
@@ -1156,6 +1165,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int
// should start with secondary stress on the first syllable, or should it count back from
// the primary stress and put secondary stress on alternate syllables?
vowel_stress[v] = (char)stress;
done =1;
stress = 3; /* use secondary stress for remaining syllables */
}
}
@@ -1787,7 +1797,7 @@ void Translator::MatchRule(char *word[], const char *group, char *rule, MatchRec
break;
case '-':
if((letter == ' ') && (word_flags & FLAG_HYPHEN_AFTER))
if((letter == '-') || ((letter == ' ') && (word_flags & FLAG_HYPHEN_AFTER)))
{
match.points += (22-distance_right); // one point more than match against space
}