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

tr->langopts.stress_rule = STRESSPOSN_2R; 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->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->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'); SetLetterVowel(tr, 'y');
tr->langopts.max_lengthmod = 368; tr->langopts.max_lengthmod = 368;
} }

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

if (iswupper(c)) { if (iswupper(c)) {
c = towlower2(c, tr); 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; char_inserted = c;
c = 0x2c8; // stress marker c = 0x2c8; // stress marker
syllable_marked = true; syllable_marked = true;

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

// change [t] when followed by unstressed vowel // change [t] when followed by unstressed vowel
#define LOPT_REDUCE_T 12 #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 #define LOPT_CAPS_IN_WORD 13


// bit 0=Italian "syntactic doubling" of consoants in the word after a word marked with $double attribute // bit 0=Italian "syntactic doubling" of consoants in the word after a word marked with $double attribute

Loading…
Cancel
Save