[1.45.12]

lang=de: Fix important pronunciation error, "sage".
Change handling of unrecognized phoneme names.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@260 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2011-04-02 00:01:20 +00:00
parent 82b01c0336
commit 750367758e
12 changed files with 74 additions and 53 deletions
+1 -1
View File
@@ -1114,7 +1114,7 @@ static unsigned int StringToWord(const char *string)
static MNEM_TAB reserved_phonemes[] = {
{"<", phonCONTROL}, // NOT USED
{"_\001", phonCONTROL}, // NOT USED
{"%", phonSTRESS_U},
{"%%", phonSTRESS_D},
{",", phonSTRESS_2},
+7 -18
View File
@@ -643,17 +643,11 @@ step=1; // TEST
}
// check for errors in the phonemes codes
for(ix=0; ix<sizeof(encoded_ph); ix++)
if(bad_phoneme[0] != 0)
{
c = encoded_ph[ix];
if(c == 0) break;
if(c == 255)
{
/* unrecognised phoneme, report error */
fprintf(f_log,"%5d: Bad phoneme [%c] (0x%x) in: %s %s\n",linenum,bad_phoneme[0],bad_phoneme[0],word,phonetic);
error_count++;
}
// unrecognised phoneme, report error
fprintf(f_log,"%5d: Bad phoneme [%c] (0x%x) in: %s %s\n",linenum,bad_phoneme[0],bad_phoneme[0],word,phonetic);
error_count++;
}
}
@@ -1249,15 +1243,10 @@ static char *compile_rule(char *input)
}
EncodePhonemes(rule_phonemes,buf,bad_phoneme);
for(ix=0;; ix++)
if(bad_phoneme[0] != 0)
{
if((c = buf[ix])==0) break;
if(c==255)
{
fprintf(f_log,"%5d: Bad phoneme [%c] in %s\n",linenum,bad_phoneme[0],input);
error_count++;
break;
}
fprintf(f_log,"%5d: Bad phoneme [%c] in %s\n",linenum,bad_phoneme[0],input);
error_count++;
}
strcpy(output,buf);
len = strlen(buf)+1;
+4 -2
View File
@@ -352,7 +352,7 @@ char *EncodePhonemes(char *p, char *outptr, unsigned char *bad_phoneme)
/* Translate a phoneme string from ascii mnemonics to internal phoneme numbers,
from 'p' up to next blank .
Returns advanced 'p'
outptr contains encoded phonemes, unrecognised phonemes are encoded as 255
outptr contains encoded phonemes, unrecognized phoneme stops the encoding
bad_phoneme must point to char array of length 2 of more
*/
{
@@ -423,9 +423,11 @@ char *EncodePhonemes(char *p, char *outptr, unsigned char *bad_phoneme)
if(max_ph == 0)
{
max_ph = 255; /* not recognised */
// not recognised, report and ignore
bad_phoneme[0] = *p;
bad_phoneme[1] = 0;
*outptr++ = 0;
return(p+1);
}
if(max <= 0)
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.45.11 31.Mar.11";
const char *version_string = "1.45.12 01.Apr.11";
const int version_phdata = 0x014500;
int option_device_number = -1;
+7
View File
@@ -1258,6 +1258,13 @@ strcpy(phonemes2,phonemes);
wordx[-1] = c_temp;
found = LookupDictList(tr, &word1, phonemes, dictionary_flags2, end_flags, wtab); // include prefix, but not suffix
wordx[-1] = ' ';
if(phonemes[0] == phonSWITCH)
{
// change to another language in order to translate this word
memcpy(wordx,word_copy,strlen(word_copy));
strcpy(word_phonemes,phonemes);
return(0);
}
if(dictionary_flags[0]==0)
{
dictionary_flags[0] = dictionary_flags2[0];