[1.47.12]

Change program code for espeak/libespeak to C, remove C++ features.

Language changes: af, ga, grc, hu, nl, sw, ta


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@364 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2013-09-23 14:20:26 +00:00
parent 507caaaca2
commit 10bd23b3b4
45 changed files with 1847 additions and 577 deletions
+38 -35
View File
@@ -847,47 +847,50 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control)
// speak in the language for this alphabet (or English)
ph_buf[2] = SetTranslator2(WordToString2(language));
if(((code = letter - 0xac00) >= 0) && (letter <= 0xd7af))
if(translator2 != NULL)
{
// 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)
if(((code = letter - 0xac00) >= 0) && (letter <= 0xd7af))
{
p3 += utf8_out(initial + 0x1100, p3);
// 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);
}
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)
{
// another level of language change
ph_buf[2] = SetTranslator2(&ph_buf[4]);
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
}
if(ph_buf[3] == phonSWITCH)
{
// another level of language change
ph_buf[2] = SetTranslator2(&ph_buf[4]);
LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1);
}
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table
if(ph_buf[3] != 0)
{
ph_buf[0] = phonPAUSE;
ph_buf[1] = phonSWITCH;
len = strlen(&ph_buf[3]) + 3;
ph_buf[len] = phonSWITCH; // switch back
ph_buf[len+1] = tr->phoneme_tab_ix;
ph_buf[len+2] = 0;
if(ph_buf[3] != 0)
{
ph_buf[0] = phonPAUSE;
ph_buf[1] = phonSWITCH;
len = strlen(&ph_buf[3]) + 3;
ph_buf[len] = phonSWITCH; // switch back
ph_buf[len+1] = tr->phoneme_tab_ix;
ph_buf[len+2] = 0;
}
}
}
}