Browse Source

code cleanup: remove unnecessary code related to LOPT_CAPS_IN_WORD

translate.h gives two settings to LOPT_CAPS_IN_WORD, but only one of them is actually ever used.
master
Juho Hiltunen 4 years ago
parent
commit
aafa55cbbc
3 changed files with 4 additions and 5 deletions
  1. 1
    1
      src/libespeak-ng/tr_languages.c
  2. 2
    2
      src/libespeak-ng/translate.c
  3. 1
    2
      src/libespeak-ng/translate.h

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

@@ -1063,7 +1063,7 @@ Translator *SelectTranslator(const char *name)
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.vowel_pause = 0x20c; // pause before a word which starts with a vowel, or after a word which ends in a consonant
tr->punct_within_word = jbo_punct_within_word;
tr->langopts.param[LOPT_CAPS_IN_WORD] = 2; // capitals indicate stressed syllables
tr->langopts.param[LOPT_CAPS_IN_WORD] = 1; // capitals indicate stressed syllables
SetLetterVowel(tr, 'y');
tr->langopts.max_lengthmod = 368;
}

+ 2
- 2
src/libespeak-ng/translate.c View File

@@ -2323,8 +2323,8 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change)
if (iswupper(c)) {
c = towlower2(c, tr);

if ((j = tr->langopts.param[LOPT_CAPS_IN_WORD]) > 0) {
if ((j == 2) && (syllable_marked == false)) {
if (tr->langopts.param[LOPT_CAPS_IN_WORD]) {
if (syllable_marked == false) {
char_inserted = c;
c = 0x2c8; // stress marker
syllable_marked = true;

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

@@ -331,8 +331,7 @@ typedef struct {
// change [t] when followed by unstressed vowel
#define LOPT_REDUCE_T 12

// 1 = allow capitals inside a word
// 2 = stressed syllable is indicated by capitals
// 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

Loading…
Cancel
Save