Numbers, add option to say "thousands" and "millions" before their number (LANG=rw)

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@172 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-03-25 22:52:30 +00:00
parent 42b19ae2c8
commit 00130d6dda
14 changed files with 143 additions and 68 deletions
+9 -2
View File
@@ -978,7 +978,11 @@ int Translator::LookupNum3(int value, char *ph_out, int suppress_null, int thous
LookupNum2(hundreds/10, x, ph_digits);
}
sprintf(ph_thousands,"%s%s%c",ph_digits,ph_10T,phonPAUSE_NOLINK);
if(langopts.numbers2 & 0x200)
sprintf(ph_thousands,"%s%s%c",ph_10T,ph_digits,phonPAUSE_NOLINK); // say "thousands" before its number, not after
else
sprintf(ph_thousands,"%s%s%c",ph_digits,ph_10T,phonPAUSE_NOLINK);
hundreds %= 10;
if(hundreds == 0)
ph_100[0] = 0;
@@ -1271,7 +1275,10 @@ int Translator::TranslateNumber_1(char *word, char *ph_out, unsigned int *flags,
}
LookupNum3(value, ph_buf, suppress_null, thousandplex, prev_thousands);
sprintf(ph_out,"%s%s%s",ph_buf2,ph_buf,ph_append);
if((thousandplex > 0) && (langopts.numbers2 & 0x200))
sprintf(ph_out,"%s%s%s",ph_append,ph_buf2,ph_buf); // say "thousands" before its number
else
sprintf(ph_out,"%s%s%s",ph_buf2,ph_buf,ph_append);
while(decimal_point)
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.36.06 22.Mar.08";
const char *version_string = "1.36.07 25.Mar.08";
const int version_phdata = 0x013400;
int option_device_number = -1;
+3
View File
@@ -601,6 +601,9 @@ SetLengthMods(tr,3); // all equal
tr->langopts.stress_rule = 2;
tr->langopts.stress_flags = 0x16;
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.numbers = 0x61 + 0x100000 + 0x4000;
tr->langopts.numbers2 = 0x200; // say "thousands" before its number
}
break;
+7 -8
View File
@@ -1918,14 +1918,13 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i
int final;
static const unsigned char hangul_compatibility[0x34] = {
0, 0x00,0x01,0x82,0x02,0x84,0x85,0x03,
0x04,0x05,0x88,0x89,0x8a,0x8b,0x8c,0x8d,
0x8e,0x06,0x07,0x08,0x91,0x09,0x0a,0x94,
0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x40,
0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,
0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,
0x51,0x52,0x53,0x54 };
0, 0x00,0x01,0xaa,0x02,0xac,0xad,0x03,
0x04,0x05,0xb0,0xb1,0xb2,0xb3,0xb4,0xb4,
0xb6,0x06,0x07,0x08,0xb9,0x09,0x0a,0xbc,
0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x61,
0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,
0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,
0x72,0x73,0x74,0x75 };
switch(translator_name)
{
+1
View File
@@ -342,6 +342,7 @@ typedef struct {
// bit6=(LANG=pl) two forms of plural, M or MA
// bit7=(LANG-ru) use MB for 1 thousand, million, etc
// bit8=(LANG=sw) special word for 100,000s
// bit9=(LANG=rw) say "thousand" and "million" before its number, not after
int numbers2;
int max_roman;