[1.46.19]

Speak names of characters U+2800 to U+28FF, Braille dot symbols.
Language option to speak numbers which use characters '0' to '9' with the English voice.
Add some more characters to the vowel and consonant lists for Indian languages.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@284 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2012-06-27 18:02:26 +00:00
parent 176a0c267c
commit 084584ee16
13 changed files with 118 additions and 42 deletions
+16 -4
View File
@@ -407,6 +407,9 @@ int IsAlpha(unsigned int c)
if((c >= 0x1100) && (c <= 0x11ff))
return(1); //Korean jamo
if((c >= 0x2800) && (c <= 0x28ff))
return(1); // braille
if((c > 0x3040) && (c <= 0xa700))
return(1); // Chinese/Japanese. Should never get here, but Mac OS 10.4's iswalpha seems to be broken, so just make sure
@@ -981,6 +984,13 @@ if((wmark > 0) && (wmark < 8))
if(word_phonemes[0] == phonSWITCH)
return(0);
if((tr->langopts.numbers2 & NUM2_ENGLISH_NUMERALS) && !(wtab->flags & FLAG_CHAR_REPLACED))
{
// for this language, speak English numerals (0-9) with the English voice
sprintf(word_phonemes,"%c",phonSWITCH);
return(0);
}
found = TranslateNumber(tr, word1, phonemes, dictionary_flags, wtab, 0);
}
@@ -2223,7 +2233,7 @@ static int EmbeddedCommand(unsigned int &source_index)
static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in, int *insert)
static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in, int *insert, int *wordflags)
{//=========================================================================================
int ix;
unsigned int word;
@@ -2285,12 +2295,14 @@ static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in,
if(upper_case)
new_c = towupper(new_c);
*wordflags |= FLAG_CHAR_REPLACED;
return(new_c);
}
static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c, unsigned int next_in, int *insert)
static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c, unsigned int next_in, int *insert, int *wordflags)
{//================================================================================================================
// To allow language specific examination and replacement of characters
@@ -2368,7 +2380,7 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
}
break;
}
return(SubstituteChar(tr,c,next_in,insert));
return(SubstituteChar(tr, c, next_in, insert, wordflags));
}
@@ -2680,7 +2692,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre
word_flags |= FLAG_COMMA_AFTER;
}
c = TranslateChar(tr, &source[source_index], prev_in,c, next_in, &char_inserted); // optional language specific function
c = TranslateChar(tr, &source[source_index], prev_in,c, next_in, &char_inserted, &word_flags); // optional language specific function
if(c == 8)
continue; // ignore this character