[1.29.06] Adjust some vowels in en-sc, en-r, en-rp, en-wm

Windows: Fix problem with mbrola voices stopping in Jaws screenreader.
--compile. Don't read and report faults in previous *-dict file.
Added phoneme translation for German mbrola "de6" voice.
Fix to phoneme translation for German voices.
lang=zhy.  Assume word boundary between an ideagraph and an English word.
lang=pt.  Update pt_rules


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@85 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-09-16 16:18:36 +00:00
parent a6a5246a54
commit 41fb54859d
39 changed files with 233 additions and 160 deletions
+19 -16
View File
@@ -501,7 +501,7 @@ int compile_dictlist_file(const char *path, const char* filename)
char *p;
int count=0;
FILE *f_in;
char buf[256];
char buf[sizeof(path_home)+45];
char dict_line[128];
sprintf(buf,"%s%s",path,filename);
@@ -1300,15 +1300,16 @@ static int compile_dictrules(FILE *f_in, FILE *f_out, char *fname_temp)
int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *fname)
{//======================================================================================
int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *fname_err)
{//==========================================================================================
// fname: space to write the filename in case of error
FILE *f_in;
FILE *f_out;
int offset_rules=0;
int value;
char fname_buf[sizeof(path_home)+15];
char fname_in[sizeof(path_home)+45];
char fname_out[sizeof(path_home)+15];
char fname_temp[sizeof(path_home)+15];
char path[sizeof(path_home)+40]; // path_dsource+20
@@ -1316,8 +1317,6 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha
if(dsource == NULL)
dsource = "";
if(fname == NULL)
fname = fname_buf;
f_log = log;
//f_log = fopen("log2.txt","w");
@@ -1325,10 +1324,20 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha
f_log = stderr;
sprintf(path,"%s%s_",dsource,dict_name);
sprintf(fname,"%s%c%s_dict",path_home,PATHSEP,dict_name);
if((f_out = fopen_log(fname,"wb+")) == NULL)
sprintf(fname_in,"%srules",path);
f_in = fopen_log(fname_in,"r");
if(f_in == NULL)
{
if(fname_err)
strcpy(fname_err,fname_in);
return(-1);
}
sprintf(fname_out,"%s%c%s_dict",path_home,PATHSEP,dict_name);
if((f_out = fopen_log(fname_out,"wb+")) == NULL)
{
if(fname_err)
strcpy(fname_err,fname_in);
return(-1);
}
sprintf(fname_temp,"%s%ctemp",path_home,PATHSEP);
@@ -1359,13 +1368,7 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha
compile_dictlist_end(f_out);
offset_rules = ftell(f_out);
sprintf(fname,"%srules",path);
fprintf(f_log,"Compiling: '%s'\n",fname);
f_in = fopen_log(fname,"r");
if(f_in == NULL)
{
return(-1);
}
fprintf(f_log,"Compiling: '%s'\n",fname_in);
compile_dictrules(f_in,f_out,fname_temp);
fclose(f_in);
+3
View File
@@ -131,6 +131,9 @@ int Translator::LoadDictionary(const char *name, int no_error)
strcpy(dictionary_name,name); // currently loaded dictionary name
if(no_error) // don't load dictionary, just set the dictionary_name
return(1);
// Load a pronunciation data file into memory
// bytes 0-3: offset to rules data
// bytes 4-7: number of hash table entries
+12 -9
View File
@@ -548,18 +548,11 @@ int main (int argc, char **argv)
initialise();
if(voicename[0] == 0)
strcpy(voicename,"default");
if(SetVoiceByName(voicename) != EE_OK)
{
fprintf(stderr,"%svoice '%s'\n",err_load,voicename);
exit(2);
}
if(flag_compile)
{
LoadVoice(voicename,5);
#ifdef PLATFORM_DOS
char path_dsource[sizeof(path_home)+20];
strcpy(path_dsource,path_home);
@@ -580,6 +573,16 @@ int main (int argc, char **argv)
exit(0);
}
if(voicename[0] == 0)
strcpy(voicename,"default");
if(SetVoiceByName(voicename) != EE_OK)
{
fprintf(stderr,"%svoice '%s'\n",err_load,voicename);
exit(2);
}
SetParameter(espeakRATE,speed,0);
SetParameter(espeakVOLUME,amp,0);
SetParameter(espeakCAPITALS,option_capitals,0);
+6 -2
View File
@@ -487,7 +487,7 @@ int MbrolaSynth(char *p_mbrola)
void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
{//======================================================================
// Generate a mbrola pho file
int name;
unsigned int name;
int phix;
int len;
int len1;
@@ -534,6 +534,9 @@ void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
{
MbrolaEmbedded(embedded_ix, p->sourceix);
}
if(p->newword & 4)
MbrolaMarker(espeakEVENT_SENTENCE, (p->sourceix & 0x7ff) + clause_start_char, 0, count_sentences);
if(p->newword & 1)
MbrolaMarker(espeakEVENT_WORD, (p->sourceix & 0x7ff) + clause_start_char, p->sourceix >> 11, clause_start_word + word_count++);
#endif
@@ -545,8 +548,9 @@ void MbrolaTranslate(PHONEME_LIST *plist, int n_phonemes, FILE *f_mbrola)
if(name == 0)
continue; // ignore this phoneme
if(ph->type == phPAUSE)
if((ph->type == phPAUSE) && (name == ph->mnemonic))
{
// a pause phoneme, which has not been changed by the translation
name = '_';
len = (p->length * speed_factor1)/256;
// if(len == 0) continue;
+6 -6
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.29.04 11.Sep.07";
const char *version_string = "1.29.06 11.Sep.07";
const int version_phdata = 0x012901;
int option_device_number = -1;
@@ -223,16 +223,16 @@ static unsigned int LookupSound2(int index, unsigned int other_phcode, int contr
}
break;
case 1:
if(control==0)
if(control==0)
{
seq_len_adjust = value2 >> 8;
seq_len_adjust = value2 >> 8;
}
break;
case 2:
if(control==0)
if(control==0)
{
seq_len_adjust = value2 >> 8;
seq_len_adjust = -seq_len_adjust;
seq_len_adjust = value2 >> 8;
seq_len_adjust = -seq_len_adjust;
}
break;
case 3:
+1 -1
View File
@@ -1909,7 +1909,7 @@ if((c == '/') && (langopts.testing & 2) && isdigit(next_in) && IsAlpha(prev_out)
else
if(IsAlpha(c))
{
if(!IsAlpha(prev_out) || (langopts.ideographs && (c >= 0x3000)))
if(!IsAlpha(prev_out) || (langopts.ideographs && ((c >= 0x3000) || (prev_out >= 0x3000))))
{
if(prev_out != '\'')
letter_count = 0; // don't reset count for an apostrophy within a word
-1
View File
@@ -498,7 +498,6 @@ voice_t *LoadVoice(const char *vname, int control)
static char voice_name[40]; // voice name for voice_selected
static char voice_languages[100]; // list of languages and priorities for voice_selected
strcpy(voicename,vname);
if(voicename[0]==0)
strcpy(voicename,"default");