From 1e04ce0fbfecf8f2c6759ed146ab2c2cd1f0d55d Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 11 Apr 2020 14:03:26 +0100 Subject: [PATCH] Use the NUM2_SWAP_THOUSANDS constant instead of 0x200. --- src/libespeak-ng/numbers.c | 10 +++++----- src/libespeak-ng/tr_languages.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c index a23298f9..1e277a2b 100644 --- a/src/libespeak-ng/numbers.c +++ b/src/libespeak-ng/numbers.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2005 to 2015 by Jonathan Duddington * email: jonsd@users.sourceforge.net - * Copyright (C) 2015-2016 Reece H. Dunn + * Copyright (C) 2015-2016, 2020 Reece H. Dunn * * 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 @@ -1590,8 +1590,8 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, bool suppress_nul LookupNum2(tr, hundreds/10, thousandplex, x, ph_digits); } - if (tr->langopts.numbers2 & 0x200) - sprintf(ph_thousands, "%s%c%s%c", ph_10T, phonEND_WORD, ph_digits, phonEND_WORD); // say "thousands" before its number, not after + if (tr->langopts.numbers2 & NUM2_SWAP_THOUSANDS) + sprintf(ph_thousands, "%s%c%s%c", ph_10T, phonEND_WORD, ph_digits, phonEND_WORD); else sprintf(ph_thousands, "%s%c%s%c", ph_digits, phonEND_WORD, ph_10T, phonEND_WORD); @@ -1963,8 +1963,8 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned } LookupNum3(tr, value, ph_buf, suppress_null, thousandplex, prev_thousands | ordinal | decimal_point); - if ((thousandplex > 0) && (tr->langopts.numbers2 & 0x200)) - sprintf(ph_out, "%s%s%c%s%s", ph_zeros, ph_append, phonEND_WORD, ph_buf2, ph_buf); // say "thousands" before its number + if ((thousandplex > 0) && (tr->langopts.numbers2 & NUM2_SWAP_THOUSANDS)) + sprintf(ph_out, "%s%s%c%s%s", ph_zeros, ph_append, phonEND_WORD, ph_buf2, ph_buf); else sprintf(ph_out, "%s%s%s%c%s", ph_zeros, ph_buf2, ph_buf, phonEND_WORD, ph_append); diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 85ed8bd7..477ca728 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2005 to 2015 by Jonathan Duddington * email: jonsd@users.sourceforge.net - * Copyright (C) 2015-2016 Reece H. Dunn + * Copyright (C) 2015-2016, 2020 Reece H. Dunn * * 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 @@ -1238,7 +1238,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.stress_rule = STRESSPOSN_2R; tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | 0x80000; tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_HUNDRED_AND; - tr->langopts.numbers2 = 0x200; // say "thousands" before its number + tr->langopts.numbers2 = NUM2_SWAP_THOUSANDS; } break; case L('p', 'l'): // Polish @@ -1304,7 +1304,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words. Need to allow "bw'" prefix tr->langopts.numbers = NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_DFRACTION_2 | NUM_AND_HUNDRED; - tr->langopts.numbers2 = 0x200; // say "thousands" before its number + tr->langopts.numbers2 = NUM2_SWAP_THOUSANDS; } break; case L('s', 'k'): // Slovak