mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
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.
This commit is contained in:
@@ -799,7 +799,6 @@ Translator *SelectTranslator(const char *name)
|
||||
// fallthrough:
|
||||
case L('f', 'i'): // Finnish
|
||||
{
|
||||
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
|
||||
tr->langopts.long_stop = 130;
|
||||
|
||||
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
|
||||
@@ -929,7 +928,6 @@ Translator *SelectTranslator(const char *name)
|
||||
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.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.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;
|
||||
@@ -1032,7 +1030,6 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.unstressed_wd1 = 0;
|
||||
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_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_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
|
||||
@@ -1390,7 +1387,6 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
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.param[LOPT_IT_DOUBLING] = 1;
|
||||
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;
|
||||
|
||||
@@ -668,7 +668,6 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
srcix = source_ix+1;
|
||||
} else if (ph_code == phonX1) {
|
||||
// a language specific action
|
||||
if (tr->langopts.param[LOPT_IT_DOUBLING])
|
||||
flags |= FLAG_DOUBLING;
|
||||
} else {
|
||||
ph_list2[n_ph_list2].phcode = ph_code;
|
||||
@@ -700,13 +699,9 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
|
||||
next_tone = 0;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,10 +326,6 @@ typedef struct {
|
||||
// 1 = stressed syllable is indicated by capitals
|
||||
#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
|
||||
// bit 1: stressed syllable: $alt change [e],[o] to [E],[O], $alt2 change [E],[O] to [e],[o]
|
||||
#define LOPT_ALT 15
|
||||
|
||||
Reference in New Issue
Block a user