diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index 04fc27e4..9f2b632b 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -148,7 +148,7 @@ p Q r R s s; t T ts v x z -Dictionary en_dict 2013-05-29 +Dictionary en_dict 2013-05-31 0 0# 3 3: @ @- @2 @5 @L a a# A: A@ aa aI aI3 @@ -463,7 +463,7 @@ N n^ p r R s S t tS ts tS; v x z Z -Dictionary ml_dict 2013-05-19 +Dictionary ml_dict 2013-05-30 @ a a# a: aI aU e E e: i I i: o o: r- u @@ -575,7 +575,7 @@ S s; S; t t; tS ts tS; ts; v w x z Z Z; -Dictionary pt_dict 2013-05-29 +Dictionary pt_dict 2013-05-31 & &/ &U~ &~ @ @- a A aI aU e E eI EI eU EU @@ -643,7 +643,7 @@ s S t t; tS ts v w x z Z -Dictionary sl_dict 2013-05-22 +Dictionary sl_dict 2013-05-31 @ @- a e E E# i o O o+ u y diff --git a/dictsource/en_list b/dictsource/en_list index 9dc2e7fa..a93b02bf 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -682,7 +682,7 @@ accouchement a#ku:SmO~ accusation akju:z'eIS@n acer eIs3 acetylene a#sEt@li:n -accurate akjUr@t +accurate $alt2 accursed a#k3:sI#d ?5 accursed a#kVRsI#d achille a#kIli: @@ -837,6 +837,7 @@ apparatus ap@r'eIt@s apprentice a#prEnt2Is approximate a#pr0ksIm@t $only approximate a#pr0ksImeIt $verb +approximately a#pr0ksIm@tli aqueduct akwI#dVkt arab ar@b arabic $1 @@ -1129,6 +1130,7 @@ chimera kaIm'i@r@ chimpanzee $3 chipotle tSI2poUtleI chisel tSIz@L +chivalrous SIv@Lr@s chloroplast $1 chocolate tS0kl@t cholera k0l@r@ @@ -1185,7 +1187,6 @@ coliseum k0l@s'i:@m collage k0l'A:Z collarbone k0l3boUn college k0lI2dZ -collegiate k@li:dZI@t colloquial k@loUkwI@L colon koUl@n color kVl3 @@ -1276,7 +1277,7 @@ coronet k0r@nEt corolla k@roUl@ corollary $2 corporal kO@pr@L -corporate kO@p@r@t +corporate $alt2 corps kO@ $only corral k@r'al corsage kO@s'A:Z @@ -1348,8 +1349,8 @@ deity deI@ti ?3 deity di:@t2i deja deIZA: $only deli dElI -deliberate dI2lIb@r@t -delicate dElI2k@t +deliberate $alt2 +delicate $alt2 delimit dI2lImIt // delimited delivery $alt2 demolish dI2m0lIS @@ -1587,6 +1588,7 @@ fetus fi:t@s fi f,aI // as in "hi-fi" fiasco fi:'askoU fiat fi:@t +ficus fIk@s fiery faI3rI ?3 fillet fI2leI finagle fI#neIg@L @@ -1625,7 +1627,7 @@ foyer fOIeI freelance fri:laans freon fri:0n fricassee frIka#seI -frigate frIg@t +frigate $alt2 fringer frIndZ3 // infringer fringing frIndZIN frisson fri:s'O~ @@ -1691,7 +1693,7 @@ gossamer g0s@m3 goto goUtu: gourmand gU@mA:nd gourmet gU@meI -graduate gradju:@t +graduate $alt2 graduate gradju:eIt $verb graffiti $alt3 grandson gr'andsVn @@ -1708,7 +1710,7 @@ guinea gIni gurus gu:ru:z habitual $alt3 -hacienda hasI'End@ +hacienda hA:sI'End@ haggis hagIs haha hA:h'A: halation $alt3 // in- @@ -1811,20 +1813,20 @@ impi $1 impinging Imp'IndZIN implacable Impl'ak@b@L imprecise ImprIs'aIs -inanimate In'anIm@t -inappropriate ,Ina#proUpri@t +inanimate $alt2 +inappropriate Ina#pr'oUpri@t incense Ins'Ens $verb incoming InkVmIN increase Inkr'i:s $verb indefine $3 -indeterminate IndI2t'3:mI2n@t +indeterminate $alt2 indicative $2 indices IndI2si:z indict Ind'aIt indie Indi indirect $3 ?3 indirect Ind3r'Ekt -indiscriminate IndI2skr'ImI2n@t +indiscriminate $alt2 indo IndoU indoor $1 $only industry IndVstrI @@ -1882,7 +1884,6 @@ iris aIrIs iron aI3n irony aIr@nI isosceles aIs'0s@li:z -itinerary aIt'In@r@rI ja jA: jagged dZagI#d @@ -1928,7 +1929,9 @@ labored leIb@d laborer leIb@r3 laborious $alt3 labyrinth lab3rInT +lascivious $alt3 lager lA:g3 +lagoon $alt3 laity leI@ti landowner l'and,oUn3 lapel $alt3 @@ -2077,7 +2080,7 @@ mercedes m3:s'eIdi:z //mercenary m3:s@n@rI merest mi@r@st meringue m@raN -merlot me@l'oU +merlot m3:l'oU mesa meIs@ meson mi:z0n metabolic mEt@b'0lIk @@ -2214,7 +2217,7 @@ obelisk 0b@lI2sk obesity oUb'i:s@ti obey oUb'eI obituary 0b'ItSU@i -?3 obituary oUb'ItSUe@i +?3 obituary oUb'ItSu:e@i object $1 $onlys object $verb obsolete 0bs@li:t @@ -2251,6 +2254,7 @@ oregano 0rIg'A:noU orion 0r'aI@n ornate $2 orphan O@f@n // orphaned +ottoman 0t@m@n outage aUtI2dZ outback $1 outcome $1 @@ -2796,6 +2800,7 @@ spinal spaIn@L spoonfed spu:nfEd squirrel skwIr@L staccato $alt3 +stasis steIsI#s standby standbaI stagnate $2 ?3 stalagmite $alt3 @@ -2894,7 +2899,7 @@ testes tEsti:z telephon tElI2foUn // for telephoning temperature tEmprI2tS3 ?!3 temporary tEmpr@rI -?3 template tEmpl@t +?3 template $alt2 tetanus tEt@n@s therefore $1 thereof De@r'0v @@ -3209,6 +3214,7 @@ Aires aIrIz Alamo al@moU Albuquerque alb@k3:ki Algiers $2 +Altura O:lt'U@r@ Amman a#m'A:n Andes andi:z Angeles andZ@li:s @@ -3394,6 +3400,7 @@ Montana m0nt'an@ Monte m0nt2i Munich mju:nIk Myanmar mjA:nmA@ +Niagara naI'agr@ Nairobi naIr'oUbi Naples neIp@Lz Nauru naUru: @@ -4016,7 +4023,7 @@ unto ,VntU upon @p0n $u2 from fr0m $u ?3 from frVm $u -(from the) fr,VmD@ +(from the) %frVmD@2 (from where) %frVm||w'e@ $pause (from which) %frVm||w'ItS $pause up ,Vp $strend2 diff --git a/dictsource/en_rules b/dictsource/en_rules index e96839b5..be8386e7 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -1117,7 +1117,6 @@ _s) ata (n eIt@ _g) ator eIt3 &) ate (_$w_alt2 @t - &) ately (_ @tli der) ated (_ eItI#d pal) ate (_ @t consul) ate (_ @t @@ -1214,6 +1213,7 @@ g) au (s aU ?!3 s) au (s 0 ?!3 au (str 0 + au (sch aU au (_ aU _) auch %O:x aud (_ 'O:d @@ -1641,10 +1641,11 @@ _) co (nw k0 _) copy k0pI _) copoly k'oUp,0lI +?!3 _) co (rL03 k0# coro (ll k0#r0 co (rrect k@ correspo k,0rIsp'0 - _) co (rri k0 + _) co (rr k0 co (rro k@ co (rrup k@ _) co (sm k0 @@ -3610,6 +3611,7 @@ l) ith (er ID _t) ith aID it (i_ 'i:t + _) it (iner %aIt itius (_ 'IS@s itis (_ 'aItIs &) it (ive_ =I2t @@ -3883,6 +3885,7 @@ &) name (_S4 neIm _) nano (P4 n,anoU nause nO:sI + _) navig navIg necessit n@sEsIt &) ness (_S4im n@s ?8 &) ness (_S4im nEs @@ -4983,7 +4986,7 @@ rEr (_ r3 C) rh r rheu ru: - rhi (n raI + rhi (n# raI rhi (z raI _) rho (d roU _) rhodo (@ roUd@ @@ -5385,6 +5388,7 @@ th (ill th ee) thing DI2N the (_ D + &) th (L03_ =T ou) thed (_ Dd th (en_ D g) th (en_ T @@ -5872,6 +5876,8 @@ %B) y (_S1d I _C) y (Ce aI C) y (i I + &C) y (an_ =I + &C) y (en_ =I y (iC_ j sf) y (_ aI Cf) y (_ %I diff --git a/dictsource/ml_list b/dictsource/ml_list index befaf6ea..4427306b 100644 --- a/dictsource/ml_list +++ b/dictsource/ml_list @@ -126,6 +126,8 @@ _9X t'on.n.u:t.t.i _0C0 n'u:r:y _0C nu:t.t.i +_1C0 orynu:ry +_1C orynu:t.t.i _2C0 iRynn'u:ry _2C irunnu:t.t.i _3C0 munn'u:ry @@ -164,6 +166,8 @@ _1Xf p'at _12f p'antran.t _13f p'atimu:v _14f p'atina:l +_15f patin'ai:j +_18f patin'enn _19f p'attomp'atin _20f 'iruvatin _2Xf 'iruvatt diff --git a/dictsource/pt_list b/dictsource/pt_list index 4cb3303c..1e44be77 100755 --- a/dictsource/pt_list +++ b/dictsource/pt_list @@ -340,7 +340,7 @@ elas $u+ $verbf me $u $verbf // reflexive te $u $verbf nos $u $nounf -vos vus $u +vos $u la $u lo lU $u las $u @@ -1060,6 +1060,7 @@ proveta $alt2 quarteto $alt2 queda $alt quede $alt2 +quimera $alt quitinete $alt quinteto $alt2 ramalhete $alt2 @@ -1069,7 +1070,8 @@ reconstroem $alt recordo $alt recorto $alt rede $alt2 -reembolso $alt $verb +reembolso $alt2 +reembolso $alt $verb reforço $alt $verb reforços $alt refresco $alt $verb @@ -1111,6 +1113,7 @@ sinopse $alt soco $alt2 soco $alt $verb sogra $alt +sopa $alt2 sopro $alt2 $noun soro $alt2 sorvete $alt2 diff --git a/dictsource/pt_rules b/dictsource/pt_rules index dd8c2569..e0abc3f0 100755 --- a/dictsource/pt_rules +++ b/dictsource/pt_rules @@ -210,7 +210,6 @@ ib) e (rL04_ E d) e (rL04_ E ed) e (rL04_ e - m) e (rL04_ E iv) e (rL04_ E pod) e (rA_ e @@ -343,13 +342,14 @@ êCC) e (C@ e ôC) e (C@ e áC) e (C@ e - áCC) e (C@ e + áCC) e (CA_ e + éCC) e (CA_ e éCCC) e (C@ e íC) el (_ eU íC) e (C@ e íCC) e (C@ e óC) e (C@ e - óCC) e (C@ e + óCC) e (CA_ e úC) e (C@ e úC) el (_ eU ection (_ 'EkS&~N @@ -427,6 +427,7 @@ _enver) e (dL03_ E ad) e (quL04_ E _dig) e (rL02_ E _ing) e (rL02_ E + _m) e (rL03_ E _sev) e (rL03_ E _reit) e (rL03_ E _sinc) e (rL03_ E @@ -438,6 +439,8 @@ _enver) e (dL03_ E gen) e (rL04_ E // de- re- _alt) e (rL04_ E _enc) e (rL04_ E + _esm) e (rL04_ E + _esm) e (rL04_ E _imp) e (rL04_ E _min) e (rL04_ E _sug) e (rL04_ E @@ -448,9 +451,11 @@ _enver) e (dL03_ E eson) e (rL04_ E _apod) e (rL04_ E _coop) e (rL04_ E + _enum) e (rL04_ E _exub) e (rL04_ E _temp) e (rL04_ E _adult) e (rL04_ E +_aglom) e (rL04_ E _dilac) e (rL04_ E _encarc) e (rL04_ E _incin) e (rL04_ E @@ -512,7 +517,6 @@ _entorp) e (çL03_ e //endsort - .group é é ''E éi ''EI @@ -727,6 +731,9 @@ _entorp) e (çL03_ e ?2 _) os (_ Us ?2 _) os (_A Uz ?2 _) os (_G Uz +?2 _v) os (_ us +?2 _v) os (_A uz +?2 _v) os (_G uz ou ow oi oI oi ($w_alt OI @@ -825,6 +832,7 @@ _entorp) e (çL03_ e v) o (re_ o b) o (rL04_ O o (p_ O + C) o (pL04_ O ?1 _) o (C O // eg: olá, orla, opção, etc... ?1 _C) o (CACAC u // Documento, documentação, localizar, etc. ?1 f) o (rmat u // formatar, formato. @@ -862,6 +870,7 @@ _pormen) o (L05_ O _engl) o (bL04_ O _sal) o (brL03_ o _) o (cL03_ o + _barr) o (cL03_ o _m) o (fL01_ O _m) o (fL02_ O _af) o (fL04_ O @@ -874,13 +883,8 @@ _pormen) o (L05_ O _emp) o (lgL04_ O _) o (lhL04_ O m) o (lhL04_ O - emb) o (lsL02_ O + emb) o (lsL04_ O _env) o (ltL03_ o - ent) o (pL02_ O - _c) o (pL03_ O - _t) o (pL04_ O - _ens) o (pL04_ O - _gal) o (pL04_ O _s) o (prL04_ O _al) o (prL04_ O _ass) o (prL04_ O diff --git a/dictsource/sl_list b/dictsource/sl_list index 0f79b20c..4d9c5522 100755 --- a/dictsource/sl_list +++ b/dictsource/sl_list @@ -206,6 +206,15 @@ bom bo+m $u // example of unstressed [o] skozi sko+zi $u+ za $u+ +le lE + + +// conjunctions +če tSE $u +ker kER +ter tER $u+ +vseeno us'E:Eno + // verb: to be sem s@m $u diff --git a/dictsource/sl_rules b/dictsource/sl_rules index 8c5de2fe..35e39572 100755 --- a/dictsource/sl_rules +++ b/dictsource/sl_rules @@ -38,8 +38,12 @@ .group e e e: e (X$w_alt3+ 'E - ee i: + ee i: + _n) ee E:E + _r) ee E:E + _pr) ee E:E + e (X$w_alt4 @ @) e (n_ E# @C) e (r_ E# @@ -119,7 +123,8 @@ o (č_ 'o: o (j_ 'o: o (l_ 'o: - oo u: + o (oč o: + .group p p p diff --git a/phsource/ph_slovenian b/phsource/ph_slovenian index 1b02a83a..a34538a5 100644 --- a/phsource/ph_slovenian +++ b/phsource/ph_slovenian @@ -119,7 +119,9 @@ phoneme k Vowelout f1=0 f2=2300 200 300 f3=-200 80 rms=20 ENDIF - IF nextPh(isPause2) AND prevPhW(isVowel) THEN + IF thisPh(isWordEnd) THEN + WAV(ustop/k) + ELIF nextPh(isPause2) THEN WAV(ustop/k_) ELIF nextPh(r) OR nextPh(R) OR nextPh(R2) THEN WAV(ustop/kr) diff --git a/src/dictionary.cpp b/src/dictionary.cpp index cf33a6f3..87ef77b0 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -526,6 +526,10 @@ unsigned short ipa1[96] = { 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x303,0x7f }; +#define N_PHON_OUT 500 +static char *phon_out_buf = NULL; +static int phon_out_size = 0; + char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int use_ipa, int *flags) {//=================================================================================================== @@ -629,8 +633,8 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int -void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int phoneme_mode) -{//=============================================================================== +const char *GetTranslatedPhonemeString(int phoneme_mode) +{//======================================================= /* Called after a clause has been translated into phonemes, in order to display the clause in phoneme mnemonic form. @@ -640,7 +644,6 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int phoneme_mode int ix; unsigned int len; - unsigned int max_len; int phon_out_ix=0; int stress; int c; @@ -668,108 +671,107 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int phoneme_mode use_tie = 0; } - if(phon_out != NULL) + for(ix=1; ix<(n_phoneme_list-2); ix++) { - for(ix=1; ix<(n_phoneme_list-2); ix++) + buf = phon_buf; + + plist = &phoneme_list[ix]; + + WritePhMnemonic(phon_buf2, plist->ph, plist, use_ipa, &flags); + if(plist->newword) + *buf++ = ' '; + else { - buf = phon_buf; - - plist = &phoneme_list[ix]; - - WritePhMnemonic(phon_buf2, plist->ph, plist, use_ipa, &flags); - if(plist->newword) - *buf++ = ' '; - else + if((separate_phonemes != 0) && (ix > 1)) { - if((separate_phonemes != 0) && (ix > 1)) + utf8_in(&c, phon_buf2); + if((c < 0x2b0) || (c > 0x36f)) // not if the phoneme starts with a superscript letter { - utf8_in(&c, phon_buf2); - if((c < 0x2b0) || (c > 0x36f)) // not if the phoneme starts with a superscript letter - { - *buf++ = separate_phonemes; - } + *buf++ = separate_phonemes; } } - - if(plist->synthflags & SFLAG_SYLLABLE) - { - if((stress = plist->stresslevel) > 1) - { - c = 0; - if(stress > 5) stress = 5; - - if(use_ipa) - { - c = 0x2cc; // ipa, secondary stress - if(stress > 3) - c = 0x02c8; // ipa, primary stress - } - else - { - c = stress_chars[stress]; - } - - if(c != 0) - { - buf += utf8_out(c, buf); -// if(separate_phonemes) -// *buf++ = separate_phonemes; - } - } - } - - flags = 0; - count = 0; - for(p=phon_buf2; *p != 0;) - { - p += utf8_in(&c, p); - if(use_tie > 0) - { - // look for non-inital alphabetic character, but not diacritic, superscript etc. - if((count>0) && !(flags & (1 << (count-1))) && ((c < 0x2b0) || (c > 0x36f)) && iswalpha2(c)) - { - buf += utf8_out(char_tie[use_tie-1], buf); - } - } - buf += utf8_out(c, buf); - count++; - } - - if(plist->ph->code != phonSWITCH) - { - if(plist->synthflags & SFLAG_LENGTHEN) - { - buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], NULL, use_ipa, NULL); - } - if((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) - { - // syllablic consonant - buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], NULL, use_ipa, NULL); - } - if(plist->tone_ph > 0) - { - buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], NULL, use_ipa, NULL); - } - } - - len = buf - phon_buf; - max_len = (n_phon_out - phon_out_ix - 5); // allow for " ..." and zero byte terminator - if(len > max_len) - { - strcpy(&phon_buf[max_len], " ..."); - len = max_len + 4; - } - phon_buf[len] = 0; - strcpy(&phon_out[phon_out_ix], phon_buf); - phon_out_ix += len; - - if(len > max_len) - { - break; - } } - phon_out[phon_out_ix] = 0; + + if(plist->synthflags & SFLAG_SYLLABLE) + { + if((stress = plist->stresslevel) > 1) + { + c = 0; + if(stress > 5) stress = 5; + + if(use_ipa) + { + c = 0x2cc; // ipa, secondary stress + if(stress > 3) + c = 0x02c8; // ipa, primary stress + } + else + { + c = stress_chars[stress]; + } + + if(c != 0) + { + buf += utf8_out(c, buf); +// if(separate_phonemes) +// *buf++ = separate_phonemes; + } + } + } + + flags = 0; + count = 0; + for(p=phon_buf2; *p != 0;) + { + p += utf8_in(&c, p); + if(use_tie > 0) + { + // look for non-inital alphabetic character, but not diacritic, superscript etc. + if((count>0) && !(flags & (1 << (count-1))) && ((c < 0x2b0) || (c > 0x36f)) && iswalpha2(c)) + { + buf += utf8_out(char_tie[use_tie-1], buf); + } + } + buf += utf8_out(c, buf); + count++; + } + + if(plist->ph->code != phonSWITCH) + { + if(plist->synthflags & SFLAG_LENGTHEN) + { + buf = WritePhMnemonic(buf, phoneme_tab[phonLENGTHEN], NULL, use_ipa, NULL); + } + if((plist->synthflags & SFLAG_SYLLABLE) && (plist->type != phVOWEL)) + { + // syllablic consonant + buf = WritePhMnemonic(buf, phoneme_tab[phonSYLLABIC], NULL, use_ipa, NULL); + } + if(plist->tone_ph > 0) + { + buf = WritePhMnemonic(buf, phoneme_tab[plist->tone_ph], NULL, use_ipa, NULL); + } + } + + len = buf - phon_buf; + if((phon_out_ix + len) >= phon_out_size) + { + // enlarge the phoneme buffer + phon_out_size = phon_out_ix + len + N_PHON_OUT; + if((phon_out_buf = (char *)realloc(phon_out_buf, phon_out_size)) == NULL) + { + phon_out_size = 0; + return(""); + } + } + + phon_buf[len] = 0; + strcpy(&phon_out_buf[phon_out_ix], phon_buf); + phon_out_ix += len; } + phon_out_buf[phon_out_ix] = 0; + + return(phon_out_buf); } // end of GetTranslatedPhonemeString diff --git a/src/numbers.cpp b/src/numbers.cpp index 485f2eb1..4e21ae2b 100644 --- a/src/numbers.cpp +++ b/src/numbers.cpp @@ -1831,17 +1831,24 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null } else { - if((!found) && (tensunits == 0)) + if((hundreds==1) && (tr->langopts.numbers2 & NUM2_OMIT_1_HUNDRED_ONLY) && ((control & 1)==0)) { - // is there a special pronunciation for exactly n00 ? - sprintf(string,"_%dC0",hundreds); - found = Lookup(tr, string, ph_digits); + // only look for special 100 if there are previous thousands } - - if(!found) + else { - sprintf(string,"_%dC",hundreds); - found = Lookup(tr, string, ph_digits); // is there a specific pronunciation for n-hundred ? + if((!found) && (tensunits == 0)) + { + // is there a special pronunciation for exactly n00 ? + sprintf(string,"_%dC0",hundreds); + found = Lookup(tr, string, ph_digits); + } + + if(!found) + { + sprintf(string,"_%dC",hundreds); + found = Lookup(tr, string, ph_digits); // is there a specific pronunciation for n-hundred ? + } } if(found) @@ -1855,9 +1862,6 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null { if((tr->langopts.numbers & NUM_OMIT_1_HUNDRED) != 0) say_one_hundred = 0; - - if(((tr->langopts.numbers2 & NUM2_OMIT_1_HUNDRED_ONLY) != 0) && ((control & 1)==0)) - say_one_hundred = 0; } if(say_one_hundred != 0) diff --git a/src/speak_lib.cpp b/src/speak_lib.cpp index c0d197c5..dfbbd687 100644 --- a/src/speak_lib.cpp +++ b/src/speak_lib.cpp @@ -1164,14 +1164,15 @@ ESPEAK_API void espeak_SetPhonemeTrace(int value, FILE *stream) } // end of espeak_SetPhonemes -ESPEAK_API void espeak_TextToPhonemes(const void *text, char *buffer, int size, int textmode, int phonememode) -{//============================================================================================================== +ESPEAK_API const char *espeak_TextToPhonemes(const void **textptr, int textmode, int phonememode) +{//================================================================================================= /* phoneme_mode bits 0-3: 0=only phoneme names, 1=ties, 2=ZWJ, 3=underscore separator bits 4-7: 0=eSpeak phoneme names, 1=IPA */ + option_multibyte = textmode & 7; - TranslateClause(translator, NULL, text, NULL, NULL); - GetTranslatedPhonemeString(buffer, size, phonememode); + *textptr = TranslateClause(translator, NULL, *textptr, NULL, NULL); + return(GetTranslatedPhonemeString(phonememode)); } diff --git a/src/speak_lib.h b/src/speak_lib.h index d39dba8c..a5b2604c 100644 --- a/src/speak_lib.h +++ b/src/speak_lib.h @@ -34,7 +34,7 @@ #define ESPEAK_API #endif -#define ESPEAK_API_REVISION 7 +#define ESPEAK_API_REVISION 9 /* Revision 2 Added parameter "options" to eSpeakInitialize() @@ -58,6 +58,9 @@ Revision 7 24.Dec.2011 Revision 8 26.Apr.2013 Added function espeak_TextToPhonemes(). +Revision 9 30.May.2013 + Changed function espeak_TextToPhonemes(). + */ /********************/ /* Initialization */ diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 9f3cc273..889c9641 100644 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.47.11b 28.May.13"; +const char *version_string = "1.47.11c 31.May.13"; const int version_phdata = 0x014709; int option_device_number = -1; diff --git a/src/synthesize.cpp b/src/synthesize.cpp index 7fec4d84..a2444fc1 100644 --- a/src/synthesize.cpp +++ b/src/synthesize.cpp @@ -1865,6 +1865,7 @@ int SpeakNextClause(FILE *f_in, const void *text_in, int control) char *voice_change; static FILE *f_text=NULL; static const void *p_text=NULL; + const char *phon_out; if(control == 4) { @@ -1957,14 +1958,14 @@ int SpeakNextClause(FILE *f_in, const void *text_in, int control) if(option_phonemes >= 3) phoneme_mode = 0x10 + option_phonemes-3; // 0x10=ipa, 0x11=ipa with tie, 0x12=ipa with ZWJ, 0x13=ipa with separators - GetTranslatedPhonemeString(translator->phon_out, sizeof(translator->phon_out), phoneme_mode); + phon_out = GetTranslatedPhonemeString(phoneme_mode); if(option_phonemes > 0) { - fprintf(f_trans,"%s\n",translator->phon_out); + fprintf(f_trans,"%s\n",phon_out); } if(phoneme_callback != NULL) { - phoneme_callback(translator->phon_out); + phoneme_callback(phon_out); } } diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 742ae2f9..3a718796 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -1484,7 +1484,7 @@ SetLengthMods(tr,3); // all equal if(name2 == L('m','l')) { tr->letter_bits_offset = OFFSET_MALAYALAM; - tr->langopts.numbers = NUM_OMIT_1_THOUSAND; + tr->langopts.numbers = NUM_OMIT_1_THOUSAND | NUM_OMIT_1_HUNDRED; tr->langopts.numbers2 = NUM2_OMIT_1_HUNDRED_ONLY; } else diff --git a/src/translate.cpp b/src/translate.cpp index 973592e7..b65d0ae9 100644 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -3041,7 +3041,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre c = ' '; pre_pause_add = 4; } - else if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) + else if((prev_out == ' ') && IsAlpha(prev_out2) && !IsAlpha(prev_in)) { // insert extra space between a word + space + hyphen, to distinguish 'a -2' from 'a-2' sbuf[ix++] = ' '; @@ -3139,7 +3139,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre decimal_sep_count = 1; } } - else if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) + else if((prev_out == ' ') && IsAlpha(prev_out2) && !IsAlpha(prev_in)) { // insert extra space between a word and a number, to distinguish 'a 2' from 'a2' sbuf[ix++] = ' '; diff --git a/src/translate.h b/src/translate.h index 4b9c8701..6172440d 100644 --- a/src/translate.h +++ b/src/translate.h @@ -581,7 +581,6 @@ typedef struct const char *transpose_map; char dictionary_name[40]; - char phon_out[500]; char phonemes_repeat[20]; int phonemes_repeat_count; int phoneme_tab_ix; @@ -723,7 +722,7 @@ int iswlower2(int c); int iswupper2(int c); int towlower2(unsigned int c); int towupper2(unsigned int c); -void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int phoneme_mode); +const char *GetTranslatedPhonemeString(int phoneme_mode); const char *WordToString2(unsigned int word); ALPHABET *AlphabetFromChar(int c); ALPHABET *AlphabetFromName(const char *name); diff --git a/src/transldlg.cpp b/src/transldlg.cpp index c75eda58..58c7507b 100644 --- a/src/transldlg.cpp +++ b/src/transldlg.cpp @@ -406,6 +406,7 @@ void TranslDlg::OnCommand(wxCommandEvent& event) int translate_text = 0; char buf[1000]; char phon_out[N_PH_LIST*2]; + const char *phon_out2; int clause_tone; int clause_count; int use_ipa = 0; @@ -495,11 +496,11 @@ void TranslDlg::OnCommand(wxCommandEvent& event) CalcPitches(translator,clause_tone); CalcLengths(translator); - GetTranslatedPhonemeString(translator->phon_out, sizeof(translator->phon_out), use_ipa); + phon_out2 = GetTranslatedPhonemeString(use_ipa); if(clause_count++ > 0) strcat(phon_out," ||"); - strcat(phon_out,translator->phon_out); - t_phonetic->SetValue(wxString(translator->phon_out,wxConvUTF8)); + strcat(phon_out, phon_out2); + t_phonetic->SetValue(wxString(phon_out2, wxConvUTF8)); if((n_ph_list + n_phoneme_list) >= N_PH_LIST) {