mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 22:07:12 +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:
+31
-31
@@ -1732,6 +1732,7 @@ int SetTranslator2(const char *new_language)
|
||||
translator2->phoneme_tab_ix = new_phoneme_tab;
|
||||
}
|
||||
}
|
||||
translator2->phonemes_repeat[0] = 0;
|
||||
return(new_phoneme_tab);
|
||||
} // end of SetTranslator2
|
||||
|
||||
@@ -2440,6 +2441,35 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
|
||||
0x72,0x73,0x74,0x75
|
||||
};
|
||||
|
||||
// check for Korean Hangul letters
|
||||
if(((code = c - 0xac00) >= 0) && (c <= 0xd7af))
|
||||
{
|
||||
// break a syllable hangul into 2 or 3 individual jamo
|
||||
initial = (code/28)/21;
|
||||
medial = (code/28) % 21;
|
||||
final = code % 28;
|
||||
|
||||
if(initial == 11)
|
||||
{
|
||||
// null initial
|
||||
c = medial + 0x1161;
|
||||
if(final > 0)
|
||||
*insert = final + 0x11a7;
|
||||
}
|
||||
else
|
||||
{
|
||||
// extact the initial and insert the remainder with a null initial
|
||||
c = initial + 0x1100;
|
||||
*insert = (11*28*21) + (medial*28) + final + 0xac00;
|
||||
}
|
||||
return(c);
|
||||
}
|
||||
else if(((code = c - 0x3130) >= 0) && (code < 0x34))
|
||||
{
|
||||
// Hangul compatibility jamo
|
||||
return(hangul_compatibility[code] + 0x1100);
|
||||
}
|
||||
|
||||
switch(tr->translator_name)
|
||||
{
|
||||
case L('a','f'):
|
||||
@@ -2467,36 +2497,6 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c,
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case L('k','o'):
|
||||
if(((code = c - 0xac00) >= 0) && (c <= 0xd7af))
|
||||
{
|
||||
// break a syllable hangul into 2 or 3 individual jamo
|
||||
initial = (code/28)/21;
|
||||
medial = (code/28) % 21;
|
||||
final = code % 28;
|
||||
|
||||
if(initial == 11)
|
||||
{
|
||||
// null initial
|
||||
c = medial + 0x1161;
|
||||
if(final > 0)
|
||||
*insert = final + 0x11a7;
|
||||
}
|
||||
else
|
||||
{
|
||||
// extact the initial and insert the remainder with a null initial
|
||||
c = initial + 0x1100;
|
||||
*insert = (11*28*21) + (medial*28) + final + 0xac00;
|
||||
}
|
||||
return(c);
|
||||
}
|
||||
else if(((code = c - 0x3130) >= 0) && (code < 0x34))
|
||||
{
|
||||
// Hangul compatibility jamo
|
||||
return(hangul_compatibility[code] + 0x1100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(SubstituteChar(tr, c, next_in, insert, wordflags));
|
||||
}
|
||||
@@ -2951,7 +2951,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre
|
||||
}
|
||||
else
|
||||
{
|
||||
if(iswlower(prev_in))
|
||||
if((iswlower(prev_in)) && (prev_in != 0xba)) // Windows thinks masc.ordinal (0xba) is lower-case
|
||||
{
|
||||
// lower case followed by upper case in a word
|
||||
if(UpperCaseInWord(tr, &sbuf[ix], c) == 1)
|
||||
|
||||
Reference in New Issue
Block a user