diff --git a/docs/numbers.md b/docs/numbers.md index 348fd475..c9fc5991 100644 --- a/docs/numbers.md +++ b/docs/numbers.md @@ -12,8 +12,10 @@ language: These controls how numbers are pronounced. -If `numbers` is set to `0` (the default value), numbers will not be pronounced. -Setting it to `1` will enable number pronunciation using the dictionary rules. +If `numbers` is set to `0`, numbers will not be pronounced. +Setting it to `1` (the default value) will enable number pronunciation using the dictionary rules. +For more control over number pronunciation, see the flags in `translate.h`. + tr->langopts.max_digits diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 7ed230b1..170572e3 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -2,6 +2,7 @@ * Copyright (C) 2005 to 2015 by Jonathan Duddington * email: jonsd@users.sourceforge.net * Copyright (C) 2015-2016, 2020 Reece H. Dunn + * Copyright (C) 2021 Juho Hiltunen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -305,6 +306,7 @@ static Translator *NewTranslator(void) tr->langopts.min_roman = 2; tr->langopts.thousands_sep = ','; tr->langopts.decimal_sep = '.'; + tr->langopts.numbers = NUM_DEFAULT; tr->langopts.break_numbers = BREAK_THOUSANDS; tr->langopts.max_digits = 14; @@ -477,6 +479,18 @@ Translator *SelectTranslator(const char *name) switch (name2) { + case L('m', 'i'): + case L('m', 'y'): + case L4('p', 'i', 'q', 'd'): // piqd + case L('p', 'y'): + case L('q', 'u'): + case L3('q', 'u', 'c'): + case L('t', 'h'): + case L('u', 'z'): + { + tr->langopts.numbers = 0; // disable numbers until the definition are complete in _list file + } + break; case L('a', 'f'): { static const short stress_lengths_af[8] = { 170, 140, 220, 220, 0, 0, 250, 270 }; @@ -1065,6 +1079,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.param[LOPT_CAPS_IN_WORD] = 1; // capitals indicate stressed syllables SetLetterVowel(tr, 'y'); tr->langopts.max_lengthmod = 368; + tr->langopts.numbers = 0; // disable numbers until the definition are complete in _list file } break; case L('k', 'a'): // Georgian