Browse Source

Avoid clashes between gender selection code and thousand variant flags

Fixes #1420 also Set max_digits to 32 for russian since it's safe to do now.
master
A11CF0 2 years ago
parent
commit
c5de4ff6c2
No account linked to committer's email address
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      src/libespeak-ng/numbers.c
  2. 1
    1
      src/libespeak-ng/tr_languages.c

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

@@ -1316,7 +1316,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul

if (LookupThousands(tr, hundreds / 10, tplex, exact | ordinal, ph_10T) == 0) {
x = 0;
if (tr->langopts.numbers2 & (1 << tplex))
if (tr->langopts.numbers2 & (1 << tplex) && tplex <= 3)
x = 8; // use variant (feminine) for before thousands and millions
if (tr->translator_name == L('m', 'l'))
x = 0x208;
@@ -1419,7 +1419,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul
x |= 4; // tens and units only, no higher digits
if (ordinal & 0x20)
x |= 0x20; // variant form of ordinal number
} else if (tr->langopts.numbers2 & (1 << thousandplex))
} else if (tr->langopts.numbers2 & (1 << thousandplex) && thousandplex <= 3)
x = 8; // use variant (feminine) for before thousands and millions

if ((tr->translator_name == L('m', 'l')) && (thousandplex == 1))

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

@@ -1656,5 +1656,5 @@ static void Translator_Russian(Translator *tr)

tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED;
tr->langopts.numbers2 = NUM2_THOUSANDPLEX_VAR_THOUSANDS | NUM2_THOUSANDS_VAR1; // variant numbers before thousands
tr->langopts.max_digits = 18;
tr->langopts.max_digits = 32;
}

Loading…
Cancel
Save