Browse Source

cleanup: make spelling_stress bool and set default value

master
Juho Hiltunen 2 years ago
parent
commit
f342b5d319
3 changed files with 11 additions and 10 deletions
  1. 1
    1
      src/libespeak-ng/numbers.c
  2. 9
    8
      src/libespeak-ng/tr_languages.c
  3. 1
    1
      src/libespeak-ng/translate.h

+ 1
- 1
src/libespeak-ng/numbers.c View File

if ((c == phonSTRESS_P) && (n_chars > 1) && (prev != phonSWITCH)) { if ((c == phonSTRESS_P) && (n_chars > 1) && (prev != phonSWITCH)) {
count++; count++;


if (tr->langopts.spelling_stress == 1) {
if (tr->langopts.spelling_stress) {
// stress on initial letter when spelling // stress on initial letter when spelling
if (count > 1) if (count > 1)
c = phonSTRESS_3; c = phonSTRESS_3;

+ 9
- 8
src/libespeak-ng/tr_languages.c View File

tr->langopts.param[LOPT_UNPRONOUNCABLE] = 's'; // don't count this character at start of word tr->langopts.param[LOPT_UNPRONOUNCABLE] = 's'; // don't count this character at start of word
tr->langopts.param[LOPT_BRACKET_PAUSE] = 4; // pause at bracket tr->langopts.param[LOPT_BRACKET_PAUSE] = 4; // pause at bracket
tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED] = 2; // pauses when announcing bracket names tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED] = 2; // pauses when announcing bracket names
tr->langopts.spelling_stress = false;
tr->langopts.max_initial_consonants = 3; tr->langopts.max_initial_consonants = 3;
tr->langopts.replace_chars = NULL; tr->langopts.replace_chars = NULL;
tr->langopts.alt_alphabet_lang = L('e', 'n'); tr->langopts.alt_alphabet_lang = L('e', 'n');


tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2 | NUM_ORDINAL_DOT; tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
SetLetterVowel(tr, 'y'); SetLetterVowel(tr, 'y');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
} }
break; break;
case L('f', 'r'): // french case L('f', 'r'): // french
tr->langopts.stress_flags = S_FINAL_NO_2; tr->langopts.stress_flags = S_FINAL_NO_2;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3; tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5; tr->langopts.max_initial_consonants = 5;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.accents = 1; tr->langopts.accents = 1;


tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_DECIMAL_COMMA | NUM_THOUS_SPACE | NUM_DFRACTION_2 | NUM_ROMAN_CAPITALS; tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_DECIMAL_COMMA | NUM_THOUS_SPACE | NUM_DFRACTION_2 | NUM_ROMAN_CAPITALS;
tr->langopts.max_roman = 899; tr->langopts.max_roman = 899;
tr->langopts.min_roman = 1; tr->langopts.min_roman = 1;
SetLetterVowel(tr, 'y'); SetLetterVowel(tr, 'y');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
SetLengthMods(tr, 3); // all equal SetLengthMods(tr, 3); // all equal
} }
break; break;
SetupTranslator(tr, stress_lengths_lv, stress_amps_lv); SetupTranslator(tr, stress_lengths_lv, stress_amps_lv);


tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->encoding = ESPEAKNG_ENCODING_ISO_8859_4; tr->encoding = ESPEAKNG_ENCODING_ISO_8859_4;
tr->langopts.max_digits = 33; tr->langopts.max_digits = 33;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT; tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3; tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5; tr->langopts.max_initial_consonants = 5;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.param[LOPT_COMBINE_WORDS] = 4; // combine some prepositions with the following word tr->langopts.param[LOPT_COMBINE_WORDS] = 4; // combine some prepositions with the following word


tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN; tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;


tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;


tr->letter_bits_offset = OFFSET_SINHALA; tr->letter_bits_offset = OFFSET_SINHALA;
memset(tr->letter_bits, 0, sizeof(tr->letter_bits)); memset(tr->letter_bits, 0, sizeof(tr->letter_bits));


tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ORDINAL_DOT; tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
SetLetterVowel(tr, 'y'); SetLetterVowel(tr, 'y');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.intonation_group = 3; // less intonation, don't raise pitch at comma tr->langopts.intonation_group = 3; // less intonation, don't raise pitch at comma
} }
break; break;


tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; // use 'diminished' for unstressed final syllable tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; // use 'diminished' for unstressed final syllable
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.break_numbers = BREAK_LAKH_DV; tr->langopts.break_numbers = BREAK_LAKH_DV;


if (name2 == L('t', 'a')) { if (name2 == L('t', 'a')) {

+ 1
- 1
src/libespeak-ng/translate.h View File

unsigned char tunes[6]; unsigned char tunes[6];
int long_stop; // extra mS pause for a lengthened stop int long_stop; // extra mS pause for a lengthened stop
char max_initial_consonants; char max_initial_consonants;
char spelling_stress; // 0=default, 1=stress first letter
bool spelling_stress;
char tone_numbers; char tone_numbers;
char ideographs; // treat as separate words char ideographs; // treat as separate words
bool textmode; // the meaning of FLAG_TEXTMODE is reversed (to save data when *_list file is compiled) bool textmode; // the meaning of FLAG_TEXTMODE is reversed (to save data when *_list file is compiled)

Loading…
Cancel
Save