mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
Changes to languages: en, en-r.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@102 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+51
-51
@@ -84,8 +84,8 @@ static const unsigned int replace_cyrillic_latin[] =
|
||||
0}; // ѓ ѕ ќ
|
||||
|
||||
|
||||
void SetupTranslator(Translator *tr, int *lengths, int *amps)
|
||||
{//==========================================================
|
||||
void SetupTranslator(Translator *tr, const short *lengths, const unsigned char *amps)
|
||||
{//==================================================================================
|
||||
if(lengths != NULL)
|
||||
memcpy(tr->stress_lengths,lengths,sizeof(tr->stress_lengths));
|
||||
if(amps != NULL)
|
||||
@@ -111,8 +111,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('c','y'): // Welsh
|
||||
{
|
||||
static int stress_lengths_cy[8] = {170,230, 190,190, 0, 0, 250,270};
|
||||
static int stress_amps_cy[8] = {16,15, 18,18, 0,0, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const short stress_lengths_cy[8] = {170,230, 190,190, 0, 0, 250,270};
|
||||
static const unsigned char stress_amps_cy[8] = {16,15, 18,18, 0,0, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_cy,stress_amps_cy);
|
||||
@@ -138,7 +138,7 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('d','e'):
|
||||
{
|
||||
static const int stress_lengths_de[8] = {150,130, 190,190, 0, 0, 260,275};
|
||||
static const short stress_lengths_de[8] = {150,130, 190,190, 0, 0, 260,275};
|
||||
tr = new Translator();
|
||||
tr->langopts.stress_rule = 0;
|
||||
tr->langopts.word_gap = 0x2; // don't use linking phonemes
|
||||
@@ -158,8 +158,8 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('e','l'): // Greek
|
||||
case L_grc: // Ancient Greek
|
||||
{
|
||||
static int stress_lengths_el[8] = {155, 180, 210, 210, 0, 0, 270, 300};
|
||||
static int stress_amps_el[8] = {15,12, 20,20, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const short stress_lengths_el[8] = {155, 180, 210, 210, 0, 0, 270, 300};
|
||||
static const unsigned char stress_amps_el[8] = {15,12, 20,20, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
// character codes offset by 0x380
|
||||
static const char el_vowels[] = {0x10,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x35,0x37,0x39,0x3f,0x45,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0};
|
||||
@@ -203,8 +203,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('e','o'):
|
||||
{
|
||||
static int stress_lengths_eo[8] = {145, 180, 200, 190, 0, 0, 300, 320};
|
||||
static int stress_amps_eo[] = {16,14, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_eo[8] = {145, 180, 200, 190, 0, 0, 300, 320};
|
||||
static const unsigned char stress_amps_eo[] = {16,14, 20,20, 20,24, 24,22 };
|
||||
static const wchar_t eo_char_apostrophe[2] = {'l',0};
|
||||
|
||||
tr = new Translator();
|
||||
@@ -226,8 +226,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('e','s'): // Spanish
|
||||
{
|
||||
static int stress_lengths_es[8] = {170, 200, 180, 180, 0, 0, 220, 250};
|
||||
static int stress_amps_es[8] = {16,12, 18,18, 20,22, 22,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const short stress_lengths_es[8] = {170, 200, 180, 180, 0, 0, 220, 250};
|
||||
static const unsigned char stress_amps_es[8] = {16,12, 18,18, 20,22, 22,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_es,stress_amps_es);
|
||||
@@ -251,8 +251,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('f','i'): // Finnish
|
||||
{
|
||||
static int stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 };
|
||||
static int stress_lengths_fi[8] = {150,170, 200,200, 0,0, 210,250};
|
||||
static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 };
|
||||
static const short stress_lengths_fi[8] = {150,170, 200,200, 0,0, 210,250};
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_fi,stress_amps_fi);
|
||||
@@ -273,8 +273,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('f','r'): // french
|
||||
{
|
||||
static int stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 235, 235};
|
||||
static int stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 235, 235};
|
||||
static const unsigned char stress_amps_fr[8] = {16,14, 20,20, 20,24, 24,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
|
||||
@@ -290,8 +290,8 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('h','i'):
|
||||
{
|
||||
static const char dev_consonants2[] = {0x02,0x03,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f};
|
||||
static int stress_lengths_hi[8] = {190, 190, 210, 210, 0, 0, 230, 250};
|
||||
static int stress_amps_hi[8] = {17,14, 20,19, 20,24, 24,22 };
|
||||
static const short stress_lengths_hi[8] = {190, 190, 210, 210, 0, 0, 230, 250};
|
||||
static const unsigned char stress_amps_hi[8] = {17,14, 20,19, 20,24, 24,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_hi,stress_amps_hi);
|
||||
@@ -318,8 +318,8 @@ Translator *SelectTranslator(const char *name)
|
||||
case L('b','s'): // Bosnian
|
||||
case L('s','r'): // Serbian
|
||||
{
|
||||
static int stress_amps_hr[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_hr[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
static const unsigned char stress_amps_hr[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_hr[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_hr,stress_amps_hr);
|
||||
@@ -343,8 +343,8 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('h','u'): // Hungarian
|
||||
{
|
||||
static int stress_amps_hu[8] = {17,17, 19,19, 20,24, 24,22 };
|
||||
static int stress_lengths_hu[8] = {185,195, 195,190, 0,0, 210,220};
|
||||
static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,24, 24,22 };
|
||||
static const short stress_lengths_hu[8] = {185,195, 195,190, 0,0, 210,220};
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_hu,stress_amps_hu);
|
||||
@@ -367,8 +367,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('i','s'): // Icelandic
|
||||
{
|
||||
static int stress_amps_is[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_is[8] = {180,160, 200,200, 0,0, 240,250};
|
||||
static const unsigned char stress_amps_is[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_is[8] = {180,160, 200,200, 0,0, 240,250};
|
||||
static const wchar_t is_lettergroup_B[] = {'c','f','h','k','p','t','x',0xfe,0}; // voiceless conants, including 'þ' ?? 's'
|
||||
|
||||
tr = new Translator();
|
||||
@@ -390,8 +390,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('i','t'): // Italian
|
||||
{
|
||||
static int stress_lengths_it[8] = {150, 140, 180, 180, 0, 0, 270, 320};
|
||||
static int stress_amps_it[8] = {15,14, 19,19, 20,24, 24,22 };
|
||||
static const short stress_lengths_it[8] = {150, 140, 180, 180, 0, 0, 270, 320};
|
||||
static const unsigned char stress_amps_it[8] = {15,14, 19,19, 20,24, 24,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_it,stress_amps_it);
|
||||
@@ -428,8 +428,8 @@ SetLengthMods(tr,3); // all equal
|
||||
{
|
||||
static wchar_t vowels_cyrillic[] = {0x440, // also include 'р' [R]
|
||||
0x430,0x435,0x438,0x439,0x43e,0x443,0x44b,0x44d,0x44e,0x44f,0x450,0x451,0x456,0x457,0x45d,0x45e,0};
|
||||
static int stress_amps_mk[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_mk[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
static const unsigned char stress_amps_mk[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_mk[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_mk,stress_amps_mk);
|
||||
@@ -445,7 +445,7 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('n','l'): // Dutch
|
||||
{
|
||||
static const int stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};
|
||||
static const short stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};
|
||||
tr = new Translator();
|
||||
|
||||
tr->langopts.stress_rule = 0;
|
||||
@@ -462,8 +462,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('n','o'): // Norwegian
|
||||
{
|
||||
static int stress_amps_no[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_no[8] = {160,140, 200,190, 0,0, 220,240};
|
||||
static const unsigned char stress_amps_no[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_no[8] = {160,140, 200,190, 0,0, 220,240};
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_no,stress_amps_no);
|
||||
|
||||
@@ -475,8 +475,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('p','l'): // Polish
|
||||
{
|
||||
static int stress_lengths_pl[8] = {160, 180, 175, 175, 0, 0, 260, 290};
|
||||
static int stress_amps_pl[8] = {17,14, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const short stress_lengths_pl[8] = {160, 180, 175, 175, 0, 0, 260, 290};
|
||||
static const unsigned char stress_amps_pl[8] = {17,14, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);
|
||||
@@ -495,8 +495,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('p','t'): // Portuguese
|
||||
{
|
||||
static int stress_lengths_pt[8] = {180, 125, 210, 210, 0, 0, 270, 295};
|
||||
static int stress_amps_pt[8] = {16,13, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
static const short stress_lengths_pt[8] = {180, 125, 210, 210, 0, 0, 270, 295};
|
||||
static const unsigned char stress_amps_pt[8] = {16,13, 19,19, 20,24, 24,22 }; // 'diminished' is used to mark a quieter, final unstressed syllable
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_pt,stress_amps_pt);
|
||||
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
|
||||
@@ -512,8 +512,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('r','o'): // Romanian
|
||||
{
|
||||
static int stress_lengths_ro[8] = {170, 170, 180, 180, 0, 0, 240, 260};
|
||||
static int stress_amps_ro[8] = {15,13, 18,18, 20,22, 22,22 };
|
||||
static const short stress_lengths_ro[8] = {170, 170, 180, 180, 0, 0, 240, 260};
|
||||
static const unsigned char stress_amps_ro[8] = {15,13, 18,18, 20,22, 22,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_ro,stress_amps_ro);
|
||||
@@ -534,8 +534,8 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('s','k'): // Slovak
|
||||
case L('c','s'): // Czech
|
||||
{
|
||||
static int stress_amps_sk[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_sk[8] = {190,190, 210,210, 0,0, 210,210};
|
||||
static const unsigned char stress_amps_sk[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_sk[8] = {190,190, 210,210, 0,0, 210,210};
|
||||
static const char *sk_voiced = "bdgjlmnrvwzaeiouy";
|
||||
|
||||
tr = new Translator();
|
||||
@@ -568,8 +568,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('s','v'): // Swedish
|
||||
{
|
||||
static int stress_amps_sv[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
|
||||
static const unsigned char stress_amps_sv[] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_sv,stress_amps_sv);
|
||||
|
||||
@@ -582,8 +582,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('s','w'): // Swahili
|
||||
{
|
||||
static int stress_lengths_sw[8] = {160, 170, 200, 200, 0, 0, 320, 340};
|
||||
static int stress_amps_sw[] = {16,12, 19,19, 20,24, 24,22 };
|
||||
static const short stress_lengths_sw[8] = {160, 170, 200, 200, 0, 0, 320, 340};
|
||||
static const unsigned char stress_amps_sw[] = {16,12, 19,19, 20,24, 24,22 };
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_sw,stress_amps_sw);
|
||||
@@ -600,8 +600,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('t','r'): // Turkish
|
||||
{
|
||||
static int stress_amps_tr[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static int stress_lengths_tr[8] = {180,150, 200,180, 0,0, 230,270};
|
||||
static const unsigned char stress_amps_tr[8] = {16,16, 20,20, 20,24, 24,22 };
|
||||
static const short stress_lengths_tr[8] = {180,150, 200,180, 0,0, 230,270};
|
||||
|
||||
tr = new Translator();
|
||||
SetupTranslator(tr,stress_lengths_tr,stress_amps_tr);
|
||||
@@ -616,8 +616,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('v','i'): // Vietnamese
|
||||
{
|
||||
static int stress_lengths_vi[8] = {150, 150, 180, 180, 210, 220, 220, 280};
|
||||
static int stress_amps_vi[] = {16,16, 16,16, 24,24, 24,22 };
|
||||
static const short stress_lengths_vi[8] = {150, 150, 180, 180, 210, 220, 220, 280};
|
||||
static const unsigned char stress_amps_vi[] = {16,16, 16,16, 24,24, 24,22 };
|
||||
static wchar_t vowels_vi[] = {
|
||||
0x61, 0xe0, 0xe1, 0x1ea3, 0xe3, 0x1ea1, // a
|
||||
0x103, 0x1eb1, 0x1eaf, 0x1eb3, 0x1eb5, 0x1eb7, // ă
|
||||
@@ -650,8 +650,8 @@ SetLengthMods(tr,3); // all equal
|
||||
case L('z','h'):
|
||||
case L_zhy:
|
||||
{
|
||||
static int stress_lengths_zh[8] = {220,150, 230,230, 230,0, 230,250};
|
||||
static int stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 };
|
||||
static const short stress_lengths_zh[8] = {220,150, 230,230, 230,0, 230,250};
|
||||
static const unsigned char stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 };
|
||||
|
||||
tr = new Translator;
|
||||
SetupTranslator(tr,stress_lengths_zh,stress_amps_zh);
|
||||
@@ -699,8 +699,8 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
Translator_Russian::Translator_Russian() : Translator()
|
||||
{//===================================
|
||||
static int stress_amps_ru[] = {16,16, 18,18, 20,24, 24,22 };
|
||||
static int stress_lengths_ru[8] = {150,140, 220,220, 0,0, 260,280};
|
||||
static const unsigned char stress_amps_ru[] = {16,16, 18,18, 20,24, 24,22 };
|
||||
static const short stress_lengths_ru[8] = {150,140, 220,220, 0,0, 260,280};
|
||||
|
||||
|
||||
// character codes offset by 0x420
|
||||
@@ -953,7 +953,7 @@ Translator_Afrikaans::Translator_Afrikaans() : Translator()
|
||||
{//=========================================
|
||||
// Initialise options for this language
|
||||
|
||||
static const int stress_lengths2[8] = {170,140, 220,220, 0, 0, 250,270};
|
||||
static const short stress_lengths2[8] = {170,140, 220,220, 0, 0, 250,270};
|
||||
langopts.stress_rule = 0;
|
||||
langopts.word_gap = 0;
|
||||
langopts.vowel_pause = 0x30;
|
||||
|
||||
Reference in New Issue
Block a user