mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
[1.47.03c]
Phoneme definition files: added prev2PhW() and next3PhW(). Added language: ms (Malay). git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@332 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+18
-18
@@ -604,7 +604,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
char ph_buf[80];
|
||||
char ph_buf2[80];
|
||||
char ph_alphabet[80];
|
||||
char hexbuf[6];
|
||||
char hexbuf[12];
|
||||
static char pause_string[] = {phonPAUSE, 0};
|
||||
|
||||
ph_buf[0] = 0;
|
||||
@@ -981,7 +981,7 @@ int TranslateRoman(Translator *tr, char *word, char *ph_out, WORD_TAB *wtab)
|
||||
flags[0] = 0;
|
||||
flags[1] = 0;
|
||||
|
||||
if(((tr->langopts.numbers & NUM_ROMAN_CAPITALS) && !(wtab[0].flags & FLAG_ALL_UPPER)) || isdigit(word[-2]))
|
||||
if(((tr->langopts.numbers & NUM_ROMAN_CAPITALS) && !(wtab[0].flags & FLAG_ALL_UPPER)) || IsDigit09(word[-2]))
|
||||
return(0); // not '2xx'
|
||||
|
||||
word_start = word;
|
||||
@@ -1020,7 +1020,7 @@ int TranslateRoman(Translator *tr, char *word, char *ph_out, WORD_TAB *wtab)
|
||||
n_digits++;
|
||||
}
|
||||
|
||||
if(isdigit(word[0]))
|
||||
if(IsDigit09(word[0]))
|
||||
return(0); // eg. 'xx2'
|
||||
|
||||
acc += prev;
|
||||
@@ -1756,12 +1756,12 @@ bool CheckThousandsGroup(char *word, int group_len)
|
||||
// Is this a group of 3 digits which looks like a thousands group?
|
||||
int ix;
|
||||
|
||||
if(isdigit(word[group_len]) || isdigit(-1))
|
||||
if(IsDigit09(word[group_len]) || IsDigit09(-1))
|
||||
return(false);
|
||||
|
||||
for(ix=0; ix < group_len; ix++)
|
||||
{
|
||||
if(!isdigit(word[ix]))
|
||||
if(!IsDigit09(word[ix]))
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
@@ -1812,7 +1812,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
digit_lookup = buf_digit_lookup;
|
||||
number_control = control;
|
||||
|
||||
for(ix=0; isdigit(word[ix]); ix++) ;
|
||||
for(ix=0; IsDigit09(word[ix]); ix++) ;
|
||||
n_digits = ix;
|
||||
value = this_value = atoi(word);
|
||||
|
||||
@@ -1821,14 +1821,14 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
group_len = 4;
|
||||
|
||||
// is there a previous thousands part (as a previous "word") ?
|
||||
if((n_digits == group_len) && (word[-2] == tr->langopts.thousands_sep) && isdigit(word[-3]))
|
||||
if((n_digits == group_len) && (word[-2] == tr->langopts.thousands_sep) && IsDigit09(word[-3]))
|
||||
{
|
||||
prev_thousands = 1;
|
||||
}
|
||||
else if((tr->langopts.thousands_sep == ' ') || (tr->langopts.numbers & NUM_ALLOW_SPACE))
|
||||
{
|
||||
// thousands groups can be separated by spaces
|
||||
if((n_digits == 3) && !(wtab->flags & FLAG_MULTIPLE_SPACES) && isdigit(word[-2]))
|
||||
if((n_digits == 3) && !(wtab->flags & FLAG_MULTIPLE_SPACES) && IsDigit09(word[-2]))
|
||||
{
|
||||
prev_thousands = 1;
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
if((word[ix] == '.') && !isdigit(word[ix+1]) && !isdigit(word[ix+2]) && !(wtab[1].flags & FLAG_NOSPACE))
|
||||
if((word[ix] == '.') && !IsDigit09(word[ix+1]) && !IsDigit09(word[ix+2]) && !(wtab[1].flags & FLAG_NOSPACE))
|
||||
{
|
||||
// remove dot unless followed by another number
|
||||
word[ix] = 0;
|
||||
@@ -1879,7 +1879,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
{
|
||||
ordinal = 2;
|
||||
}
|
||||
else if(!isdigit(suffix[0])) // not _#9 (tab)
|
||||
else if(!IsDigit09(suffix[0])) // not _#9 (tab)
|
||||
{
|
||||
sprintf(string,"_#%s",suffix);
|
||||
if(Lookup(tr, string, ph_ordinal2))
|
||||
@@ -1904,7 +1904,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
|
||||
if((word[0] == '0') && (prev_thousands == 0) && (word[1] != ' ') && (word[1] != tr->langopts.decimal_sep))
|
||||
{
|
||||
if((n_digits == 2) && (word[3] == ':') && isdigit(word[5]) && isspace(word[7]))
|
||||
if((n_digits == 2) && (word[3] == ':') && IsDigit09(word[5]) && isspace(word[7]))
|
||||
{
|
||||
// looks like a time 02:30, omit the leading zero
|
||||
}
|
||||
@@ -1973,7 +1973,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
if((word[n_digits] == tr->langopts.decimal_sep) && isdigit(word[n_digits+1]))
|
||||
if((word[n_digits] == tr->langopts.decimal_sep) && IsDigit09(word[n_digits+1]))
|
||||
{
|
||||
// this "word" ends with a decimal point
|
||||
Lookup(tr, "_dpt", ph_append);
|
||||
@@ -2018,8 +2018,8 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
char *p2;
|
||||
// look for combinations of the number with the next word
|
||||
p = word;
|
||||
while(isdigit(p[1])) p++; // just use the last digit
|
||||
if(isdigit(p[-1]))
|
||||
while(IsDigit09(p[1])) p++; // just use the last digit
|
||||
if(IsDigit09(p[-1]))
|
||||
{
|
||||
p2 = p - 1;
|
||||
if(LookupDictList(tr, &p2, buf_digit_lookup, flags, FLAG_SUFX, wtab)) // lookup 2 digits
|
||||
@@ -2082,7 +2082,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
n_digits++;
|
||||
|
||||
decimal_count = 0;
|
||||
while(isdigit(word[n_digits+decimal_count]))
|
||||
while(IsDigit09(word[n_digits+decimal_count]))
|
||||
decimal_count++;
|
||||
|
||||
// if(decimal_count > 1)
|
||||
@@ -2101,7 +2101,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
decimal_count--;
|
||||
n_digits++;
|
||||
}
|
||||
if((decimal_count <= max_decimal_count) && isdigit(word[n_digits]))
|
||||
if((decimal_count <= max_decimal_count) && IsDigit09(word[n_digits]))
|
||||
{
|
||||
LookupNum3(tr, atoi(&word[n_digits]), buf1, 0,0,0);
|
||||
strcat(ph_out,buf1);
|
||||
@@ -2152,7 +2152,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
}
|
||||
}
|
||||
|
||||
while(isdigit(c = word[n_digits]) && (strlen(ph_out) < (N_WORD_PHONEMES - 10)))
|
||||
while(IsDigit09(c = word[n_digits]) && (strlen(ph_out) < (N_WORD_PHONEMES - 10)))
|
||||
{
|
||||
// speak any remaining decimal fraction digits individually
|
||||
value = word[n_digits++] - '0';
|
||||
@@ -2165,7 +2165,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
if(Lookup(tr, "_dpt2", buf1))
|
||||
strcat(ph_out,buf1);
|
||||
|
||||
if((c == tr->langopts.decimal_sep) && isdigit(word[n_digits+1]))
|
||||
if((c == tr->langopts.decimal_sep) && IsDigit09(word[n_digits+1]))
|
||||
{
|
||||
Lookup(tr, "_dpt", buf1);
|
||||
strcat(ph_out,buf1);
|
||||
|
||||
Reference in New Issue
Block a user