mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-01 21:58:52 +00:00
Merge branch 'master' into android
Conflicts: platforms/windows/make_espeakedit.iss
This commit is contained in:
+30
-3
@@ -655,7 +655,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
|
||||
current_alphabet = alphabet;
|
||||
if((alphabet != NULL) && !(al_flags & AL_DONT_NAME) && (al_offset != translator->letter_bits_offset))
|
||||
{
|
||||
if((al_flags & AL_DONT_NAME) || (al_offset == translator->langopts.alt_alphabet))
|
||||
if((al_flags & AL_DONT_NAME) || (al_offset == translator->langopts.alt_alphabet) || (al_offset == translator->langopts.our_alphabet))
|
||||
{
|
||||
// don't say the alphabet name
|
||||
}
|
||||
@@ -703,11 +703,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