mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 14:04:27 +00:00
[1.47.03f]
Fix, speak letter names of Hangul (Korean) characters. Fix, ChangePhoneme(NULL) caused problems for word-gap options. Recognize Arabic comma U+060C. Languages changes: pt, nl, bn, te, da. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@336 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+29
-2
@@ -699,11 +699,38 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
else
|
||||
language = L('e','n');
|
||||
|
||||
if(language != tr->translator_name)
|
||||
if((language != tr->translator_name) || (language == L('k','o')))
|
||||
{
|
||||
char *p3;
|
||||
int initial, code;
|
||||
char hangul_buf[12];
|
||||
|
||||
// speak in the language for this alphabet (or English)
|
||||
ph_buf[2] = SetTranslator2(WordToString2(language));
|
||||
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
|
||||
|
||||
if(((code = letter - 0xac00) >= 0) && (letter <= 0xd7af))
|
||||
{
|
||||
// Special case for Korean letters.
|
||||
// break a syllable hangul into 2 or 3 individual jamo
|
||||
|
||||
hangul_buf[0] = ' ';
|
||||
p3 = &hangul_buf[1];
|
||||
if((initial = (code/28)/21) != 11)
|
||||
{
|
||||
p3 += utf8_out(initial + 0x1100, p3);
|
||||
}
|
||||
utf8_out(((code/28) % 21) + 0x1161, p3); // medial
|
||||
utf8_out((code % 28) + 0x11a7, &p3[3]); // final
|
||||
p3[6] = ' ';
|
||||
p3[7] = 0;
|
||||
ph_buf[3] = 0;
|
||||
TranslateRules(translator2, &hangul_buf[1], &ph_buf[3], sizeof(ph_buf)-3, NULL, 0, NULL);
|
||||
SetWordStress(translator2, &ph_buf[3], NULL, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
|
||||
}
|
||||
|
||||
if(ph_buf[3] == phonSWITCH)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user