Browse Source

Fix for issue #338: Chinese Cantonese dictionary (zhy_dict) problem

master
Valdis Vitolins 7 years ago
parent
commit
60e9e3ebcb
2 changed files with 13 additions and 5 deletions
  1. 2
    0
      espeak-ng-data/lang/sit/cmn
  2. 11
    5
      src/libespeak-ng/tr_languages.c

+ 2
- 0
espeak-ng-data/lang/sit/cmn View File

language cmn language cmn
language zh-cmn language zh-cmn
language zh language zh

translator zh
phonemes zh phonemes zh
dictionary zh dictionary zh
words 1 words 1

+ 11
- 5
src/libespeak-ng/tr_languages.c View File

#define L_jbo 0x6a626f // jbo Lojban #define L_jbo 0x6a626f // jbo Lojban
#define L_mni 0x627079 // bpy Manipuri #define L_mni 0x627079 // bpy Manipuri
#define L_pap 0x706170 // pap Papiamento] #define L_pap 0x706170 // pap Papiamento]
#define L_zhy 0x7a6879 // zhy
#define L_zhy 0x7a6879 // zhy Chinese (Cantonese)
#define L_cmn 0x636D6E // cmn Chinese (Mandarin)


// start of unicode pages for character sets // start of unicode pages for character sets
#define OFFSET_GREEK 0x380 #define OFFSET_GREEK 0x380
tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_SINGLE_STRESS; tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_SINGLE_STRESS;
break; break;
case L('z', 'h'):
case L_zhy:

case L_cmn: // no break, just go to 'zh' case

case L_zhy: // just go to 'zh' case


case L('z','h'):
{ {
static const short stress_lengths_zh[8] = { 230, 150, 230, 230, 230, 0, 240, 250 }; // 1=tone5. end-of-sentence, 6=tone 1&4, 7=tone 2&3 static const short stress_lengths_zh[8] = { 230, 150, 230, 230, 230, 0, 240, 250 }; // 1=tone5. end-of-sentence, 6=tone 1&4, 7=tone 2&3
static const unsigned char stress_amps_zh[] = { 22, 16, 22, 22, 22, 22, 22, 22 }; static const unsigned char stress_amps_zh[] = { 22, 16, 22, 22, 22, 22, 22, 22 };
tr->langopts.ideographs = 1; tr->langopts.ideographs = 1;
tr->langopts.our_alphabet = 0x3100; tr->langopts.our_alphabet = 0x3100;
tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
if (name2 == L('z', 'h')) {
if (name2 == L_zhy) {
tr->langopts.textmode = 1; tr->langopts.textmode = 1;
tr->langopts.listx = 1; // compile zh_listx after zh_list tr->langopts.listx = 1; // compile zh_listx after zh_list
tr->langopts.numbers = 1; tr->langopts.numbers = 1;
tr->langopts.numbers2 = NUM2_ZERO_TENS; tr->langopts.numbers2 = NUM2_ZERO_TENS;
tr->langopts.break_numbers = 0x00018; tr->langopts.break_numbers = 0x00018;
} }
}
break; break;
}
default: default:
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
break; break;

Loading…
Cancel
Save