Browse Source

Remove LOPT_IT_DOUBLING and delete unused functionality.

Code checked for both langopt LOPT_IT_DOUBLING and attribe $double.
LOPT_IT_DOUBLING is redundant. $double already has a test in
dictionary.test

Code had a check for tr->langopts.param[LOPT_IT_DOUBLING] & 2 but that bit value is
not used in any language. That logic was removed.
master
Juho Hiltunen 2 years ago
parent
commit
4d70ceceb5
3 changed files with 3 additions and 16 deletions
  1. 0
    4
      src/libespeak-ng/tr_languages.c
  2. 3
    8
      src/libespeak-ng/translate.c
  3. 0
    4
      src/libespeak-ng/translate.h

+ 0
- 4
src/libespeak-ng/tr_languages.c View File

// fallthrough: // fallthrough:
case L('f', 'i'): // Finnish case L('f', 'i'): // Finnish
{ {
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.long_stop = 130; tr->langopts.long_stop = 130;


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;
tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2 | 0x8000 | S_HYPEN_UNSTRESS; tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2 | 0x8000 | S_HYPEN_UNSTRESS;
tr->langopts.unstressed_wd1 = 2; tr->langopts.unstressed_wd1 = 2;
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.param[LOPT_ANNOUNCE_PUNCT] = 2; // don't break clause before announcing . ? ! tr->langopts.param[LOPT_ANNOUNCE_PUNCT] = 2; // don't break clause before announcing . ? !


tr->langopts.numbers = NUM_DFRACTION_5 | NUM_ALLOW_SPACE | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS | NUM_ORDINAL_DOT | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND; tr->langopts.numbers = NUM_DFRACTION_5 | NUM_ALLOW_SPACE | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS | NUM_ORDINAL_DOT | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND;
tr->langopts.unstressed_wd1 = 0; tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2; tr->langopts.unstressed_wd2 = 2;
tr->langopts.param[LOPT_IT_LENGTHEN] = 2; // remove lengthen indicator from unstressed or non-penultimate syllables tr->langopts.param[LOPT_IT_LENGTHEN] = 2; // remove lengthen indicator from unstressed or non-penultimate syllables
tr->langopts.param[LOPT_IT_DOUBLING] = 1; // double the first consonant if the previous word ends in a stressed vowel (changed to =1, 23.01.2014 - only use if prev.word has $double)
tr->langopts.param[LOPT_SONORANT_MIN] = 130; // limit the shortening of sonorants before short vowels tr->langopts.param[LOPT_SONORANT_MIN] = 130; // limit the shortening of sonorants before short vowels
tr->langopts.param[LOPT_REDUCE] = 1; // reduce vowels even if phonemes are specified in it_list tr->langopts.param[LOPT_REDUCE] = 1; // reduce vowels even if phonemes are specified in it_list
tr->langopts.param[LOPT_ALT] = 2; // call ApplySpecialAttributes2() if a word has $alt or $alt2 tr->langopts.param[LOPT_ALT] = 2; // call ApplySpecialAttributes2() if a word has $alt or $alt2


tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_2_TO_HEAVY; // move secondary stress from light to a following heavy syllable tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_2_TO_HEAVY; // move secondary stress from light to a following heavy syllable
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.long_stop = 130; tr->langopts.long_stop = 130;


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;

+ 3
- 8
src/libespeak-ng/translate.c View File

srcix = source_ix+1; srcix = source_ix+1;
} else if (ph_code == phonX1) { } else if (ph_code == phonX1) {
// a language specific action // a language specific action
if (tr->langopts.param[LOPT_IT_DOUBLING])
flags |= FLAG_DOUBLING; flags |= FLAG_DOUBLING;
} else { } else {
ph_list2[n_ph_list2].phcode = ph_code; ph_list2[n_ph_list2].phcode = ph_code;
next_tone = 0; next_tone = 0;
} }
} else { } else {
if (first_phoneme && tr->langopts.param[LOPT_IT_DOUBLING]) {
if (((tr->prev_dict_flags[0] & FLAG_DOUBLING) && (tr->langopts.param[LOPT_IT_DOUBLING] & 1)) ||
(tr->end_stressed_vowel && (tr->langopts.param[LOPT_IT_DOUBLING] & 2))) {
// italian, double the initial consonant if the previous word ends with a
// stressed vowel, or is marked with a flag
ph_list2[n_ph_list2].synthflags |= SFLAG_LENGTHEN;
}
if (first_phoneme && tr->prev_dict_flags[0] & FLAG_DOUBLING) {
// double the initial consonant if the previous word is marked with a flag
ph_list2[n_ph_list2].synthflags |= SFLAG_LENGTHEN;
} }
} }



+ 0
- 4
src/libespeak-ng/translate.h View File

// 1 = stressed syllable is indicated by capitals // 1 = stressed syllable is indicated by capitals
#define LOPT_CAPS_IN_WORD 13 #define LOPT_CAPS_IN_WORD 13


// bit 0=Italian "syntactic doubling" of consoants in the word after a word marked with $double attribute
// bit 1=also after a word which ends with a stressed vowel
#define LOPT_IT_DOUBLING 14

// Call ApplySpecialAttributes() if $alt or $alt2 is set for a word // Call ApplySpecialAttributes() if $alt or $alt2 is set for a word
// bit 1: stressed syllable: $alt change [e],[o] to [E],[O], $alt2 change [E],[O] to [e],[o] // bit 1: stressed syllable: $alt change [e],[o] to [E],[O], $alt2 change [E],[O] to [e],[o]
#define LOPT_ALT 15 #define LOPT_ALT 15

Loading…
Cancel
Save