@@ -47,6 +47,7 @@ praat-mod/ | |||
ChangeLog.txt | |||
License.txt | |||
ReadMe | |||
Makefile | |||
# espeak-data | |||
@@ -19,6 +19,7 @@ | |||
// $alt1 use strong ending (-table, -inal) | |||
// $alt2 use weak ending | |||
// $alt3 use weak first vowel, a->[a#], e->[@], o->[0#] | |||
// $alt6 'to' | |||
// letter names, as they are spoken as a single character in text | |||
@@ -261,11 +262,12 @@ _hi h'Indi | |||
_bn bEng'A:li | |||
_gur g'U@mUki | |||
_gu gu:dZ3r'A:ti | |||
_or 0r'i@ | |||
_or O:r'ia: | |||
_ta t'amI2l | |||
_te t'Elugu | |||
_kn k'A:na#d@ | |||
_ml maleI'A:l@m | |||
_si sI2nh'A:l@ | |||
_si s'INh@l@ | |||
_th t'aI | |||
_lo l'aU | |||
_ti tI2b'Et@n | |||
@@ -3773,7 +3775,7 @@ for fO@ $u | |||
(for a while) f@@||w'aIl | |||
(for one) fO@w0n $2 $atend | |||
to t@5 $verbf // @ change to U before vowel | |||
to t@5 $verbf $alt6 // @ change to U before vowel | |||
(to be) t@b%i $pastf | |||
(to be) t@||'bi: $atend | |||
(to to) %tU_t@5 $verbf | |||
@@ -4036,6 +4038,9 @@ thou DaU | |||
thy ,DaI | |||
thine ,DaIn | |||
(i had) aI||h'ad $atend | |||
(he had) hi:||h'ad $atend | |||
me ,mi: $only | |||
me mi: $atstart $atend | |||
him ,hIm $only |
@@ -2768,6 +2768,7 @@ | |||
h (_ | |||
_B) h | |||
@) hammed h'amId | |||
d) h (am_ | |||
A) han (_ han // places | |||
e) han (_ h@n | |||
ha (st heI |
@@ -5,6 +5,9 @@ | |||
// A means vowel letters (not vowel signs) | |||
// B means a combining vowel sign or a virama | |||
// change (k t. t p) to (g d. d b) if followed by a vowel, unless at start of a word or preceeded by an unvoiced stop consonant ?? | |||
.L01 _ ക് ച് ട് ത് പ് | |||
.replace | |||
൦ 0 // Convert Malayalam numbers | |||
@@ -24,8 +27,13 @@ | |||
.group ക | |||
ക ka | |||
ക (B k | |||
ക് k | |||
L01) ക ka | |||
L01) ക (B k | |||
ക ga | |||
ക (B g | |||
ക്ക k:a | |||
ക്ക (B k: | |||
.group ഖ | |||
ഖ kha | |||
@@ -64,8 +72,13 @@ | |||
ഞ (B n^ | |||
.group ട | |||
ട t.a | |||
ട (B t. | |||
ട് t. | |||
L01) ട t.a | |||
L01) ട (B t. | |||
ട d.a | |||
ട (B d. | |||
ട്ട t.:a | |||
ട്ട (B t.: | |||
.group ഠ | |||
ഠ th.a | |||
@@ -84,8 +97,13 @@ | |||
ണ (B n. | |||
.group ത | |||
ത ta | |||
ത (B t | |||
ത് t | |||
L01) ത ta | |||
L01) ത (B t | |||
ത da | |||
ത (B d | |||
ത്ത t:a | |||
ത്ത (B t: | |||
.group ഥ | |||
ഥ tha | |||
@@ -104,8 +122,13 @@ | |||
ന (B n | |||
.group പ | |||
പ pa | |||
പ (B p | |||
പ് p | |||
L01) പ pa | |||
L01) പ (B p | |||
പ ba | |||
പ (B b | |||
പ്പ p:a | |||
പ്പ (B p: | |||
.group ഫ | |||
ഫ pha |
@@ -1,6 +1,7 @@ | |||
// This file in UTF8 encoded | |||
// $alt2, remove s from plural, remove en from plural | |||
// Use $alt3 where 'ng' and 'nk' is 'n+g' not [N] | |||
// Letters | |||
@@ -1408,6 +1409,7 @@ armand _^_FR | |||
augustus VUQ'8st8s | |||
bacterie bAkt'I:ri | |||
banengids $alt3 | |||
bascule $2 | |||
beha be:_h'a: | |||
beige bEZ@ | |||
benard b@nArt | |||
@@ -1444,6 +1446,8 @@ damascering damA;s'e:rIN | |||
december $2 | |||
dieet $2 | |||
diesel diz@l | |||
discipline $3 | |||
//discussie $2 | |||
divers div'Ers | |||
diftongering dIft,ON'e:rIN | |||
doordat $2 | |||
@@ -1474,6 +1478,7 @@ januari $3 | |||
kadaster $2 | |||
mangat $alt3 | |||
materie ma:t'e:ri | |||
maatregel ma:tre:Q@l $alt2 | |||
maxima $1 | |||
meteen mEt'e:n | |||
metro me:tro: |
@@ -4,6 +4,7 @@ | |||
// Suffix rule: SUFX_E eg. S2e means double the vowel before the final consonant | |||
.L01 g k | |||
.L02 _ t_ d_ de_ den_ // verb endings | |||
.group a | |||
@@ -65,6 +66,7 @@ | |||
&) bare (_S4 =ba:r@ | |||
_) bij (C@P3 b'EI | |||
bij (zond b%i | |||
_) bijeen bEI'e:n | |||
_) binnen (P6 b'In@n | |||
_) boven (P5 b'o:v@n | |||
_) brand br'And | |||
@@ -188,7 +190,8 @@ | |||
ig) e (_+S1qd @ | |||
ea (_ 'e:a: | |||
eau o: //words with French origin | |||
eau 'o: //words with French origin | |||
// eau (_ 'o: | |||
@) ee (_ 'e: | |||
@) ee (X_ 'e: | |||
@) ee (r_ 'I | |||
@@ -214,6 +217,7 @@ | |||
&) el (ingen_$p_alt =@l | |||
@) elen (_ 'e:l@n | |||
@) el (en_$p_alt2 @L | |||
&) elijks @l@ks | |||
&) em (_ @m | |||
&) e (ment @ | |||
@@ -256,7 +260,6 @@ | |||
@) etten (_S3 @n | |||
@) es (_$p_alt @s // for wors which end on [@] with multiple on 's'. | |||
eau (_ 'o: | |||
euille @'y | |||
eum (_$w_alt 'e:8m | |||
@mus) eum (_ ,e:8m // compounds | |||
@@ -360,11 +363,13 @@ | |||
ie i | |||
ieuw iw | |||
iee ie: | |||
ii i | |||
d) ie (_ 'i | |||
g) ie (_ 'i | |||
m) ie (_ 'i | |||
p) ie (_ 'i | |||
ss) ie (_ =i | |||
ieus (_ ij'Y:s | |||
ieuze (_ ij'Y:z@ | |||
ieuzer (_ ij'Y:z@r | |||
@@ -407,6 +412,7 @@ | |||
io (nage iO | |||
io (de_ i'o: | |||
iodes (_ i'o:d@s | |||
_) in (scrip In | |||
is (_ Is | |||
@) isch (_ =is | |||
@) ische (_ =is@ | |||
@@ -521,6 +527,7 @@ _) inn (@P2 'I // ?? inneren | |||
@@C) o (_ =o: | |||
obsc (u opsk | |||
oe (X_ 'u | |||
office Of@s | |||
oir (_ 'v#a:r | |||
pl) oi (t v#A | |||
c) oi (ffu v#A | |||
@@ -532,6 +539,7 @@ _) inn (@P2 'I // ?? inneren | |||
_) oost (@P4 o:st | |||
_) op (@@P2 'Op | |||
_) open (@P4 'o:p@n | |||
_) op (enen 'o:p | |||
_) openings (P8 'o:p@nINs | |||
_) op (era 'o:p | |||
_) op (tion Op | |||
@@ -620,7 +628,8 @@ _) inn (@P2 'I // ?? inneren | |||
A) s (A z | |||
s (b z | |||
s (d z | |||
sc s | |||
sc (e s | |||
sc (i s | |||
sch sx | |||
sch (_ s | |||
sch (e_ s | |||
@@ -633,11 +642,14 @@ _) inn (@P2 'I // ?? inneren | |||
a) s (_ s | |||
@) s (_$w_alt =s | |||
_) samen(@P5 s'a:m@n | |||
_) samen(@P5 s'a:m@n | |||
_) scan (L02 skEn | |||
science saI@ns | |||
sc (oop sk | |||
sc (opi sk | |||
&) sel (_ =s@l | |||
&) selen (_ =s@l@n | |||
service s8v@s | |||
@) si (o S | |||
A) si (o Z | |||
@) ssi (o S |
@@ -631,8 +631,8 @@ abacaxi abakaSy | |||
abordo $alt | |||
aborto $alt $verb | |||
acerto $alt2 $noun | |||
acordo $alt $verb | |||
acertos $alt2 | |||
acordo $alt $verb | |||
acervo $alt2 | |||
adepto $alt | |||
adereço $alt2 | |||
@@ -663,8 +663,6 @@ ateia $alt | |||
aterro $alt2 $noun | |||
atmosfera $alt | |||
atrozes $alt | |||
austera $alt | |||
austero $alt | |||
autora $alt2 | |||
avesso $alt2 | |||
axé aSE | |||
@@ -706,8 +704,6 @@ cefaleia $alt | |||
cerca $alt | |||
cerca $alt2 $noun | |||
cerco $alt $verb | |||
cesta $alt2 | |||
cesto $alt2 | |||
chamego $alt2 | |||
chefe $alt | |||
checam $alt | |||
@@ -737,8 +733,6 @@ consolo $alt2 $noun | |||
contivermos $alt | |||
controle $alt2 $noun | |||
controlo $alt2 $noun | |||
copa $alt | |||
copo $alt | |||
coreia $alt | |||
corneta $alt2 | |||
cornos $alt | |||
@@ -751,8 +745,6 @@ couberdes $alt | |||
coubermos $alt | |||
cratera $alt | |||
crede $alt2 | |||
cresce $alt | |||
crescem $alt | |||
der $alt | |||
derdes $alt | |||
desapego $alt2 $noun | |||
@@ -779,14 +771,7 @@ encosto $alt $verb | |||
endereço $alt2 | |||
endereço $alt $verb | |||
enforco $alt | |||
enforque $alt | |||
enforquem $alt | |||
engordo $alt | |||
ensopa $alt | |||
ensopam $alt | |||
ensope $alt | |||
ensopem $alt | |||
ensopo $alt | |||
enredo $alt $verb | |||
enterro $alt2 $noun | |||
enumerem $alt | |||
@@ -877,16 +862,10 @@ houvermos $alt | |||
ideia $alt | |||
insonoro $alt | |||
interesse $alt2 $noun | |||
joga $alt | |||
jogam$alt | |||
jogo $alt $verb | |||
jogos $alt | |||
jogue $alt | |||
joguem $alt | |||
jogo $alt2 $noun | |||
joguete $alt2 | |||
lambreta $alt2 | |||
lebre $alt | |||
líderes $alt2 | |||
lopes $alt | |||
maior $alt | |||
maleta $alt2 | |||
@@ -913,7 +892,6 @@ minueto $alt2 | |||
miolo $alt2 | |||
miolos $alt | |||
moeda $alt | |||
modo $alt | |||
modos $alt | |||
molho $alt2 $noun | |||
monera $alt | |||
@@ -1001,20 +979,12 @@ reitora $alt2 | |||
relevo $alt2 $noun | |||
remorso $alt | |||
reprovo $alt | |||
resolve $alt | |||
resolvem $alt | |||
retorno $alt $verb | |||
rixa x'iS& | |||
rocha $alt | |||
rock $alt | |||
rogas $alt | |||
rola $alt2 $noun | |||
rolo $alt2 $noun | |||
rosna $alt | |||
rosnam $alt | |||
rosne $alt | |||
rosnem $alt | |||
rosno $alt | |||
rumores $alt2 | |||
saleta $alt2 | |||
sarjeta $alt | |||
@@ -1029,17 +999,10 @@ sexteto $alt2 | |||
?1 senhora $alt2 | |||
senhores $alt2 | |||
sinopse $alt | |||
sobe $alt | |||
sobem $alt | |||
soco $alt2 | |||
soco $alt $verb | |||
sofrem $alt | |||
sofre $alt | |||
sofreste $alt2 | |||
sogra $alt | |||
sopre $alt | |||
soprem $alt | |||
sopro $alt $verb | |||
sopro $alt2 $noun | |||
soro $alt2 | |||
sorvete $alt2 | |||
sossego $alt2 $noun | |||
@@ -1058,10 +1021,6 @@ tiverdes $alt | |||
tivermos $alt | |||
tocha $alt | |||
toga $alt | |||
tola $alt2 | |||
tolo $alt2 | |||
tolhe $alt | |||
tolhem $alt | |||
topo $alt $verb | |||
torno $alt $verb | |||
torre $alt2 $noun |
@@ -413,8 +413,8 @@ respond) e (L07_ e // cor- | |||
_estr) ei (L03_ EI | |||
_inv) e (jL04_ E | |||
_dec) e (pL04_ E | |||
_s) e (quL02_ E | |||
_p) e (quL02_ E | |||
_s) e (quL02_ E | |||
l) e (que_ E | |||
_sug) e (rL02_ E | |||
_imp) e (rL03_ E | |||
@@ -442,24 +442,26 @@ respond) e (L07_ e // cor- | |||
_f) e (rvL03_ e | |||
_p) e (sL01_ E | |||
_d) e (scL02_ E | |||
_cr) e (scL02_ E | |||
_p) e (scL03_ E | |||
_m) e (sclL04 E | |||
_l) e (ssL02_ e | |||
_esp) e (ssL03_ e | |||
_c) e (stL03_ e | |||
_m) e (tL03_ e | |||
_pr) e (tL03_ e | |||
_com) e (tL03_ e | |||
_rem) e (tL03_ e | |||
prom) e (tL03_ e // com- | |||
_derr) e (tL03_ e | |||
_obsol) e (tL03_ e | |||
_pr) e (tL03_ e | |||
_sol) e (trL03_ E | |||
_pen) e (trL04_ E | |||
scr) e (vL03_ e // e- in- pre- ree- de- | |||
_d) e (vL03_ e | |||
scr) e (vL03_ e // e- in- pre- ree- de- | |||
_atr) e (vL03_ e | |||
_embel) e (zL04_ E | |||
pr) e (zL04_ E / des- menos- | |||
_embel) e (zL04_ E | |||
_acont) e (çL01_ e | |||
_arref) e (çL01_ e | |||
par) e (çL03_ e // a- re- com- rea- desa- | |||
@@ -469,7 +471,6 @@ _arref) e (çL01_ e | |||
_mer) e (çL03_ e | |||
_pad) e (çL03_ e // com- | |||
_per) e (çL03_ e | |||
_rejuven) e (çL03_ e | |||
conh) e (çL03_ e // re- | |||
_esqu) e (çL03_ e | |||
_forn) e (çL03_ e | |||
@@ -488,6 +489,7 @@ _envelh) e (çL03_ e | |||
_esclar) e (çL03_ e | |||
_estrem) e (çL03_ e | |||
_fortal) e (çL03_ e | |||
_rejuven) e (çL03_ e | |||
//endsort | |||
@@ -779,26 +781,34 @@ _fortal) e (çL03_ e | |||
//sort | |||
_engl) o (bL01_ O | |||
_s) o (bL02_ O | |||
_esn) o (bL04_ O | |||
_deb) o (chL04_ O | |||
_desabr) o (chL04_ O | |||
_s) o (frL02_ O | |||
_j) o (gL04_ O | |||
_r) o (gL04_ O | |||
_adv) o (gL04_ O | |||
_ref) o (gL04_ O | |||
_ap) oi (L01_ OI | |||
_esc) o (lhL02_ O | |||
_t) o (lL03_ o | |||
c) o (lhL02_ O / es- en- re- | |||
_t) o (lhL02_ O | |||
_m) o (lhL04_ O | |||
env) o (lvL02_ O / des- | |||
_abs) o (lvL02_ O | |||
_env) o (lvL02_ O | |||
_res) o (lvL02_ O | |||
_rev) o (lvL02_ O | |||
_desenv) o (lvL02_ O | |||
_ent) o (pL02_ O | |||
_c) o (pL03_ O | |||
_ens) o (pL04_ O | |||
_s) o (prL04_ O | |||
_enf) o (rquL02_ O | |||
c) o (rrL01_ o // escorra, incorra, corra, recorra | |||
_m) o (rrL01_ o | |||
_r) o (snL04_ O | |||
_c) o (spL02_ O | |||
p) ostos (_ Ost=Us# // dispostos etc. | |||
_s) o (bL02_ O | |||
_s) o (prL02_ O | |||
//endsort | |||
.group ô |
@@ -2291,7 +2291,7 @@ vindeţi $1 | |||
vinovăţi $alt | |||
vinovăţii $4 | |||
virgulă $1 | |||
vis-a-vis vizav'i | |||
(vis-a vis) vizav'i | |||
viscol $1 | |||
vitreg $1 | |||
vitrege $1 |
@@ -198,6 +198,8 @@ | |||
ţi-) i (_ _ // combined with previous word as [iI] | |||
Cr) i (_+++ i | |||
V&) i (N_ 'i // verb | |||
@) i (A$p_alt1 i // i is not [j] | |||
ăC) ia (_ 'ia | |||
âC) ia (_ 'ia | |||
ăC) ie (_ 'ie |
@@ -113,6 +113,12 @@ U+bf9 ru:ba:j | |||
½ araI | |||
¾ mukka:l | |||
// alphabet names | |||
_ar arVbU | |||
_cyr sirillik | |||
_he ;ebire:jVm | |||
// abbreviations | |||
ரூ ru:ba:j $dot $only | |||
(பி . ஏ) bije: $dot |
@@ -192,12 +192,35 @@ const char *LookupMnemName(MNEM_TAB *table, const int value) | |||
} /* end of LookupMnemValue */ | |||
char *print_dictionary_flags(unsigned int *flags) | |||
{//============================================== | |||
static char buf[20]; | |||
void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len) | |||
{//======================================================================== | |||
int stress; | |||
int ix; | |||
const char *name; | |||
int len; | |||
int total = 0; | |||
buf[0] = 0; | |||
if((stress = flags[0] & 0xf) != 0) | |||
{ | |||
sprintf(buf, "%s", LookupMnemName(mnem_flags, stress + 0x40)); | |||
total = strlen(buf); | |||
buf += total; | |||
} | |||
sprintf(buf,"%s 0x%x/%x",LookupMnemName(mnem_flags,(flags[0] & 0xf)+0x40), flags[0], flags[1]); | |||
return(buf); | |||
for(ix=8; ix<64; ix++) | |||
{ | |||
if(((ix < 30) && (flags[0] & (1 << ix))) || ((ix >= 0x20) && (flags[1] & (1 << (ix-0x20))))) | |||
{ | |||
name = LookupMnemName(mnem_flags, ix); | |||
len = strlen(name) + 1; | |||
total += len; | |||
if(total >= buf_len) | |||
continue; | |||
sprintf(buf, " %s", name); | |||
buf += len; | |||
} | |||
} | |||
} | |||
@@ -37,7 +37,7 @@ | |||
int dictionary_skipwords; | |||
char dictionary_name[40]; | |||
extern char *print_dictionary_flags(unsigned int *flags); | |||
extern void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len); | |||
extern char *DecodeRule(const char *group_chars, int group_length, char *rule, int control); | |||
// accented characters which indicate (in some languages) the start of a separate syllable | |||
@@ -770,7 +770,7 @@ static int IsLetterGroup(Translator *tr, char *word, int group, int pre) | |||
{ | |||
w = word; | |||
} | |||
while(*p == *w) | |||
while((*p == *w) && (*w != 0)) | |||
{ | |||
w++; | |||
p++; | |||
@@ -2715,7 +2715,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c | |||
p += (wc_bytes-1); | |||
} | |||
if(((alphabet = AlphabetFromChar(letter)) != NULL) && (alphabet->language != 0) && (alphabet->offset != tr->letter_bits_offset)) | |||
if(((alphabet = AlphabetFromChar(letter)) != NULL) && (alphabet->flags & AL_WORDS) && (alphabet->offset != tr->letter_bits_offset)) | |||
{ | |||
// switch to the nominated language for this alphabet | |||
sprintf(phonemes,"%c%s",phonSWITCH, WordToString2(alphabet->language)); | |||
@@ -2808,8 +2808,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c | |||
} | |||
} | |||
// any language specific changes ? | |||
ApplySpecialAttribute(tr,phonemes,dict_flags0); | |||
memcpy(p_start,word_copy,strlen(word_copy)); | |||
return(0); | |||
@@ -2853,46 +2851,6 @@ void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags) | |||
} // end of ApplySpecialAttribute2 | |||
void ApplySpecialAttribute(Translator *tr, char *phonemes, int dict_flags) | |||
{//======================================================================= | |||
// Amend the translated phonemes according to an attribute which is specific for the language. | |||
int len; | |||
char *p_end; | |||
if((dict_flags & (FLAG_ALT_TRANS | FLAG_ALT2_TRANS)) == 0) | |||
return; | |||
len = strlen(phonemes); | |||
p_end = &phonemes[len-1]; | |||
switch(tr->translator_name) | |||
{ | |||
#ifdef deleted | |||
// this is now done in de_rules | |||
case L('d','e'): | |||
if(p_end[0] == PhonemeCode2('i',':')) | |||
{ | |||
// words ends in ['i:], change to [=I@] | |||
p_end[-1] = phonSTRESS_PREV; | |||
p_end[0] = PhonemeCode('I'); | |||
p_end[1] = phonSCHWA; | |||
p_end[2] = 0; | |||
} | |||
break; | |||
#endif | |||
case L('r','o'): | |||
if(p_end[0] == PhonemeCode('j')) | |||
{ | |||
// word end in [j], change to ['i] | |||
p_end[0] = phonSTRESS_P; | |||
p_end[1] = PhonemeCode('i'); | |||
p_end[2] = 0; | |||
} | |||
break; | |||
} | |||
} // end of ApplySpecialAttribute | |||
//============================================================================================= | |||
@@ -3045,6 +3003,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor | |||
const char *word1; | |||
int wflags = 0; | |||
char word_buf[N_WORD_BYTES+1]; | |||
char dict_flags_buf[80]; | |||
if(wtab != NULL) | |||
{ | |||
@@ -3265,6 +3224,11 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor | |||
if(tr->expect_verb || (tr->expect_verb_s && (end_flags & FLAG_SUFX_S))) | |||
{ | |||
// OK, we are expecting a verb | |||
if((tr->translator_name == L('e','n')) && (tr->prev_dict_flags[0] & FLAG_ALT6_TRANS) && (end_flags & FLAG_SUFX_S)) | |||
{ | |||
// lang=en, don't use verb form after 'to' if the word has 's' suffix | |||
continue; | |||
} | |||
} | |||
else | |||
{ | |||
@@ -3294,7 +3258,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor | |||
if(dictionary_flags & FLAG_ALT2_TRANS) | |||
{ | |||
// language specific | |||
if((tr->translator_name == L('h','u')) && !(tr->prev_dict_flags & FLAG_ALT_TRANS)) | |||
if((tr->translator_name == L('h','u')) && !(tr->prev_dict_flags[0] & FLAG_ALT_TRANS)) | |||
continue; | |||
} | |||
@@ -3308,7 +3272,8 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor | |||
{ | |||
if(option_phonemes == 2) | |||
{ | |||
fprintf(f_trans,"Flags: %s %s\n",word1,print_dictionary_flags(flags)); | |||
print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); | |||
fprintf(f_trans,"Flags: %s %s\n", word1, dict_flags_buf); | |||
} | |||
return(0); // no phoneme translation found here, only flags. So use rules | |||
} | |||
@@ -3331,19 +3296,20 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor | |||
if(textmode == translator->langopts.textmode) | |||
{ | |||
// only show this line if the word translates to phonemes, not replacement text | |||
if((dictionary_skipwords) && (wtab != NULL)) | |||
if((dictionary_flags & FLAG_SKIPWORDS) && (wtab != NULL)) | |||
{ | |||
// matched more than one word | |||
// (check for wtab prevents showing RULE_SPELLING byte when speaking individual letters) | |||
memcpy(word_buf,word2,word_end-word2); | |||
word_buf[word_end-word2-1] = 0; | |||
fprintf(f_trans,"Found: '%s %s",word1,word_buf); | |||
fprintf(f_trans,"Found: '%s %s\n",word1,word_buf); | |||
} | |||
else | |||
{ | |||
fprintf(f_trans,"Found: '%s",word1); | |||
} | |||
fprintf(f_trans,"' [%s] %s\n",ph_decoded,print_dictionary_flags(flags)); | |||
print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); | |||
fprintf(f_trans,"' [%s] %s\n", ph_decoded,dict_flags_buf); | |||
} | |||
} | |||
@@ -46,14 +46,14 @@ t_espeak_command* create_espeak_text(const void *text, size_t size, unsigned int | |||
{ | |||
goto text_error; | |||
} | |||
a_text = malloc( size ); | |||
a_text = malloc( size+1 ); | |||
if (!a_text) | |||
{ | |||
goto text_error; | |||
} | |||
memcpy(a_text, text, size); | |||
a_command->type = ET_TEXT; | |||
a_command->state = CS_UNDEFINED; | |||
data = &(a_command->u.my_text); | |||
@@ -102,7 +102,7 @@ t_espeak_command* create_espeak_terminated_msg(unsigned int unique_identifier, v | |||
{ | |||
goto msg_error; | |||
} | |||
a_command->type = ET_TERMINATED_MSG; | |||
a_command->state = CS_UNDEFINED; | |||
data = &(a_command->u.my_terminated_msg); | |||
@@ -234,7 +234,7 @@ t_espeak_command* create_espeak_char(wchar_t character, void* user_data) | |||
{ | |||
goto char_error; | |||
} | |||
a_command->type = ET_CHAR; | |||
a_command->state = CS_UNDEFINED; | |||
a_command->u.my_char.user_data = user_data; | |||
@@ -270,11 +270,11 @@ t_espeak_command* create_espeak_parameter(espeak_PARAMETER parameter, int value, | |||
{ | |||
goto param_error; | |||
} | |||
a_command->type = ET_PARAMETER; | |||
a_command->state = CS_UNDEFINED; | |||
data = &(a_command->u.my_param); | |||
data->parameter = parameter; | |||
data->parameter = parameter; | |||
data->value = value; | |||
data->relative = relative; | |||
a_error=0; | |||
@@ -308,7 +308,7 @@ t_espeak_command* create_espeak_punctuation_list(const wchar_t *punctlist) | |||
{ | |||
goto list_error; | |||
} | |||
a_command->type = ET_PUNCTUATION_LIST; | |||
a_command->state = CS_UNDEFINED; | |||
@@ -350,7 +350,7 @@ t_espeak_command* create_espeak_voice_name(const char *name) | |||
{ | |||
goto name_error; | |||
} | |||
a_command->type = ET_VOICE_NAME; | |||
a_command->state = CS_UNDEFINED; | |||
a_command->u.my_voice_name = strdup( name); | |||
@@ -381,7 +381,7 @@ t_espeak_command* create_espeak_voice_spec(espeak_VOICE *voice) | |||
{ | |||
goto spec_error; | |||
} | |||
a_command->type = ET_VOICE_SPEC; | |||
a_command->state = CS_UNDEFINED; | |||
{ | |||
@@ -451,11 +451,11 @@ int delete_espeak_command( t_espeak_command* the_command) | |||
break; | |||
case ET_TERMINATED_MSG: | |||
{ | |||
{ | |||
// if the terminated msg is pending, | |||
// it must be processed here for informing the calling program | |||
// it must be processed here for informing the calling program | |||
// that its message is finished. | |||
// This can be important for cleaning the related user data. | |||
// This can be important for cleaning the related user data. | |||
t_espeak_terminated_msg* data = &(the_command->u.my_terminated_msg); | |||
if (the_command->state == CS_PENDING) | |||
{ | |||
@@ -491,7 +491,7 @@ int delete_espeak_command( t_espeak_command* the_command) | |||
free((void*)(the_command->u.my_voice_name)); | |||
} | |||
break; | |||
case ET_VOICE_SPEC: | |||
{ | |||
espeak_VOICE* data = &(the_command->u.my_voice_spec); | |||
@@ -542,23 +542,23 @@ void process_espeak_command( t_espeak_command* the_command) | |||
case ET_TEXT: | |||
{ | |||
t_espeak_text* data = &(the_command->u.my_text); | |||
sync_espeak_Synth( data->unique_identifier, data->text, data->size, | |||
data->position, data->position_type, | |||
data->end_position, data->flags, data->user_data); | |||
sync_espeak_Synth( data->unique_identifier, data->text, data->size, | |||
data->position, data->position_type, | |||
data->end_position, data->flags, data->user_data); | |||
} | |||
break; | |||
case ET_MARK: | |||
{ | |||
t_espeak_mark* data = &(the_command->u.my_mark); | |||
sync_espeak_Synth_Mark( data->unique_identifier, data->text, data->size, | |||
data->index_mark, data->end_position, data->flags, | |||
sync_espeak_Synth_Mark( data->unique_identifier, data->text, data->size, | |||
data->index_mark, data->end_position, data->flags, | |||
data->user_data); | |||
} | |||
break; | |||
case ET_TERMINATED_MSG: | |||
{ | |||
{ | |||
t_espeak_terminated_msg* data = &(the_command->u.my_terminated_msg); | |||
sync_espeak_terminated_msg( data->unique_identifier, data->user_data); | |||
} | |||
@@ -654,8 +654,8 @@ void display_espeak_command( t_espeak_command* the_command) | |||
{ | |||
t_espeak_terminated_msg* data = &(the_command->u.my_terminated_msg); | |||
SHOW("display_espeak_command > (0x%x) TERMINATED_MSG uid=%d, user_data=0x%x, state=%d\n", | |||
the_command, data->unique_identifier, data->user_data, | |||
SHOW("display_espeak_command > (0x%x) TERMINATED_MSG uid=%d, user_data=0x%x, state=%d\n", | |||
the_command, data->unique_identifier, data->user_data, | |||
the_command->state); | |||
} | |||
break; | |||
@@ -670,7 +670,7 @@ void display_espeak_command( t_espeak_command* the_command) | |||
case ET_PARAMETER: | |||
{ | |||
t_espeak_parameter* data = &(the_command->u.my_param); | |||
SHOW("display_espeak_command > (0x%x) PARAMETER=%d, value=%d, relative=%d\n", | |||
SHOW("display_espeak_command > (0x%x) PARAMETER=%d, value=%d, relative=%d\n", | |||
the_command, data->parameter, data->value, data->relative); | |||
} | |||
break; |
@@ -631,25 +631,6 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) | |||
return(0); | |||
} | |||
#ifdef deleted | |||
if((ph_buf[0] == 0) && (tr->translator_name != L('e','n'))) | |||
{ | |||
// speak as English, check whether there is a translation for this character | |||
SetTranslator2("en"); | |||
save_option_phonemes = option_phonemes; | |||
option_phonemes = 0; | |||
LookupLetter(translator2, letter, word[n_bytes], ph_buf, control & 1); | |||
SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | |||
option_phonemes = save_option_phonemes; | |||
if(ph_buf[0] != 0) | |||
{ | |||
sprintf(phonemes,"%cen",phonSWITCH); | |||
return(0); | |||
} | |||
} | |||
#endif | |||
alphabet = AlphabetFromChar(letter); | |||
if(alphabet != current_alphabet) | |||
{ | |||
@@ -892,7 +873,7 @@ static int CheckDotOrdinal(Translator *tr, char *word, char *word_end, WORD_TAB | |||
nextflags = TranslateWord(tr, &word_end[2], 0, NULL, NULL); | |||
} | |||
if((tr->prev_dict_flags & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG_COMMA_AFTER) || iswdigit(c2))) | |||
if((tr->prev_dict_flags[0] & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG_COMMA_AFTER) || iswdigit(c2))) | |||
ordinal = 0; // TEST 09.02.10 | |||
if(nextflags & FLAG_ALT_TRANS) | |||
@@ -903,7 +884,7 @@ if((tr->prev_dict_flags & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG | |||
if(word[-2] == '-') | |||
ordinal = 0; // eg. december 2-5. között | |||
if(tr->prev_dict_flags & (FLAG_ALT_TRANS | FLAG_ALT3_TRANS)) | |||
if(tr->prev_dict_flags[0] & (FLAG_ALT_TRANS | FLAG_ALT3_TRANS)) | |||
ordinal = 0x22; | |||
} | |||
} | |||
@@ -1052,7 +1033,8 @@ int TranslateRoman(Translator *tr, char *word, char *ph_out, WORD_TAB *wtab) | |||
} | |||
} | |||
tr->prev_dict_flags = 0; | |||
tr->prev_dict_flags[0] = 0; | |||
tr->prev_dict_flags[1] = 0; | |||
TranslateNumber(tr, &number_chars[2], p, flags, wtab, num_control); | |||
if(tr->langopts.numbers & NUM_ROMAN_AFTER) |
@@ -35,7 +35,7 @@ | |||
#include "translate.h" | |||
#include "wave.h" | |||
const char *version_string = "1.46.41 03.Mar.13"; | |||
const char *version_string = "1.46.42 06.Mar.13"; | |||
const int version_phdata = 0x014640; | |||
int option_device_number = -1; |
@@ -73,25 +73,25 @@ | |||
ALPHABET alphabets [] = { | |||
{"_el", OFFSET_GREEK, 0x380, 0x3ff, L('e','l'), AL_DONT_NAME | AL_NOT_LETTERS}, | |||
{"_cyr", OFFSET_CYRILLIC, 0x400, 0x52f, 0, 0}, | |||
{"_hy", OFFSET_ARMENIAN, 0x530, 0x58f, L('h','y'), 0}, | |||
{"_hy", OFFSET_ARMENIAN, 0x530, 0x58f, L('h','y'), AL_WORDS}, | |||
{"_he", OFFSET_HEBREW, 0x590, 0x5ff, 0, 0}, | |||
{"_ar", OFFSET_ARABIC, 0x600, 0x6ff, 0, 0}, | |||
{"_dv", OFFSET_THAANA, 0x780, 0x7bf, 0, 0}, | |||
{"_hi", OFFSET_DEVANAGARI, 0x900, 0x97f,L('h','i'), 0}, | |||
{"_hi", OFFSET_DEVANAGARI, 0x900, 0x97f,L('h','i'), AL_WORDS}, | |||
{"_bn", OFFSET_BENGALI, 0x0980, 0x9ff, 0, 0}, | |||
{"_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, 0, 0}, | |||
{"_gu", OFFSET_GUJARATI, 0xa80, 0xaff, 0, 0}, | |||
{"_or", OFFSET_ORIYA, 0xb00, 0xb7f, 0, 0}, | |||
{"_ta", OFFSET_TAMIL, 0xb80, 0xbff, L('t','a'), 0}, | |||
{"_te", OFFSET_TELUGU, 0xc00, 0xc7f, 0, 0}, | |||
{"_kn", OFFSET_KANNADA, 0xc80, 0xcff, L('k','n'), 0}, | |||
{"_ml", OFFSET_MALAYALAM,0xd00, 0xd7f, L('m','l'), 0}, | |||
{"_ta", OFFSET_TAMIL, 0xb80, 0xbff, L('t','a'), AL_WORDS}, | |||
{"_te", OFFSET_TELUGU, 0xc00, 0xc7f, L('t','e'), 0}, | |||
{"_kn", OFFSET_KANNADA, 0xc80, 0xcff, L('k','n'), AL_WORDS}, | |||
{"_ml", OFFSET_MALAYALAM,0xd00, 0xd7f, L('m','l'), AL_WORDS}, | |||
{"_si", OFFSET_SINHALA, 0xd80, 0xdff, 0, 0}, | |||
{"_th", OFFSET_THAI, 0xe00, 0xe7f, 0, 0}, | |||
{"_lo", OFFSET_LAO, 0xe80, 0xeff, 0, 0}, | |||
{"_ti", OFFSET_TIBET, 0xf00, 0xfff, 0, 0}, | |||
{"_my", OFFSET_MYANMAR, 0x1000,0x109f, 0, 0}, | |||
{"_ka", OFFSET_GEORGIAN, 0x10a0,0x10ff, L('k','a'), 0}, | |||
{"_ka", OFFSET_GEORGIAN, 0x10a0,0x10ff, L('k','a'), AL_WORDS}, | |||
{"_ko", OFFSET_KOREAN, 0x1100,0x11ff, 0, 0}, | |||
{"_eth", OFFSET_ETHIOPIC, 0x1200,0x139f, 0, 0}, | |||
{NULL, 0, 0, 0, 0, 0} |
@@ -1374,9 +1374,6 @@ if(end_type & SUFX_UNPRON) | |||
{ | |||
// don't retranslate, use the original lookup result | |||
strcpy(phonemes,phonemes2); | |||
// language specific changes | |||
ApplySpecialAttribute(tr,phonemes,dictionary_flags[0]); | |||
} | |||
else | |||
{ | |||
@@ -2059,7 +2056,8 @@ return(FLAG_SPELLWORD); | |||
pre_pause--; | |||
} | |||
tr->end_stressed_vowel = 0; // forget about the previous word | |||
tr->prev_dict_flags = 0; | |||
tr->prev_dict_flags[0] = 0; | |||
tr->prev_dict_flags[1] = 0; | |||
} | |||
if((option_capitals==1) && (word_flags & FLAG_FIRST_UPPER)) | |||
@@ -2208,7 +2206,7 @@ return(FLAG_SPELLWORD); | |||
{ | |||
if(first_phoneme && tr->langopts.param[LOPT_IT_DOUBLING]) | |||
{ | |||
if(((tr->prev_dict_flags & FLAG_DOUBLING) && (tr->langopts.param[LOPT_IT_DOUBLING] & 1)) || | |||
if(((tr->prev_dict_flags[0] & FLAG_DOUBLING) && (tr->langopts.param[LOPT_IT_DOUBLING] & 1)) || | |||
(tr->end_stressed_vowel && (tr->langopts.param[LOPT_IT_DOUBLING] & 2))) | |||
{ | |||
// italian, double the initial consonant if the previous word ends with a | |||
@@ -2264,7 +2262,7 @@ return(FLAG_SPELLWORD); | |||
ph_list2[max_stress_ix].synthflags |= SFLAG_PROMOTE_STRESS; | |||
} | |||
tr->prev_dict_flags = flags; | |||
tr->prev_dict_flags[0] = flags; | |||
return(flags); | |||
} // end of TranslateWord2 | |||
@@ -2623,7 +2621,8 @@ p = source; | |||
tr->expect_verb_s=0; | |||
tr->phonemes_repeat_count = 0; | |||
tr->end_stressed_vowel=0; | |||
tr->prev_dict_flags = 0; | |||
tr->prev_dict_flags[0] = 0; | |||
tr->prev_dict_flags[1] = 0; | |||
word_count = 0; | |||
single_quoted = 0; |
@@ -48,8 +48,11 @@ | |||
#define FLAG_ALT_TRANS 0x8000 // language specific | |||
#define FLAG_ALT2_TRANS 0x10000 // language specific | |||
#define FLAG_ALT3_TRANS 0x20000 // language specific | |||
#define FLAG_COMBINE 0x40000 // combine with the next word | |||
#define FLAG_ALT4_TRANS 0x40000 // language specific | |||
#define FLAG_ALT5_TRANS 0x80000 // language specific | |||
#define FLAG_ALT6_TRANS 0x100000 // language specific | |||
#define FLAG_COMBINE 0x800000 // combine with the next word | |||
#define FLAG_ALLOW_DOT 0x01000000 // ignore '.' after word (abbreviation) | |||
#define FLAG_NEEDS_DOT 0x02000000 // only if the word is followed by a dot | |||
#define FLAG_WAS_UNPRONOUNCABLE 0x04000000 // the unpronounceable routine was used | |||
@@ -79,7 +82,7 @@ | |||
#define FLAG_ONLY_S 0x8000 | |||
#define FLAG_STEM 0x10000 // must have a suffix | |||
#define FLAG_ATEND 0x20000 /* use this pronunciation if at end of clause */ | |||
#define FLAG_ATSTART 0x30000 // use this pronunciation if at start of clause | |||
#define FLAG_ATSTART 0x40000 // use this pronunciation if at start of clause | |||
#define BITNUM_FLAG_ALLCAPS 0x2a | |||
#define BITNUM_FLAG_HYPHENATED 0x2c | |||
@@ -272,7 +275,7 @@ extern ALPHABET *current_alphabet; | |||
// alphabet flags | |||
#define AL_DONT_NAME 0x01 // don't speak the alphabet name | |||
#define AL_NOT_LETTERS 0x02 // don't use the language for speaking letters | |||
#define AL_NOT_WORDS 0x04 // don't use the language to speak words | |||
#define AL_WORDS 0x04 // use the language to speak words | |||
#define N_LOPTS 21 | |||
@@ -585,7 +588,6 @@ typedef struct | |||
unsigned char groups2_start[256]; // index into groups2 | |||
const short *frequent_pairs; // list of frequent pairs of letters, for use in compressed *_list | |||
int expect_verb; | |||
int expect_past; // expect past tense | |||
int expect_verb_s; | |||
@@ -601,7 +603,7 @@ typedef struct | |||
int prepause_timeout; | |||
int end_stressed_vowel; // word ends with stressed vowel | |||
int prev_dict_flags; // dictionary flags from previous word | |||
int prev_dict_flags[2]; // dictionary flags from previous word | |||
int clause_terminator; | |||
} Translator; | |||
@@ -703,7 +705,6 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f | |||
void MakePhonemeList(Translator *tr, int post_pause, int new_sentence); | |||
int ChangePhonemes_ru(Translator *tr, PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch); | |||
void ApplySpecialAttribute(Translator *tr, char *phonemes, int dict_flags); | |||
void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags); | |||
void AppendPhonemes(Translator *tr, char *string, int size, const char *ph); | |||
@@ -554,12 +554,13 @@ voice_t *LoadVoice(const char *vname, int control) | |||
const char *language_type; | |||
char buf[200]; | |||
char path_voices[sizeof(path_home)+12]; | |||
char langname[4]; | |||
int stress_amps[8]; | |||
int stress_lengths[8]; | |||
int stress_add[8]; | |||
char names[8][40]; | |||
char name2[80]; | |||
const char *voice_dir; | |||
int pitch1; | |||
int pitch2; | |||
@@ -568,6 +569,12 @@ voice_t *LoadVoice(const char *vname, int control) | |||
static char voice_name[40]; // voice name for current_voice_selected | |||
static char voice_languages[100]; // list of languages and priorities for current_voice_selected | |||
// which directory to look for a named voice | |||
static const char *voices_asia = | |||
"fa fa-pin hi hy hy-west id ka kn ku ml ne pa ta tr vi vi-hue zh zh-yue "; | |||
static const char *voices_europe = | |||
"bg bs ca cs cy da el es et fi fr-be hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv "; | |||
strcpy(voicename,vname); | |||
if(voicename[0]==0) | |||
strcpy(voicename,"default"); | |||
@@ -581,27 +588,34 @@ voice_t *LoadVoice(const char *vname, int control) | |||
else | |||
{ | |||
sprintf(path_voices,"%s%cvoices%c",path_home,PATHSEP,PATHSEP); | |||
sprintf(buf,"%s%s",path_voices,voicename); | |||
sprintf(buf,"%s%s",path_voices,voicename); // first, look in the main voices directory | |||
if(GetFileLength(buf) <= 0) | |||
{ | |||
// look for the voice in a sub-directory of the language name | |||
langname[0] = voicename[0]; | |||
langname[1] = voicename[1]; | |||
langname[2] = 0; | |||
sprintf(buf,"%s%s%c%s",path_voices,langname,PATHSEP,voicename); | |||
if(GetFileLength(buf) <= 0) | |||
{ | |||
// look in "extra" sub-directory | |||
sprintf(buf,"%sextra%c%s",path_voices,PATHSEP,voicename); | |||
if(GetFileLength(buf) <= 0) | |||
{ | |||
// look in "test" sub-directory | |||
sprintf(buf,"%stest%c%s",path_voices,PATHSEP,voicename); | |||
} | |||
} | |||
// then look in the appropriate subdirectory | |||
if((voicename[0]=='m') && (voicename[1]=='b')) | |||
{ | |||
voice_dir = "mb"; // mbrola voices | |||
} | |||
else | |||
{ | |||
sprintf(name2, "%s ", voicename); | |||
if(strstr(voices_europe, voicename) != NULL) | |||
voice_dir = "europe"; | |||
else | |||
if(strstr(voices_asia, voicename) != NULL) | |||
voice_dir = "asia"; | |||
else | |||
voice_dir = "other"; | |||
sprintf(buf,"%s%s%c%s", path_voices,voice_dir,PATHSEP,voicename); | |||
if(GetFileLength(buf) <= 0) | |||
{ | |||
// if not found, look in "test" sub-directory | |||
sprintf(buf,"%stest%c%s",path_voices,PATHSEP,voicename); | |||
} | |||
} | |||
} | |||
} | |||
@@ -1195,7 +1195,7 @@ void *wave_test_get_write_buffer() | |||
// notdef USE_PORTAUDIO | |||
int wave_init(int srate) {} | |||
int wave_init(int srate) {return 1;} | |||
void* wave_open(const char* the_api) {return (void *)1;} | |||
size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} | |||
int wave_close(void* theHandler) {return 0;} |
@@ -870,7 +870,7 @@ void *wave_test_get_write_buffer() | |||
// notdef USE_PULSEAUDIO | |||
int wave_init() {} | |||
int wave_init(return 1;) {} | |||
void* wave_open(const char* the_api) {return (void *)1;} | |||
size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} | |||
int wave_close(void* theHandler) {return 0;} |
@@ -535,7 +535,7 @@ int wave_get_remaining_time(uint32_t sample, uint32_t* time) | |||
#else | |||
// notdef USE_SADA | |||
init wave_init() {} | |||
init wave_init() {return 1;} | |||
void* wave_open(const char* the_api) {return (void *)1;} | |||
size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize) {return theSize;} | |||
int wave_close(void* theHandler) {return 0;} |