mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
[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:
+46
-17
@@ -590,12 +590,13 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
int n_bytes;
|
||||
int letter;
|
||||
int len;
|
||||
int ix;
|
||||
int save_option_phonemes;
|
||||
char *p2;
|
||||
char *pbuf;
|
||||
char capital[20];
|
||||
char ph_buf[60];
|
||||
char ph_buf2[60];
|
||||
char ph_buf[80];
|
||||
char ph_buf2[80];
|
||||
char hexbuf[6];
|
||||
|
||||
ph_buf[0] = 0;
|
||||
@@ -646,22 +647,49 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
if(ph_buf[0] == 0)
|
||||
{
|
||||
// character name not found
|
||||
if(iswalpha(letter))
|
||||
Lookup(tr, "_?A", ph_buf);
|
||||
|
||||
if((ph_buf[0]==0) && !iswspace(letter))
|
||||
Lookup(tr, "_??", ph_buf);
|
||||
|
||||
if(ph_buf[0] != 0)
|
||||
if((letter >= 0x2800) && (letter <= 0x28ff))
|
||||
{
|
||||
// speak the hexadecimal number of the character code
|
||||
sprintf(hexbuf,"%x",letter);
|
||||
pbuf = ph_buf;
|
||||
for(p2 = hexbuf; *p2 != 0; p2++)
|
||||
// braille dots symbol
|
||||
Lookup(tr, "_braille", ph_buf);
|
||||
if(ph_buf[0] == 0)
|
||||
{
|
||||
pbuf += strlen(pbuf);
|
||||
*pbuf++ = phonPAUSE_VSHORT;
|
||||
LookupLetter(tr, *p2, 0, pbuf, 1);
|
||||
EncodePhonemes("br'e:l", ph_buf, NULL);
|
||||
}
|
||||
|
||||
if(ph_buf[0] != 0)
|
||||
{
|
||||
pbuf = ph_buf + strlen(ph_buf);
|
||||
for(ix=0; ix<8; ix++)
|
||||
{
|
||||
if(letter & (1 << ix))
|
||||
{
|
||||
*pbuf++ = phonPAUSE_VSHORT;
|
||||
LookupLetter(tr, '1'+ix, 0, pbuf, 1);
|
||||
pbuf += strlen(pbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ph_buf[0]== 0)
|
||||
{
|
||||
if(iswalpha(letter))
|
||||
Lookup(tr, "_?A", ph_buf);
|
||||
|
||||
if((ph_buf[0]==0) && !iswspace(letter))
|
||||
Lookup(tr, "_??", ph_buf);
|
||||
|
||||
if(ph_buf[0] != 0)
|
||||
{
|
||||
// speak the hexadecimal number of the character code
|
||||
sprintf(hexbuf,"%x",letter);
|
||||
pbuf = ph_buf;
|
||||
for(p2 = hexbuf; *p2 != 0; p2++)
|
||||
{
|
||||
pbuf += strlen(pbuf);
|
||||
*pbuf++ = phonPAUSE_VSHORT;
|
||||
LookupLetter(tr, *p2, 0, pbuf, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1951,8 +1979,9 @@ int TranslateNumber(Translator *tr, char *word1, char *ph_out, unsigned int *fla
|
||||
return(0); // speak digits individually
|
||||
|
||||
if(tr->langopts.numbers != 0)
|
||||
{
|
||||
return(TranslateNumber_1(tr, word1, ph_out, flags, wtab, control));
|
||||
|
||||
}
|
||||
return(0);
|
||||
} // end of TranslateNumber
|
||||
|
||||
|
||||
Reference in New Issue
Block a user