[1.25.08] Fix to uft-8 recognizer.

lang=hu, set no secondary stress; [e:] [E] are closer, 
Don't consider mbrola voices during voice selection.
Fix voice variant not being set from SSML.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@23 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-05-25 09:58:46 +00:00
parent 20d045d44c
commit 863f1f1048
17 changed files with 118 additions and 104 deletions
+44 -43
View File
@@ -109,7 +109,7 @@ _16 s'Ez
_17 d'is:'Et
_18 d'is:'w^it
_19 d'is:n'@f
_20 v'E~
_20 v'E~
_21 v'E~te:E~
_22 v'E~td'Y
_23 v'E~t:tRw'a
@@ -214,38 +214,38 @@ une $u $nounf
// conjonctions
et e $u $pause
ou $u $pause
car $u $pause
soit $u $pause
mais $u $pause
ou u $u $pause
donc $u $pause
or $u $pause
ni $u $pause
car $u $pause
cependant $u $pause
néanmoins $u $pause
toutefois $u $pause
et e $u $brk
ou $u $brk
car $u $brk
soit $u $brk
mais $u $brk
ou u $u $brk
donc $u $brk
or $u $brk
ni $u $brk
car $u $brk
cependant $u $brk
néanmoins $u $brk
toutefois $u $brk
comme $u $pause
lorsque $u $pause
puisque $u $pause
quand $u $pause
que $u $pause
qui $u $pause
quoique $u $pause
si $u $pause
comme $u $brk
lorsque $u $brk
puisque $u $brk
quand $u $brk
que $u $brk
qui $u $brk
quoique $u $brk
si $u $brk
// (à cause que) $u $pause
// (ainsi que) $u $pause
// (à mesure que) $u $pause
// (après que) $u $pause
// (à moins que) $u $pause
// (au lieu que) $u $pause
// (aussitôt que) $u $pause
// (pendant que) $u $pause
// (à cause que) $u $brk
// (ainsi que) $u $brk
// (à mesure que) $u $brk
// (après que) $u $brk
// (à moins que) $u $brk
// (au lieu que) $u $brk
// (aussitôt que) $u $brk
// (pendant que) $u $brk
// (pourvu que) $u $pause
// pronouns
@@ -284,7 +284,7 @@ vos $u+
leurs $u+
// prepositions
de $u $nounf
de $u $nounf
du $u+ $nounf
des dEz2 $u $nounf
?2 des dez2 $u+ $nounf
@@ -294,21 +294,21 @@ des dEz2 $u $nounf
au $u $brk
aux $u $brk
dans $u+ $pause
sur $u+ $pause
par $u+ $pause
pour $u+ $pause
dans $u+ $brk
sur $u+ $brk
par $u+ $brk
pour $u+ $brk
en $u+ $brk
(en effet) A~nEf'E $pause
(en effet) A~nEf'E $brk
vers $u+ $pause
avec $u+ $pause
sans $u+ $pause
sous $u+ $pause
entre $u+ $pause
contre $u+ $pause
vers $u+ $brk
avec $u+ $brk
sans $u+ $brk
sous $u+ $brk
entre $u+ $brk
contre $u+ $brk
durant $pause
durant $brk
// negative
ne $u
@@ -386,6 +386,7 @@ echo Eko
fils fis
mars maRs
pays pEi
pourcent purs'A~
sens sA~s
c'est sEt2 $u
qu'à ka
+1 -1
View File
@@ -83,7 +83,7 @@
.group r
r R
A) r (A R
K) r (A R
K) r (A @-*
rr R
r (_ R
+7 -3
View File
@@ -88,9 +88,9 @@ ez $u // this
// Conjunctions
és $u $pause // and
de $u $pause // but
vagy $u $pause // or
és $u $pause $strend2 // and
de $u+ $pause // but
vagy $u+ $pause // or
mert $pause // because
miatt $pause // because
@@ -100,6 +100,9 @@ habár $pause // although
ha $u $pause // if
// Prepositions etc.
// Negative
nem $u+
ne $u+
@@ -107,6 +110,7 @@ ne $u+
// Unstressed adverbs etc.
néhány $u+
is $u // ??
// Verbs
+1 -1
View File
@@ -134,7 +134,7 @@
.group r
r R
A) r (A R
A) r (A *
C) r (A R
r (C r
rr R
+14 -13
View File
@@ -8,16 +8,17 @@
a A:
a (C% A
a (_ A
X) a (CCX A // single syllable with >= 2 final consonants
X) a (CCK A // single syllable with >= 2 final consonants
// or initial syllable with 3 consonants
ai AI
au aU
aa o: // å
aa (C% O
X) aa (CCX O
X) aa (CCK O
ae a: // æ
ae (C% a
X) ae (CCX a
X) ae (CCK a
.group b
@@ -45,7 +46,7 @@
.group e
e e:
e (C% E
X) e (CCX E
X) e (CCK E
ei aI
e (rC a // ??
&) e (_ @2
@@ -76,7 +77,7 @@
.group i
i i:
i (C% I
X) i (CCX I
X) i (CCK I
&) ig (_ I
.group j
@@ -109,12 +110,12 @@
.group o
o u:
o (C% O
X) o (CCX O
X) o (CCK O
oi OI
oe Y: // ø
oe (C% W
X) oe (CCX W
X) oe (CCK W
oey Yy
o (nd U
@@ -164,7 +165,7 @@
.group u
u u-:
u (C% u-
X) u (CCX u-
X) u (CCK u-
ui u-I
.group v
@@ -191,29 +192,29 @@
.group å
å o:
å (C% O
X) å (CCX O
X) å (CCK O
.group æ
æ E:
æ (r a:
æ (C% a
X) æ (CCX a
X) æ (CCK a
.group ø
ø Y:
ø (C% W
X) ø (CCX W
X) ø (CCK W
øy Yy
.group ä
ä E:
ä (C% E
X) ä (CCX E
X) ä (CCK E
.group ö
ö Y:
ö (C% W
X) ö (CCX W
X) ö (CCK W
.group
é 'e:
+4 -3
View File
@@ -438,16 +438,17 @@
1 vowel/@_bck hi
13 vowel/e en en_n af cy eo fr hu hr it pt pt_pt vi
2 vowel/e# en_sc
7 vowel/e_2 en_sc de hi hu sv no
6 vowel/e_2 en_sc de hi sv no
1 vowel/e_3 hu
1 vowel/e_5 en_sc
3 vowel/ee fr pl sv
2 vowel/e_e en_sc is
7 vowel/ee_1 en en_n pl it sv no zh_yue
4 vowel/ee_2 en cy hu nl
3 vowel/ee_2 en cy nl
1 vowel/ee#_2 sv
3 vowel/ee_3 af pt vi
3 vowel/ee_6 en_n sk sv
11 vowel/e_mid en_rp en_wm fr_ca hi sk cs hr es pt_pt no is
12 vowel/e_mid en_rp en_wm fr_ca hi hu sk cs hr es pt_pt no is
10 vowel/e_mid2 af de fi nl sk ro el sw
1 vowel/@_fnt hr
1 vowel/@_hgh no
+2 -2
View File
@@ -16,7 +16,7 @@ endphoneme
phoneme E
vowel starttype (e) endtype (e)
length 130
formants vowel/ee_2
formants vowel/e_mid
endphoneme
phoneme e
@@ -28,7 +28,7 @@ endphoneme
phoneme e:
vowel starttype (e) endtype (e)
length 240
formants vowel/e_2
formants vowel/e_3
endphoneme
phoneme A
Binary file not shown.
Binary file not shown.
+4 -1
View File
@@ -156,7 +156,10 @@ extern void VoiceReset(int control);
// to something other than the default "C". Then, not only Latin1 but also the
// other characters give the correct results with iswalpha() etc.
if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL)
setlocale(LC_CTYPE,"");
{
if(setlocale(LC_CTYPE,"UTF-8") == NULL)
setlocale(LC_CTYPE,"");
}
// Create the main frame window
+15 -23
View File
@@ -858,12 +858,6 @@ void CharsetToUnicode(const char *charset)
char* text[]=
{
"<voice xml:lang=\"en\" variant=\"1\">eSpeak.</voice>",
" <voice xml:lang=\"en\" gender=\"male\" variant=\"1\"><prosody rate=\"1.0\"> normally would, </prosody></voice>"
};
#ifdef deleted
void Test2()
@@ -908,6 +902,11 @@ int x;
}
#endif
char* text1[]=
{
"<voice xml:lang=\"en\" variant=\"2\">eSpeak.</voice>",
" <voice xml:lang=\"fr\" gender=\"male\" variant=\"3\"><prosody rate=\"1.0\"> normally would, </prosody></voice>"
};
void TestTest(int control)
{//=======================
@@ -924,7 +923,7 @@ void TestTest(int control)
//CharsetToUnicode("ISCII");
return;
//return;
if(control==2)
{
@@ -951,25 +950,18 @@ if(control==2)
espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS,100,NULL);
espeak_SetSynthCallback(TestSynthCallback);
// espeak_SetUriCallback(TestUriCallback);
voice.languages = "fr";
voice.gender = 0;
voice.age = 0;
voice.variant = 0;
ix = espeak_SetVoiceByName("pt-xx");
unsigned int unique_identifier=0;
int index=0;
espeak_Synth(text1[index], strlen(text1[index])+1, 0, POS_CHARACTER, 0, espeakSSML|espeakCHARS_UTF8, &unique_identifier, NULL);
voice2 = espeak_GetCurrentVoice();
espeak_SetParameter(espeakPUNCTUATION, 1, 0);
espeak_Synchronize();
// espeak_Cancel();
espeak_SetParameter(espeakPUNCTUATION, 1, 0);
// espeak_SetVoiceByProperties(&voice);
espeak_SetParameter(espeakRANGE,0,0);
espeak_Synth(textbuf,ix+1,0,POS_CHARACTER,0,espeakCHARS_8BIT+espeakSSML,NULL,NULL);
// for(voice.variant = 1; voice.variant < 9; voice.variant++)
// {
// espeak_SetVoiceByProperties(&voice);
// espeak_Synth(textbuf,ix+1,0,POS_CHARACTER,0,espeakCHARS_8BIT+espeakSSML,NULL,NULL);
// }
index++;
espeak_Synth(text1[index], strlen(text1[index])+1, 0, POS_CHARACTER, 0, espeakSSML|espeakCHARS_UTF8, &unique_identifier, NULL);
}
+2 -2
View File
@@ -286,7 +286,7 @@ static int GetC(void)
break;
}
if(((c2 & 0xc0) != 0x80) && ((c2 & m) != 0))
if((c2 & 0xc0) != 0x80)
{
GetC_unget(c2);
break;
@@ -963,7 +963,7 @@ static int GetVoiceAttributes(wchar_t *pw, int tag_type)
return(0); // <s> or <p> without language spec, nothing to do
ssml_sp = &ssml_stack[n_ssml_stack++];
attrcopy_utf8(ssml_sp->language,lang,sizeof(ssml_sp->language));
attrcopy_utf8(ssml_sp->voice_name,name,sizeof(ssml_sp->voice_name));
ssml_sp->voice_variant = attrnumber(variant,1,0)-1;
+4 -1
View File
@@ -259,7 +259,10 @@ static int initialise(void)
setlocale(LC_CTYPE,"ISO8859-1");
#else
if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL)
setlocale(LC_CTYPE,"");
{
if(setlocale(LC_CTYPE,"UTF-8") == NULL)
setlocale(LC_CTYPE,"");
}
#endif
+6 -3
View File
@@ -641,10 +641,13 @@ ESPEAK_API int espeak_Initialize(espeak_AUDIO_OUTPUT output_type, int buf_length
// to something other than the default "C". Then, not only Latin1 but also the
// other characters give the correct results with iswalpha() etc.
#ifdef PLATFORM_RISCOS
setlocale(LC_CTYPE,"ISO8859-1");
setlocale(LC_CTYPE,"ISO8859-1");
#else
if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL)
setlocale(LC_CTYPE,"");
if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL)
{
if(setlocale(LC_CTYPE,"UTF-8") == NULL)
setlocale(LC_CTYPE,"");
}
#endif
init_path(path);
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.25.06 23.May.07";
const char *version_string = "1.25.08 25.May.07";
const int version_phdata = 0x012501;
int option_device_number = -1;
+2 -1
View File
@@ -325,7 +325,8 @@ Translator *SelectTranslator(const char *name)
tr->langopts.vowel_pause = 0x10;
tr->langopts.stress_rule = 0;
tr->langopts.stress_flags = 0x16;
tr->langopts.stress_flags = 0x36;
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.long_stop = 130;
+11 -6
View File
@@ -874,7 +874,7 @@ voice_t *LoadVoiceVariant(const char *vname, int variant)
if((v != NULL) && (variant > 0))
{
sprintf(buf,"!variant%d",variant);
LoadVoice(buf,2);
v = LoadVoice(buf,2);
}
return(v);
}
@@ -1038,8 +1038,9 @@ static int ScoreVoice(espeak_VOICE *voice_spec, int spec_n_parts, int spec_lang_
} // end of ScoreVoice
static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices)
{//=========================================================================
static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices, int control)
{//======================================================================================
// control: bit0=1 include mbrola voices
int ix;
int score;
int nv; // number of candidates
@@ -1063,9 +1064,13 @@ static int SetVoiceScores(espeak_VOICE *voice_select, espeak_VOICE **voices)
nv = 0;
for(ix=0; ix<n_voices_list; ix++)
{
vp = voices_list[ix];
if(((control & 1) == 0) && (memcmp(vp->identifier,"mb/",3) == 0))
continue;
if((score = ScoreVoice(voice_select, n_parts, lang_len, voices_list[ix])) > 0)
{
voices[nv++] = vp = voices_list[ix];
voices[nv++] = vp;
vp->score = score;
}
}
@@ -1154,7 +1159,7 @@ espeak_VOICE *SelectVoice(espeak_VOICE *voice_select, int *variant)
espeak_ListVoices(NULL); // create the voices list
// select and sort voices for the required language
nv = SetVoiceScores(voice_select,voices);
nv = SetVoiceScores(voice_select,voices,0);
if(nv == 0)
{
@@ -1441,7 +1446,7 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
if(voice_spec)
{
// select the voices which match the voice_spec, and sort them by preference
SetVoiceScores(voice_spec,voices);
SetVoiceScores(voice_spec,voices,1);
return((const espeak_VOICE **)voices);
}