mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
[1.42.03 release]
Allow .txt release for *_rules and *_list files. Rules lookup, consider multi-byte characters when calculating matchign points. Fix bug in Roman Number translation. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@232 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+20
-8
@@ -690,9 +690,14 @@ static int compile_dictlist_file(const char *path, const char* filename)
|
||||
|
||||
text_mode = 0;
|
||||
|
||||
sprintf(fname,"%s%s",path,filename);
|
||||
// try with and without '.txt' extension
|
||||
sprintf(fname,"%s%s.txt",path,filename);
|
||||
if((f_in = fopen(fname,"r")) == NULL)
|
||||
return(-1);
|
||||
{
|
||||
sprintf(fname,"%s%s",path,filename);
|
||||
if((f_in = fopen(fname,"r")) == NULL)
|
||||
return(-1);
|
||||
}
|
||||
|
||||
fprintf(f_log,"Compiling: '%s'\n",fname);
|
||||
|
||||
@@ -860,6 +865,9 @@ static void copy_rule_string(char *string, int &state)
|
||||
case 'X':
|
||||
c = RULE_NOVOWELS;
|
||||
break;
|
||||
case 'J':
|
||||
c = RULE_SKIPCHARS;
|
||||
break;
|
||||
case 'L':
|
||||
// expect two digits
|
||||
c = *p++ - '0';
|
||||
@@ -1659,14 +1667,18 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha
|
||||
if(f_log == NULL)
|
||||
f_log = stderr;
|
||||
|
||||
// try with and without '.txt' extension
|
||||
sprintf(path,"%s%s_",dsource,dict_name);
|
||||
sprintf(fname_in,"%srules",path);
|
||||
f_in = fopen_log(fname_in,"r");
|
||||
if(f_in == NULL)
|
||||
sprintf(fname_in,"%srules.txt",path);
|
||||
if((f_in = fopen(fname_in,"r")) == NULL)
|
||||
{
|
||||
if(fname_err)
|
||||
strcpy(fname_err,fname_in);
|
||||
return(-1);
|
||||
sprintf(fname_in,"%srules",path);
|
||||
if((f_in = fopen_log(fname_in,"r")) == NULL)
|
||||
{
|
||||
if(fname_err)
|
||||
strcpy(fname_err,fname_in);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(fname_out,"%s%c%s_dict",path_home,PATHSEP,dict_name);
|
||||
|
||||
Reference in New Issue
Block a user