Proposal to fix #4831 (CZ TTS problem with PREC1 and units) (#4856)

* Proposal to fix #4831

* Next fix for #4831

* Initiate some CZ docs

* Some more structure, still a workframe

* My attempt to help with #4831

* Update tts_doc_cz.md

* copy/paste error

* Update tts_doc_cz.md

* missed one number/qr.quot

* Cosmetics

* Consistency in parameters order

* Nearly complete doc

* Cosmetics to facilitate coding for non CZ devs

* Fix integer+unit, cosmetics

* Update tts_doc Radians and Mililiters are Male gender

* Radian and Millimeter are Male (so i've been told)

* Cosmetics

* Invers pushUnitPrompt parameters as per bsongis request
This commit is contained in:
Bertrand Songis
2017-04-26 21:42:01 +02:00
committed by GitHub
parent c15922a942
commit f10bad7abe
9 changed files with 206 additions and 139 deletions
+14 -14
View File
@@ -58,16 +58,16 @@ enum SlovakPrompts {
#if defined(VOICE)
#if defined(CPUARM)
#define SK_PUSH_UNIT_PROMPT(p, u) sk_pushUnitPrompt((p), (u), id)
#define SK_PUSH_UNIT_PROMPT(u, p) sk_pushUnitPrompt((u), (p), id)
#else
#define SK_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
#define SK_PUSH_UNIT_PROMPT(u, p) pushUnitPrompt((u), (p))
#endif
#define MUZSKY 0x80
#define ZENSKY 0x81
#define STREDNI 0x82
I18N_PLAY_FUNCTION(sk, pushUnitPrompt, int16_t number, uint8_t unitprompt)
I18N_PLAY_FUNCTION(sk, pushUnitPrompt, uint8_t unitprompt, int16_t number)
{
#if defined(CPUARM)
if (number == 1)
@@ -120,13 +120,13 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
#else
// we assume that we are PREC1
#endif
div_t qr = div((int)number, 10);
div_t qr = div((int)number, 10);
if (qr.rem) {
PLAY_NUMBER(qr.quot, 0, ZENSKY);
if (qr.quot == 0)
PUSH_NUMBER_PROMPT(SK_PROMPT_CELA);
else
SK_PUSH_UNIT_PROMPT(qr.quot, SK_PROMPT_CELA);
SK_PUSH_UNIT_PROMPT(SK_PROMPT_CELA, qr.quot);
PLAY_NUMBER(qr.rem, 0, ZENSKY);
PUSH_NUMBER_PROMPT(SK_PROMPT_UNITS_BASE+((unit-1)*4)+3);
return;
@@ -137,8 +137,8 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
}
int16_t tmp = number;
#if defined(CPUARM)
#if defined(CPUARM)
switch(unit) {
case 0:
break;
@@ -189,20 +189,20 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDEN);
number = -1;
}
if ((number == 1) && (att == STREDNI)) {
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDNO);
number = -1;
}
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
PUSH_NUMBER_PROMPT(SK_PROMPT_DVE);
number = -1;
}
if (number >= 1000) {
if (number >= 1000) {
if (number >= 3000)
PLAY_NUMBER(number / 1000, 0, 0);
PLAY_NUMBER(number / 1000, 0, 0);
if (number >= 2000 && number < 3000)
PUSH_NUMBER_PROMPT(SK_PROMPT_DVETISIC);
else
@@ -218,13 +218,13 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
if (number == 0)
number = -1;
}
if (number >= 0) {
PUSH_NUMBER_PROMPT(SK_PROMPT_NULA+number);
}
if (unit) {
SK_PUSH_UNIT_PROMPT(tmp, unit);
SK_PUSH_UNIT_PROMPT(unit, tmp);
}
}