[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
}
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.25.10 27.May.07";
const char *version_string = "1.25.11 29.May.07";
const int version_phdata = 0x012501;
int option_device_number = -1;
+3 -2
View File
@@ -326,10 +326,11 @@ Translator *SelectTranslator(const char *name)
tr->langopts.vowel_pause = 0x20;
tr->langopts.stress_rule = 0;
tr->langopts.stress_flags = 0x36;
tr->langopts.stress_flags = 0x8036;
tr->langopts.unstressed_wd1 = 2;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; // don't propagate over word boundaries
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.param[LOPT_COMBINE_WORDS] = 99; // combine some prepositions with the following word
tr->langopts.long_stop = 130;
tr->langopts.numbers = 0x1809;
@@ -347,7 +348,7 @@ Translator *SelectTranslator(const char *name)
tr = new Translator();
SetupTranslator(tr,stress_lengths_is,stress_amps_is);
tr->langopts.stress_rule = 1;
tr->langopts.stress_rule = 0;
tr->langopts.stress_flags = 0x10;
tr->langopts.param[LOPT_IT_LENGTHEN] = 0x11; // remove lengthen indicator from unstressed vowels
tr->langopts.param[LOPT_KEEP_UNSTR_VOWEL] = 1;
+1
View File
@@ -262,6 +262,7 @@ typedef struct {
// bit9=stress last syllable if it doesn't end in vowel or "s" or "n" LANG=Spanish
// bit12= In a 2-syllable word, if one has primary stress then give the other secondary stress
// bit13= If there is only one syllable before the primary stress, give it a secondary stress
// bit15= Give stress to the first unstressed syllable
// bit16= Don't diminish consecutive syllables within a word.
int stress_flags;
+5 -2
View File
@@ -575,8 +575,11 @@ voice_t *LoadVoice(char *vname, int control)
strcpy(phonemes_name,language_type);
if((v = VoiceLookup(voicename)) != NULL)
voice = v;
if(!tone_only)
{
if((v = VoiceLookup(voicename)) != NULL)
voice = v;
}
VoiceReset(tone_only);
if(!tone_only)