From 1ef2aa60917d695cf315c2f093ef14deef789daa Mon Sep 17 00:00:00 2001 From: jonsd Date: Mon, 12 Oct 2009 16:38:17 +0000 Subject: [PATCH] [1.41.15] Fixes to: announce punctuation ( --punct option) git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@227 d46cf337-b52f-0410-862d-fd96e6ae7743 --- dictsource/dict_phonemes | 11 ++- dictsource/en_list | 7 +- dictsource/fr_list | 4 +- dictsource/fr_rules | 4 +- dictsource/hu_list | 5 +- dictsource/hu_rules | 42 +++++++++- dictsource/ta_list | 70 ++++++++++++++++- dictsource/ta_rules | 45 ++++++++++- phsource/compile_report | 25 +++--- phsource/ph_french | 22 +++--- phsource/ph_hindi | 2 +- phsource/phonemes | 3 + phsource/vnasal/aa_n4 | Bin 0 -> 1575 bytes phsource/vnasal/i_n2 | Bin 0 -> 6753 bytes phsource/vnasal/ii_n | Bin 0 -> 1268 bytes phsource/vowel/V_6 | Bin 6239 -> 6239 bytes phsource/vwl_fr/w_a | Bin 6873 -> 4801 bytes src/compiledict.cpp | 5 +- src/dictionary.cpp | 9 ++- src/extras.cpp | 15 +--- src/numbers.cpp | 31 ++++---- src/readclause.cpp | 161 ++++++++++++++++++++++++++------------- src/synthdata.cpp | 2 +- src/synthesize.cpp | 2 +- src/tr_languages.cpp | 7 ++ src/translate.cpp | 21 ++++- src/translate.h | 2 +- 27 files changed, 365 insertions(+), 130 deletions(-) create mode 100755 phsource/vnasal/aa_n4 create mode 100644 phsource/vnasal/i_n2 create mode 100644 phsource/vnasal/ii_n diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index 8af3a6ef..b33a6eaf 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -595,11 +595,18 @@ t tS v w x z Dictionary pa_dict @ a a~ e E e~ E~ i -I i: i~ I~ o O o: O~ -o~ r- U u u~ U~ V V~ +I i~ I~ o O O~ o~ r- +U u u~ U~ V V~ : ; b bh c ch d d. dh dh. f g gh H j J Jh k kh l l. m n N n. n^ p ph Q R s S t t. th th. v x z + + +Dictionary prs_dict + +@ A i o + +b d h l t X diff --git a/dictsource/en_list b/dictsource/en_list index b9e3f5ba..4bb75ae0 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -262,8 +262,8 @@ U+32f n,0nsI2l'abI2k // numeric -_0 zero $text // TEST -//_0 z'i@roU +//_0 zero $text // TEST +_0 z'i@roU _1 w'0n ?6 _1 w'Vn _2 t'u: @@ -1582,12 +1582,13 @@ offers 0f3z ogre oUg3 okay oUk'eI oled oUlEd // abbrev -omeg oUm'eIg@ +omega oUm'eIg@ omelet 0ml@t omelette 0ml@t omnibus $1 omniscience 0mn'IsI@ns opaque oUp'eIk +oped 0p'Ed opine oUp'aIn opossum @p0s@m opponent @poUn@nt diff --git a/dictsource/fr_list b/dictsource/fr_list index a500bfe6..2aae64ed 100755 --- a/dictsource/fr_list +++ b/dictsource/fr_list @@ -24,7 +24,7 @@ // 2006-11-18 Gilles Casse // -// Updated 2009-09-28 Michel Such +// Updated 2009-10-09 Michel Such // // * Numbers, a few abbreviations and exceptions. // @@ -864,11 +864,13 @@ vincent vE~sA~ afrikaans afrikans bahamas baamas bangladesh bA~gladES +bayeux bajY bélarus belarys belize beliz bissau bisa'o (burkina faso) byrkina||faso burundi burundi +calvados calvadoss $text croatie kroasi esperanto E2sperA~to groenland groEnlA~d diff --git a/dictsource/fr_rules b/dictsource/fr_rules index 396e4e35..67c28379 100755 --- a/dictsource/fr_rules +++ b/dictsource/fr_rules @@ -23,7 +23,7 @@ // 2006-11-18 Gilles Casse // -// Updated: 2009-09-25 Michel Such +// Updated: 2009-10-09 Michel Such // // Letter classes: @@ -300,6 +300,7 @@ _) en (A A~n // enivrer ol) en (t_ A~ // somnolent, violent Vol) en (t_ // somnolent, violent Xol) ent (_ t2 // volent + eul) ent (_ t2 // veulent ul) en (t_ A~ // turbulent Vul) en (t_ imCoC) en (t_ A~ // impotent @@ -878,6 +879,7 @@ C) i (es_ i _) n (_° nymero _) neuro (@@P5 nYro + _) nvda (P4 Envedea .group o diff --git a/dictsource/hu_list b/dictsource/hu_list index ba45115f..7dc4f3b6 100755 --- a/dictsource/hu_list +++ b/dictsource/hu_list @@ -49,7 +49,8 @@ _0Z1 tizEd // tenths _0Z2 sa:zAd // hundredths _0Z3 EzR2Ed _0Z4 ti:zEzR2Ed - +_0Z5 sa:zEzR2Ed +_0Z6 miliomod // ordinal numbers @@ -90,6 +91,8 @@ szeptember $alt október $alt november $alt december $alt + + //The following 12 row contains shorter hungarian month names jan $alt feb $alt diff --git a/dictsource/hu_rules b/dictsource/hu_rules index 7f8643e2..0375ce72 100644 --- a/dictsource/hu_rules +++ b/dictsource/hu_rules @@ -16,12 +16,15 @@ _) alattvaló _!'AlAtvAlo: .group á á a: - + @) ában (_S4 a:bAn + @) ának (_S4 a:nAk .group b b b bb b: + @) ban (_S3 bAn + @) ben (_S3 bEn biz (A b'iz, // bizalmas etc. biedermeier bi:dER2ma:jER2 @@ -75,14 +78,20 @@ pá) c (só ts dd d: dts tS: dt t: +apró) d (sz d a) dsz ts: +beszé) d (szin d cselé) d d enge) dsz ts: engedelmeske) dsz ts: +fogó) dz (kod ts hazu) dsz ts: +ha) d (járat d +hor) d (szék d mara) dsz ts: tu) dsz ts: kére) dz ts +mentegető) dz z // dd d: dz dz A) dz (A d:z @@ -105,11 +114,14 @@ min) dny n^ .group e e E + D_-_) es (_ %ES _) egyezség _!'EJ:ESSe:g .group é é e: éi (é e::i: + @) ében (_S4 e:bEn + @) ének (_S4 e:nEk .group ë ë Y @@ -131,11 +143,14 @@ gg g: C) gyj J A) gyj (A J: ha) gyj J: - _e) gy (es J: +e) gy (jelentésű J +_e) gy (es J: _e) gy (et_ J: _e) gy (etlen J: _e) gy (ik J: _e) gy (üt J: +e) gyj (elentésű Jj +gyön) gy (sor J _minde) gy (ik J: na) gysz (a Js @@ -155,17 +170,25 @@ le) g (gy g .group i i i + @) i (_S1 i + _) itthon ithon .group í í i: íts i:tS: +fesz) ítsd i:tSd +bizony) ítsd i:tSd .group j j j + @) jában (_S5 ja:bAn + @) jának (_S5 ja:nAk + _) javíts jAvi:tS: _) javítsd jAvi:tSd + .group k k k kk k: @@ -271,6 +294,7 @@ szts stS: föld) s (ánc S s (színű S hel) s (inki z + ki) s (ebb SS _má) s (szó S _munká) s S @@ -313,12 +337,18 @@ ttn t:n tty c: apá) ts (ág tS: becsüle) t t +csalódo) tts (ág tS: cson) t t cson) tj c ezüs) t t éle) t t felej) ts tS + +gyapo) t t + +gráni) t t + já) tsz (ani ts: tsz ts: szorí) ts (a tS: @@ -350,6 +380,8 @@ vörösmar) ty ti á) t (sző t á) t (szú t á) t (szű t +á) t (jut t +á) t (jö t bizo) tts (ág tS: állí) ts tS: állapo) t (sor t @@ -361,12 +393,17 @@ kiál) ts tS köve) ts (ég tS: kür) t t kür) tj c +küldö) ttj c: korlátozo) tts tS: neve) ts (ég tS: on) ts (u tS +o) tt t: szen)t (szék t szé) t t szöve) ts (ég tS: +söté) ts (ég tS: +sajá) ts (ág tS: + pillan) ts tS romlo) tts tS: tar) ts tS @@ -433,6 +470,7 @@ csontvá) z z e) z (t s ho) z (ta s ho) z (tá s +helye) z (ked s inté) z (ked s költö) z (köd s diff --git a/dictsource/ta_list b/dictsource/ta_list index 00fb65b0..1ba926aa 100644 --- a/dictsource/ta_list +++ b/dictsource/ta_list @@ -1,4 +1,3 @@ -//_xx விழுக்காடு $text // TESTING doesn't reduce vowels // This file is UTF8 encoded // Spelling to phoneme words and exceptions for Tamil @@ -157,6 +156,73 @@ _1M4 a:jirVmko:d.ie: _0M5 a:jirVma:jirVmko:d.i // 10,000,000,000,000 _1M5 a:jirVma:jirVmko:d.i - _dpt _pul.l.i + + +// exceptions +பாபு $alt // initial ப as [b] +பாலு $alt +பவானி $alt +பகவதி $alt +பானம் $alt +பாறம் $alt +பாரதி $alt +பாரதம் $alt +பரதம் $alt +பாப $alt +பாகம் $alt +பண்தம் $alt +பவனி $alt + +தானம் $alt // initial த as [d] +தேகம் $alt +திரவியம் $alt +தூபம் $alt +தீபம் $alt +தீபாவளி $alt +தீரம் $alt +தைரியம் $alt +திடம் $alt +திரவம் $alt +திடீர் $alt +திவசம் $alt +தியானம் $alt +தானியம் $alt +தண்டனை $alt +துவம்சம் $alt +திருஷ்டி $alt +தயாநிதி $alt +தயாளு $alt +துக்கம் $alt +திகில் $alt +துந்துவி $alt +தயவு $alt +தடால் $alt +திக் $alt +தடக் $alt +தீக்ஷை $alt + + + +கக $alt // initial க as [g] +கனம் $alt +கணம் $alt +கணபதி $alt +கணீர் $alt +கிலி $alt +கில்லி $alt +கோதுமை $alt +கோபுரம் $alt +காந்தம் $alt +காந்தி $alt +குண்டு $alt +கோலி $alt +குகை $alt +கிரி $alt +கோமதி $alt + + + + +பப pVpV diff --git a/dictsource/ta_rules b/dictsource/ta_rules index dfbe07bd..1c8d744d 100644 --- a/dictsource/ta_rules +++ b/dictsource/ta_rules @@ -43,7 +43,7 @@ _) எ ;e // add a short [j] sound at start of word ? ஏ e: - _) ஏ ;e:: // add a short [j] sound at start of word ? + _) ஏ ;e: // add a short [j] sound at start of word ? ஐ aI @@ -62,12 +62,22 @@ ்) க (B g _) க kV _) க (B k + _) க (T gV // if word has $alt attribute in ta_list + _) க (BT g // $alt க்க kkV க்க (B kk + _) க (ௌ g + க (ீத g + க (ஜ gV + + _) க (ம்பீர gV + _) க (ந்தர்வ gV + _) க (ோவிந்த g ங NV ங (B N + ச sV // ?? [z] ச (B s _) ச sa @@ -81,12 +91,15 @@ ஞ்) ச dZV ஞ்) ச (B dZ + ஜ dZV ஜ (B dZ + ஞ n^V ஞ (B n^ + ட d.V ட (B d. _) ட t.V @@ -94,26 +107,43 @@ ட்ட t.t.V ட்ட (B t.t. + ண n.V ண (B n. + த dV த (B d _) த tV _) த (B t + _) த (T dV // if word has $alt attribute in ta_list + _) த (BT d // if word has $alt த்த ttV த்த (B tt + // exceptions, த as [d] + _) த (ன dV + _) த (ர்ம dV + _) த (ுர் d + _) த (ூர d + _) த (ெய்வ d + _) த (ுஷ் d + _) த (க்ஷிணா dV + ந nV ந (B n // dental n + ன nV ன (B n // alveolar n + ப bV ப (B b _) ப pV _) ப (B p + _) ப (T bV // if word has $alt attribute in ta_list + _) ப (BT b // if word has $alt ப்ப ppV ப்ப (B pp ட்) ப pV @@ -123,43 +153,56 @@ ஃ) ப fV ஃ) ப (B f + ம mV ம (B m + ய jV ய (B j + ர rV ர (B r + ற RV ற (B R ற் (ற t. // RR -> t.R + ல lV ல (B l + ள l.V ள (B l. + ழ z.V ழ (B z. + வ vV வ (B v + ஶ SV ஶ (B S + ஷ s.V ஷ (B s. + ஸ sV ஸ (B s + ஹ hV ஹ (B h + க்ஷ ks.V க்ஷ (B ks. diff --git a/phsource/compile_report b/phsource/compile_report index 85cdcb5c..086018ca 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -1,4 +1,4 @@ -61 phoneme tables +62 phoneme tables new total base 104 104 base2 26 125 @@ -61,6 +61,7 @@ eu 6 126 mn 15 115 pa 13 153 + prs 8 111 Data file Used by b/b [b] base @@ -833,7 +834,6 @@ ustop/kr [k] base [k] base2 [k] en [k] fi - [k] fr [kh] hi [k] hu [k] lv @@ -1185,6 +1185,7 @@ vdiph/aoo [aU] en_us vdiph/au [aU] en [aU] af [a:U] vi + [aU] prs vdiph/au# [aU] en_sc vdiph/au_2 [au] zhy vdiph/au_3 [aU] en_rp @@ -1204,6 +1205,7 @@ vdiph/eei [EI] base2 [EI] vi [eI] hy [eI] ne + [eI] prs vdiph/eei_2 [eI] eo [ei] fi [ei] lv @@ -1339,11 +1341,11 @@ vnasal/e_n [e~] af [e~] hi [e~] pt [e~] bn +vnasal/ii_n [I~] hi vnasal/i_n [i~] pt [i~] bn [i:~] bn -vnasal/i_n2 [I~] hi - [i~] hi +vnasal/i_n2 [i~] hi vnasal/m- [m-] sw vnasal/n- [n-] sw vnasal/nn- [N-] sw @@ -1629,6 +1631,7 @@ vowel/aa_2 [A:] en [A] zh vowel/aa_3 [A:] af [A] sq + [A] prs vowel/aa_4 [A:] sv [O] vi vowel/aa_5 [A:] en_n @@ -1755,6 +1758,7 @@ vowel/e_mid [E] en_rp [E2] id [e] hy [E] bn + [E] prs vowel/e_mid2 [E] af [E] de [E2] de @@ -1803,6 +1807,7 @@ vowel/i [i] base2 [i:] kn [i] ne [i] mn + [i] prs vowel/i# [y:] cy vowel/i_2 [i2] de [i:] de @@ -1925,6 +1930,7 @@ vowel/o [o] base2 [oU] en_n [oU] en_wi [o:] de + [o2] fr [o] hi [o] ta [o] it @@ -1945,8 +1951,8 @@ vowel/o [o] base2 [o] bn [o] mr [o:] mn + [o:] pa vowel/o_2 [o:] cy - [o2] fr [o:] hi [o:] hu [o:] la @@ -1954,11 +1960,9 @@ vowel/o_2 [o:] cy [o] vi [o] da [o:] bn - [o:] pa vowel/o-_2 [V] en_n [V] en_wm vowel/o_3 [oU] en_sc - [o] fr [o:] ta vowel/o-_3 [U] en_rp vowel/o-_4 [o] ro @@ -1966,6 +1970,7 @@ vowel/o_5 [O] nl [O] da vowel/o_6 [O:] nl vowel/o_7 [o] ku +vowel/o_8 [o] fr vowel/oe [W] en [W] af [W] de @@ -1996,6 +2001,7 @@ vowel/oo [O:] en_sc [o] zhy [O] tr [O] id + [o] prs vowel/oo_1 [O:] en_n [O:] en_rp [O@] en_rp @@ -2064,6 +2070,7 @@ vowel/u [u:] en_wi [u] kn [u:] kn [u] bn + [u] prs vowel/u# [u:] en_sc [Y] tr vowel/u_2 [u1] fi @@ -2250,8 +2257,7 @@ vwl_en_us/oor [0] en_us vwl_en_us/or [o@] en_us [O:] en_sc vwl_en_us/ur [U@] en_us -vwl_fr/r [R] fr - [r] fr +vwl_fr/r [r] fr [r2] fr vwl_fr/_r [R] fr [r] fr @@ -2265,6 +2271,7 @@ vwl_fr/r@ [@] fr [E~] fr [W~] fr vwl_fr/@R [x] pt_pt +vwl_fr/_r2 [R] fr vwl_fr/@R2 [R] fr_ca vwl_fr/@R3 [Q2] hy vwl_fr/@R4 [Q2] hy diff --git a/phsource/ph_french b/phsource/ph_french index cd635034..a6231f27 100644 --- a/phsource/ph_french +++ b/phsource/ph_french @@ -1,7 +1,7 @@ //==================================================== // French //==================================================== -// Updated 2009-09-30 Michel Such +// Updated 2009-10-07 Michel Such phoneme (l) virtual // Used for l and l/ @@ -96,7 +96,7 @@ endphoneme phoneme i- // shorter vowel starttype (i) endtype (i) - length 130 + length 110 formants vowel/i_2 after (l) l/li-15 after (r) vwl_fr/ri @@ -119,7 +119,7 @@ endphoneme phoneme o vowel starttype (o) endtype (o) length 170 - formants vowel/o_3 + formants vowel/o_8 after (l) l/lo-10 after (r) vwl_fr/ro before l/ DFT+l/l_o @@ -132,7 +132,7 @@ endphoneme phoneme o2 vowel starttype (o) endtype (o) length 170 - formants vowel/o_2 + formants vowel/o after (l) l/lo-10 after (r) vwl_fr/ro before l/ vowel/o_mid2+l/l_o @@ -237,10 +237,10 @@ endphoneme phoneme wA vowel starttype (o) endtype (a) - length 230 + length 220 formants vwl_fr/w_a after (l) l/lo-10 - after (r) vwl_fr/ro-15 + after (r) vwl_fr/ro before l/ DFT-10+l/l_a before j DFT before (r) DFT+vwl_fr/xr @@ -394,7 +394,7 @@ phoneme k lengthmod 2 wave ustop/k%40 // reduce strength of noise burst before _ ustop/k_ - before (r) ustop/kr%45 + before (r) ustop/k%50 before r/2 ustop/k%60 before (l) ustop/kl%45 before (i) ustop/ki%45 @@ -465,7 +465,7 @@ endphoneme phoneme r // between vowels in a word liquid uvl starttype (r) endtype (r) - vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelin f1=0 f2=1600 -300 300 f3=-200 80 len=20 vowelout f1=2 f2=1600 -300 300 f3=-300 80 length 100 lengthmod 7 @@ -481,12 +481,12 @@ endphoneme phoneme R // First letter of a word liquid uvl starttype (r) endtype (r) - vowelin f1=0 f2=1600 -300 300 f3=-200 80 + vowelin f1=0 f2=1600 -300 300 f3=-200 80 len=20 vowelout f1=2 f2=1600 -300 300 f3=-300 80 length 100 lengthmod 0 beforenotvowel r/2 - formants vwl_fr/r + formants vwl_fr/_r2 after _ vwl_fr/_r after (a) vwl_fr/_r after (e) vwl_fr/_r @@ -513,7 +513,7 @@ endphoneme phoneme r/2 // variant of [r] when not preceding a vowel liquid uvl starttype r/2 endtype r/2 - vowelout f1=2 f2=1600 -300 300 f3=-300 80 + vowelout f1=2 f2=1600 -300 300 f3=-300 100 length 100 lengthmod 2 formants vwl_fr/r_+r3/rx%25 diff --git a/phsource/ph_hindi b/phsource/ph_hindi index a82565d1..5255d560 100644 --- a/phsource/ph_hindi +++ b/phsource/ph_hindi @@ -169,7 +169,7 @@ endphoneme phoneme I~ vowel starttype (i) endtype (i) length 170 - formants vnasal/i_n2 + formants vnasal/ii_n endphoneme phoneme e~ diff --git a/phsource/phonemes b/phsource/phonemes index 3993da28..64bbb613 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -1382,3 +1382,6 @@ include ph_mongolian phonemetable pa hi include ph_punjabi + +phonemetable prs base +include ph_dari diff --git a/phsource/vnasal/aa_n4 b/phsource/vnasal/aa_n4 new file mode 100755 index 0000000000000000000000000000000000000000..8d38cfc99749b5dac5a3f810bec30d81a4a9c2b6 GIT binary patch literal 1575 zcmeH{PiqrV6vcmunI>ueIhizxX^gaKYms7GQEB}*gE3Yxg_g7kRgj>#5D}p+^b@$~ zLO()8KZGt65kUpPk6@SGxOG!YJ?{;*u{&M3>RjIC-1F|t@DA_X_Cm9<)NU?1K&Nx_ z{z-=w!QLluzIVeqh<)7Nv~ZW3Q+*}ej*#4lzKodSK@|5!^jXy4cL#7cB2|ln6!G=Q zy6u@tlMV4?VkApqhtE}m=nj5V<2N3!k6Ap+91WIPH?d8b_Jt zDjnL)v&1#wQ=CzpW|Tt|6$9iba8RgVu}c=0j3S9cLb;!~mdSmj)m@~dj;v6Il#Psb z{mm~Q?wVr~INt&b2x6bG$L---Vs2~u$2R}06a0-%HD+|;%RJ<{)>l4rNlHy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ff --git a/phsource/vnasal/ii_n b/phsource/vnasal/ii_n new file mode 100644 index 0000000000000000000000000000000000000000..17a497ee0bede079babdc77375cf40866a0afb04 GIT binary patch literal 1268 zcmdUuO=}ZT6o#J(lgURjOd2O8wKf)`u}ZO|)DOhafwmxsA(B=~73)GI6%}0wUCuvn z>oN;}gbNWt5Em{5xA_55T#FFjxie$4=%!ui9PYjEdGE(?AMWXO*H<@s>vwEmcX#Kx z&5qRg7i7PMaUR%Tl8FPaE9aJR-w~F=OgqlzXmCmHbvD_e#!0Ho zae*szlrOSCQ~ETM_BmMe{Bm6{a|)bEc(SeC?m%qWS-f+`7*9 zD4UfoE5E+JccP0EWWNuLAh3VNV$AE1;gQ_^(ecUcABkL>yS(C)`1qXB9hzctj(N_D z*IBOdK>S)<<|?;&#uG7YXw8B+Zt#-6{I;?+wONty6=m_5RPQNVN=zt^>pn$p{(9aG4hJRpn delta 395 zcmca_aNl4CT`F`MV MF=jwr5a?$I0K%hZMgRZ+ diff --git a/phsource/vwl_fr/w_a b/phsource/vwl_fr/w_a index 84674423fd4e213d0307b8aa956b32c87b3b4cbd..2aea95bb4f348b80c8d010b31ffdeb1f8a5e0ba8 100755 GIT binary patch delta 316 zcmcab+6O65)>`oh7cgmWW*5K23;?LsO*H@j delta 2256 zcmX|?c~DeW7RFyUP50aG+k1bn7wCnZ25f`?(n6X=!HB4IqY(ucTvB0%sJK9j8%qX* zgEBfg#x+Kxs6%v6U_?tT+!BZrHHwNQV@X+x7ARu~IxU9O{p0-Zxwp3TAnut-b}?7c0iD{TNEPlrl2(4-r;N=PUk-{pLhUY)sWa_5u-Q?=7`b1Gc_c9Sz!&K&r(Ft2&`4|CS# zU(Y|6e>7iO5H&Y${*l64i%d)6mM9kY6$Z_ZE7&+YdDa&*2Xha(Yh1T;PUo<$nXYR& zP1CMs*)twHuQ<@e!;YHdXHGixPReIaEcspHKjO#5hDPu3L{&z#ha1COAl;(M zafYr-Q>HBD`sqAsB6Xfdxl+X?)mcq8UoN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%<5j8n_y6A(zAn z+#B{b+sy7}E7&5|%_gxyEXDRSoy;L-CF5jpri0!>yJ-XcnEKA^C>H9DSN=BgCb60@ z5*NXIAOX8@JAM_LgAJp*(M(i=wjmxQ9(e^Hgr~y4$qvY-$vD{y=?kesmMc3UBVf-0 z_!RsG4nuN~66CMQA*2nth4djZRFB%xG}MhQK#S2bv=XgDzeXF-R`fc07wtt~qrR91 zi^1}-?buz+jQ<&L#^2(xU@_PVn!wMX4@d|FVJ0HHP8CPQdZRx<5U;>3uY1*l67VTV z0a3sYu&{UL#NngAc^d1*utYW7^i%o!uNrbl>(_oYLTx^snVpTNqys*Z;gc()8yiqq PA{lN8>uNkh$Rz&data_dictlist != NULL) + { + Free(tr->data_dictlist); + tr->data_dictlist = NULL; + } + f = fopen(fname,"rb"); if((f == NULL) || (size <= 0)) { @@ -257,9 +263,6 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) return(1); } - if(tr->data_dictlist != NULL) - Free(tr->data_dictlist); - tr->data_dictlist = Alloc(size); fread(tr->data_dictlist,size,1,f); fclose(f); diff --git a/src/extras.cpp b/src/extras.cpp index 2d7ad6f2..451999f1 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -317,7 +317,6 @@ void Lexicon_It(int pass) char phonemes[80]; char phonemes2[80]; char buf_out[120]; - WORD_TAB winfo; static const char *vowels1 = "aeiou"; static const char *vowels2 = "aeou"; @@ -438,8 +437,7 @@ void Lexicon_It(int pass) } } // translate - memset(&winfo,0,sizeof(winfo)); - TranslateWord(translator,&word1[1],0,&winfo); + TranslateWord(translator,&word1[1],0, NULL); DecodePhonemes(word_phonemes,phonemes); stress_posn1 = 0; @@ -462,8 +460,7 @@ void Lexicon_It(int pass) vowel_ix++; } - memset(&winfo,0,sizeof(winfo)); - TranslateWord(translator,&word2[1],0,&winfo); + TranslateWord(translator,&word2[1],0, NULL); DecodePhonemes(word_phonemes,phonemes2); vowel_ix = 1; @@ -619,7 +616,6 @@ void Lexicon_De() char pronounce2[80]; char phonemes[80]; char phonemes2[80]; - WORD_TAB winfo; static const char *vowels = "aeiouyAEIOUY29@"; @@ -728,8 +724,7 @@ void Lexicon_De() } // translate - memset(&winfo,0,sizeof(winfo)); - TranslateWord(translator,&word2[1],0,&winfo); + TranslateWord(translator,&word2[1],0, NULL); DecodePhonemes2(word_phonemes,phonemes); // also need to change some phoneme names @@ -794,7 +789,6 @@ void Lexicon_Ru() int wlen; int len; int check_root; - WORD_TAB winfo; char word[80]; char word2[80]; @@ -933,8 +927,7 @@ p_unicode = unicode; } // translate - memset(&winfo,0,sizeof(winfo)); - TranslateWord(translator, &word2[1],0,&winfo); + TranslateWord(translator, &word2[1],0, NULL); DecodePhonemes(word_phonemes,phonemes); // find the stress position in the translation diff --git a/src/numbers.cpp b/src/numbers.cpp index 2b6e1b2f..ea25c166 100644 --- a/src/numbers.cpp +++ b/src/numbers.cpp @@ -1314,7 +1314,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned char ph_buf2[50]; char suffix[20]; char *wordptr; - unsigned int dictflags[2]; + unsigned int dictflags; static const char str_pause[2] = {phonPAUSE_NOLINK,0}; @@ -1331,14 +1331,12 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned // but not if the next word starts with an upper-case letter ordinal = 2; word[ix] = ' '; - if(tr->translator_name == L('h','u')) { // lang=hu don't treat dot as ordinal indicator if the next word is a month name ($alt) - dictflags[0] = 0; wordptr = &word[ix+2]; - LookupDictList(tr, &wordptr, ph_buf, dictflags, 0, NULL); - if(dictflags[0] & FLAG_ALT_TRANS) // TEST + dictflags = TranslateWord(tr, &word[ix+2], 0, NULL); + if(dictflags & FLAG_ALT_TRANS) ordinal = 0; } } @@ -1514,23 +1512,20 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned } break; - case NUM_DFRACTION_1: // italian, say "hundredths" is leading zero + case NUM_DFRACTION_1: // italian, say "hundredths" if leading zero case NUM_DFRACTION_5: // hungarian, always say "tenths" etc. - if(decimal_count <= 4) + LookupNum3(tr, atoi(&word[n_digits]), ph_buf, 0,0,0); + if((word[n_digits]=='0') || (decimal_mode == NUM_DFRACTION_5)) { - LookupNum3(tr, atoi(&word[n_digits]), ph_buf, 0,0,0); - if((word[n_digits]=='0') || (decimal_mode == 0xa000)) - { - // decimal part has leading zeros, so add a "hundredths" or "thousandths" suffix - sprintf(string,"_0Z%d",decimal_count); - if(Lookup(tr, string, buf1) == 0) - break; // revert to speaking single digits + // decimal part has leading zeros, so add a "hundredths" or "thousandths" suffix + sprintf(string,"_0Z%d",decimal_count); + if(Lookup(tr, string, buf1) == 0) + break; // revert to speaking single digits - strcat(ph_buf,buf1); - } - strcat(ph_out,ph_buf); - n_digits += decimal_count; + strcat(ph_buf,buf1); } + strcat(ph_out,ph_buf); + n_digits += decimal_count; break; case NUM_DFRACTION_3: diff --git a/src/readclause.cpp b/src/readclause.cpp index 397db63c..7d30883d 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -816,8 +816,8 @@ static int LoadSoundFile2(const char *fname) -static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bufix) -{//================================================================================= +static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output, int *bufix, int end_clause) +{//========================================================================================================== // announce punctuation names // c1: the punctuation character // c2: the following character @@ -826,12 +826,19 @@ static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bu const char *punctname; int found = 0; int soundicon; - char *p; + int c2; + int len; + int bufix1; + char buf[200]; + char buf2[80]; + + c2 = *c2_ptr; + buf[0] = 0; if((soundicon = LookupSoundicon(c1)) >= 0) { // add an embedded command to play the soundicon - sprintf(&buf[bufix],"\001%dI ",soundicon); + sprintf(buf,"\001%dI ",soundicon); UngetC(c2); found = 1; } @@ -839,7 +846,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bu if((punctname = LookupCharName(tr, c1)) != NULL) { found = 1; - if(bufix==0) + if((*bufix==0) || (end_clause==0)) { punct_count=1; while(c2 == c1) @@ -847,26 +854,32 @@ static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bu punct_count++; c2 = GetC(); } - UngetC(c2); + *c2_ptr = c2; + if(end_clause) + { + UngetC(c2); + } - p = &buf[bufix]; if(punct_count==1) { - sprintf(p,"%s %s %s",tone_punct_on,punctname,tone_punct_off); + sprintf(buf,"%s %s %s",tone_punct_on,punctname,tone_punct_off); } else if(punct_count < 4) { - sprintf(p,"\001+10S%s",tone_punct_on); + sprintf(buf,"\001+10S%s",tone_punct_on); while(punct_count-- > 0) - sprintf(buf,"%s %s",buf,punctname); - sprintf(p,"%s %s\001-10S",buf,tone_punct_off); + { + sprintf(buf2," %s",punctname); + strcat(buf, buf2); + } + sprintf(buf2," %s\001-10S",tone_punct_off); + strcat(buf, buf2); } else { - sprintf(p,"%s %s %d %s %s", + sprintf(buf,"%s %s %d %s %s", tone_punct_on,punctname,punct_count,punctname,tone_punct_off); - return(CLAUSE_COMMA); } } else @@ -879,17 +892,25 @@ static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bu ssml_ignore_l_angle = c1; // this was < which was converted to <, don't pick it up again as < } ungot_char2 = c1; - buf[bufix] = ' '; - buf[bufix+1] = 0; + buf[0] = ' '; + buf[1] = 0; } } if(found == 0) return(-1); + bufix1 = *bufix; + len = strlen(buf); + strcpy(&output[*bufix],buf); + *bufix += len; + + if(end_clause==0) + return(-1); + if(c1 == '-') return(CLAUSE_NONE); // no pause - if(bufix > 0) + if(bufix1 > 0) return(CLAUSE_SHORTCOMMA); if((strchr_w(punct_close,c1) != NULL) && !iswalnum(c2)) return(CLAUSE_SHORTFALL+4); @@ -1919,8 +1940,8 @@ int ReadClause(Translator *tr, FILE *f_in, char *buf, short *charix, int *charix int any_alnum = 0; int self_closing; int punct_data; - int is_punctuation; - int save_c2; + int is_end_clause; + int announced_punctuation; int stressed_word = 0; const char *p; wchar_t xml_buf[N_XML_BUF+1]; @@ -2304,35 +2325,48 @@ if(option_ssml) parag=1; linelength = 0; } - if(option_punctuation && (phoneme_mode==0) && (sayas_mode==0) && iswpunct(c1)) - { - // option is set to explicitly speak punctuation characters - // if a list of allowed punctuation has been set up, check whether the character is in it - if((option_punctuation == 1) || (wcschr(option_punctlist,c1) != NULL)) - { - if((terminator = AnnouncePunctuation(tr, c1, c2, buf, ix)) >= 0) - return(terminator); - } - } + announced_punctuation = 0; - if((phoneme_mode==0) && (sayas_mode==0) && ((punct = lookupwchar(punct_chars,c1)) != 0)) + if((phoneme_mode==0) && (sayas_mode==0)) { - punct_data = punct_attributes[punct]; + is_end_clause = 0; - if(punct_data & PUNCT_IN_WORD) + if((punct = lookupwchar(punct_chars,c1)) != 0) { - // Armenian punctuation inside a word - stressed_word = 1; - *tone_type = punct_data >> 12 & 0xf; // override the end-of-sentence type - continue; + punct_data = punct_attributes[punct]; + + if(punct_data & PUNCT_IN_WORD) + { + // Armenian punctuation inside a word + stressed_word = 1; + *tone_type = punct_data >> 12 & 0xf; // override the end-of-sentence type + continue; + } + + if((iswspace(c2) || (punct_data & 0x8000) || IsBracket(c2) || (c2=='?') || (c2=='-') || Eof())) + { + // note: (c2='?') is for when a smart-quote has been replaced by '?' + is_end_clause = 1; + } } - if((iswspace(c2) || (punct_data & 0x8000) || IsBracket(c2) || (c2=='?') || (c2=='-') || Eof())) + if(option_punctuation && iswpunct(c1)) { - // note: (c2='?') is for when a smart-quote has been replaced by '?' - - is_punctuation = 1; + // option is set to explicitly speak punctuation characters + // if a list of allowed punctuation has been set up, check whether the character is in it + if((option_punctuation == 1) || (wcschr(option_punctlist,c1) != NULL)) + { + if((terminator = AnnouncePunctuation(tr, c1, &c2, buf, &ix, is_end_clause)) >= 0) + return(terminator); + announced_punctuation = c1; + } + } + + if(is_end_clause) + { + int c_next; + if((c1 == '.') && (cprev == '.')) { c1 = 0x2026; @@ -2340,47 +2374,43 @@ if(option_ssml) parag=1; } nl_count = 0; - save_c2 = c2; + c_next = c2; - if(iswspace(c2)) + if(iswspace(c_next)) { - while(!Eof() && iswspace(c2)) + while(!Eof() && iswspace(c_next)) { - if(c2 == '\n') + if(c_next == '\n') nl_count++; - c2 = GetC(); // skip past space(s) - } - if(!Eof()) - { - UngetC(c2); + c_next = GetC(); // skip past space(s) } } if((nl_count==0) && (c1 == '.')) { -// if(iswdigit(cprev) && (tr->langopts.numbers & NUM_ORDINAL_DOT) && islower(c2)) if(iswdigit(cprev) && (tr->langopts.numbers & NUM_ORDINAL_DOT)) { // dot after a number indicates an ordinal number - is_punctuation = 0; + if(islower(c_next) || (c_next == '<')) + is_end_clause = 0; // only if followed by lower-case, (or if there is a XML tag) } else - if(iswlower(c2)) + if(iswlower(c_next)) { // next word has no capital letter, this dot is probably from an abbreviation c1 = ' '; - is_punctuation = 0; + is_end_clause = 0; } if(any_alnum==0) { c1 = ' '; // no letters or digits yet, so probably not a sentence terminator - is_punctuation = 0; + is_end_clause = 0; } } - c2 = save_c2; - if(is_punctuation) + if(is_end_clause) { + UngetC(c_next); buf[ix] = ' '; buf[ix+1] = 0; @@ -2393,12 +2423,33 @@ if(option_ssml) parag=1; } return(punct_data); // only recognise punctuation if followed by a blank or bracket/quote } + else + { + if(!Eof()) + { + if(iswspace(c2)) + UngetC(c_next); + } + } } } if(speech_parameters[espeakSILENCE]==1) continue; + if(c1 == announced_punctuation) + { +// const unsigned short keep_punctuation[] = { +// '\'', '-', 0x92, 0xb4, 0x2019, 0x2032, 0 }; + + // This character has already been announced, so delete it so that it isn't spoken a second time. + // Unless it's a hyphen or apostrophe (which is used by TranslateClause() ) + if(!IsBracket(c1)) + { + c1 = ' '; + } + } + j = ix+1; ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1; if(!iswspace(c1) && !IsBracket(c1)) diff --git a/src/synthdata.cpp b/src/synthdata.cpp index ea6e0f3f..ef6fb1f2 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.41.13 10.Oct.09"; +const char *version_string = "1.41.15 12.Oct.09"; const int version_phdata = 0x014100; int option_device_number = -1; diff --git a/src/synthesize.cpp b/src/synthesize.cpp index 3709d834..97c24c7d 100755 --- a/src/synthesize.cpp +++ b/src/synthesize.cpp @@ -535,7 +535,7 @@ static short vcolouring[N_VCOLOUR][5] = { // fprintf(stderr,"FMT%d %3s %3d-%3d f1=%d f2=%4d %4d %4d f3=%4d %3d\n", // which,WordToString(other_ph->mnemonic),len,rms,f1,f2,f2_min,f2_max,f3_adj,f3_amp); - if(other_ph->mnemonic == '?') + if((other_ph != NULL) && (other_ph->mnemonic == '?')) flags |= 8; if(which == 1) diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 23e22a2a..5f7c5c71 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -464,6 +464,13 @@ Translator *SelectTranslator(const char *name) break; + case L('f','a'): // Farsi + { + tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words + } + break; + + case L('f','i'): // Finnish { static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 }; diff --git a/src/translate.cpp b/src/translate.cpp index a94266bd..efbe581f 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -601,8 +601,9 @@ int TranslateWord(Translator *tr, char *word1, int next_pause, WORD_TAB *wtab) int spell_word; int stress_bits; int emphasize_allcaps = 0; - int wflags = wtab->flags; - int wmark = wtab->wmark; + int wflags; + int wmark; + WORD_TAB wtab_null[8]; // translate these to get pronunciations of plural 's' suffix (different forms depending on // the preceding letter @@ -610,6 +611,14 @@ int TranslateWord(Translator *tr, char *word1, int next_pause, WORD_TAB *wtab) static char word_iz[4] = {0,'i','z',0}; static char word_ss[4] = {0,'s','s',0}; + if(wtab == NULL) + { + memset(wtab_null, 0, sizeof(wtab_null)); + wtab = wtab_null; + } + wflags = wtab->flags; + wmark = wtab->wmark; + dictionary_flags[0] = 0; dictionary_flags[1] = 0; dictionary_flags2[0] = 0; @@ -620,6 +629,13 @@ int TranslateWord(Translator *tr, char *word1, int next_pause, WORD_TAB *wtab) end_phonemes[0] = 0; ph_limit = &phonemes[N_WORD_PHONEMES]; + if(tr->data_dictlist == NULL) + { + // dictionary is not loaded + word_phonemes[0] = 0; + return(0); + } + // count the length of the word if(*word1 == ' ') word1++; // possibly a dot was replaced by space: $dot wordx = word1; @@ -1053,6 +1069,7 @@ strcpy(phonemes2,phonemes); AppendPhonemes(tr,phonemes, N_WORD_PHONEMES, end_phonemes); end_phonemes[0] = 0; } + memcpy(wordx,word_copy,strlen(word_copy)); } wordx[-1] = c_temp; } diff --git a/src/translate.h b/src/translate.h index 2eaead14..51f0c4bb 100755 --- a/src/translate.h +++ b/src/translate.h @@ -98,10 +98,10 @@ #define FLAG_DONT_SWITCH_TRANSLATOR 0x1000 #define FLAG_SUFFIX_REMOVED 0x2000 #define FLAG_HYPHEN_AFTER 0x4000 +#define FLAG_ORDINAL 0x8000 // passed to TranslateNumber() to indicate an ordinal number #define FLAG_NO_TRACE 0x10000 // passed to TranslateRules() to suppress dictionary lookup printout #define FLAG_NO_PREFIX 0x20000 -#define FLAG_ORDINAL 0x40000 // passed to TranslateNumber() to indicate an ordinal number // prefix/suffix flags (bits 8 to 14, bits 16 to 22) don't use 0x8000, 0x800000 #define SUFX_E 0x0100 // e may have been added