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

@@ -657,7 +657,7 @@ void SetSpellingStress(Translator *tr, char *phonemes, int control, int n_chars)
if ((c == phonSTRESS_P) && (n_chars > 1) && (prev != phonSWITCH)) {
count++;

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

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

@@ -302,6 +302,7 @@ static Translator *NewTranslator(void)
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_ANNOUNCED] = 2; // pauses when announcing bracket names
tr->langopts.spelling_stress = false;
tr->langopts.max_initial_consonants = 3;
tr->langopts.replace_chars = NULL;
tr->langopts.alt_alphabet_lang = L('e', 'n');
@@ -803,7 +804,7 @@ Translator *SelectTranslator(const char *name)

tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
SetLetterVowel(tr, 'y');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
}
break;
case L('f', 'r'): // french
@@ -900,7 +901,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.stress_flags = S_FINAL_NO_2;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
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;
@@ -936,7 +937,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.max_roman = 899;
tr->langopts.min_roman = 1;
SetLetterVowel(tr, 'y');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
SetLengthMods(tr, 3); // all equal
}
break;
@@ -1180,7 +1181,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr, stress_lengths_lv, stress_amps_lv);

tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->encoding = ESPEAKNG_ENCODING_ISO_8859_4;
tr->langopts.max_digits = 33;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
@@ -1322,7 +1323,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
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.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;
@@ -1346,7 +1347,7 @@ Translator *SelectTranslator(const char *name)

tr->langopts.stress_rule = STRESSPOSN_1L;
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;
memset(tr->letter_bits, 0, sizeof(tr->letter_bits));
@@ -1391,7 +1392,7 @@ Translator *SelectTranslator(const char *name)

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');
tr->langopts.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.intonation_group = 3; // less intonation, don't raise pitch at comma
}
break;
@@ -1450,7 +1451,7 @@ Translator *SelectTranslator(const char *name)

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.spelling_stress = 1;
tr->langopts.spelling_stress = true;
tr->langopts.break_numbers = BREAK_LAKH_DV;

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

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

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

Loading…
Cancel
Save