From fb7230a9122b07a42b68e12d8a1abfc2d506e331 Mon Sep 17 00:00:00 2001 From: jonsd Date: Thu, 20 Dec 2007 13:45:16 +0000 Subject: [PATCH] [1.29.29] Add inital draft of language "ta", Tamil lang=en: Don't treat "Mc" prefix as a separate word, combine it with the following word. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@113 d46cf337-b52f-0410-862d-fd96e6ae7743 --- dictsource/dict_phonemes | 4 + dictsource/en_list | 2 +- dictsource/en_rules | 5 +- dictsource/mk_list | 32 +-- dictsource/ta_list | 4 + dictsource/ta_rules | 173 +++++++++++++++++ espeak-data/voices/grc | 2 +- espeak-data/voices/ta | 4 + phsource/compile_report | 26 ++- phsource/ph_serbian | 43 ++++- phsource/ph_tamil | 84 ++++++++ phsource/ph_zh | 407 +++++++++++++++++++++++++++++++++++++++ phsource/phonemes | 3 + phsource/ufric/sh_sr.wav | Bin 4652 -> 5828 bytes phsource/vowel/a#_2 | Bin 6240 -> 7276 bytes src/dictionary.cpp | 31 +-- src/intonation.cpp | 15 +- src/readclause.cpp | 11 +- src/synthdata.cpp | 2 +- src/synthesize.cpp | 3 - src/synthesize.h | 2 +- src/tr_english.cpp | 3 +- src/tr_languages.cpp | 34 +++- src/translate.cpp | 19 +- src/translate.h | 2 +- 25 files changed, 819 insertions(+), 92 deletions(-) create mode 100644 dictsource/ta_list create mode 100644 dictsource/ta_rules create mode 100755 espeak-data/voices/ta create mode 100644 phsource/ph_tamil create mode 100644 phsource/ph_zh diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index 5e772566..c17c4317 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -262,6 +262,10 @@ l m n N p r s t tS v w z +Dictionary ta_dict + + + Dictionary pt_dict & &/ &U~ &~ @ @- a A diff --git a/dictsource/en_list b/dictsource/en_list index d671035d..ed81746e 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -169,7 +169,7 @@ i.e aIi:_! $pause irc $abbrev lbs paUndz ltd lImItId -mc m@k +mc m@k $alt2 // combine with the following word oem $abbrev ok $abbrev omg $abbrev diff --git a/dictsource/en_rules b/dictsource/en_rules index d5bae534..91398b00 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -3227,7 +3227,9 @@ li) mb (e m o) mb (e m du) mb (e m - _) m (c m@ + _) mc m@k + _) mc (A mak + _) mc (-A mak mn (_ m _) mn n &B) me (_ mI2 @@ -4965,6 +4967,7 @@ t) y (rann I ph) ys (i Iz yr (_ @ + yre (_ aI3 c) y (ni I l) y (ri I p) y (ra I diff --git a/dictsource/mk_list b/dictsource/mk_list index e35e3524..705babbe 100755 --- a/dictsource/mk_list +++ b/dictsource/mk_list @@ -162,37 +162,7 @@ _1M4 bili'on _dpt _:z'api*k&_ _0and i -// Roman numerals -ii $abbrev -iii $abbrev -iv $abbrev -vii $abbrev -viii $abbrev -ix $abbrev -xi $abbrev -xii $abbrev -xiii $abbrev -xiv $abbrev -xvi $abbrev -xvii $abbrev -xviii $abbrev -xix $abbrev -xxi $abbrev -xxii $abbrev -xxiii $abbrev -xxiv $abbrev -xxvi $abbrev -xxvii $abbrev -xxviii $abbrev -xxix $abbrev -xxxi $abbrev -xxxii $abbrev -xxxiii $abbrev -xxxiv $abbrev -xxxvi $abbrev -xxxvii $abbrev -xxxviii $abbrev -xxxix $abbrev + // Abbreviations diff --git a/dictsource/ta_list b/dictsource/ta_list new file mode 100644 index 00000000..68c79c98 --- /dev/null +++ b/dictsource/ta_list @@ -0,0 +1,4 @@ + +// This file is UTF8 encoded +// Spelling to phoneme words and exceptions for Tamil + diff --git a/dictsource/ta_rules b/dictsource/ta_rules new file mode 100644 index 00000000..f5518f52 --- /dev/null +++ b/dictsource/ta_rules @@ -0,0 +1,173 @@ + +// This file is UTF8 encoded +// Spelling to phoneme rules for Tamil + +.replace +௦ 0 // Tamil numbers +௧ 1 +௨ 2 +௩ 3 +௪ 4 +௫ 5 +௬ 6 +௭ 7 +௮ 8 +௯ 9 + + +.group 0xe0ae + ஂ // anusvara + + ஃ // visarga + + அ a + + ஆ a: + + இ i + + ஈ i: + + உ u + + ஊ u: + + எ e + + ஏ e: + + ஐ E: + + ஒ o + + ஓ o: + + ஔ aU + +// consonants + + க ga // inter-vocalic, unless there is virama before or after + க (B g + க (் g + ்) க ga + ்) க (B g + _) க ka + _) க (B k + க்க ka + க்க (B k + + ங Na + ங (B N + + ச dZa + ச (B dZ + _) ச sa + _) ச (B s + ச்ச tSa + ச்ச (B tS + + ஜ dZa + ஜ (B dZ + + ஞ n^a + ஞ (B n^ + + ட d.a + ட (B d. + _) ட t.a + _) ட (B t. + ட்ட t.a + ட்ட (B t. + + ண n.a + ண (B n. + + த da + த (B d + _) த ta + _) த (B t + த்த ta + த்த (B t + + ந na + ந (B n + + ன na + ன (B n + + ப ba + ப (B b + _) ப pa + _) ப (B p + ப்ப pa + ப்ப (B p + + ம ma + ம (B m + + ய ja + ய (B j + + ர ra + ர (B r + + ற Ra + ற (B R + ற் (ற t // RR -> tR + + ல la + ல (B l + + ள l/2a // this should be [l.] not [l/2] + ள (B l/2 + + ழ z.a + ழ (B z. + + வ va + வ (B v + + ஶ Sa + ஶ (B S + + ஷ s.a + ஷ (B s. + + ஸ sa + ஸ (B s + + ஹ ha + ஹ (B h + + +// combining vowels + + ா a: + + ி i + +.group 0xe0af + ீ i: + + ு u + + ூ u: + + ெ e + + ே e: + + ை E: + + ொ o + + ோ o: + + ௌ aU + + ் // virama + + ௗ : // aU length mark + +.group + $ dola diff --git a/espeak-data/voices/grc b/espeak-data/voices/grc index a8799222..ffa94206 100755 --- a/espeak-data/voices/grc +++ b/espeak-data/voices/grc @@ -4,5 +4,5 @@ gender male stressLength 170 170 190 190 0 0 230 240 dictrules 1 -words 1 +words 3 diff --git a/espeak-data/voices/ta b/espeak-data/voices/ta new file mode 100755 index 00000000..43dd4af9 --- /dev/null +++ b/espeak-data/voices/ta @@ -0,0 +1,4 @@ +name tamil-test +language ta +gender male + diff --git a/phsource/compile_report b/phsource/compile_report index 0f680da2..af7abf95 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -1,4 +1,4 @@ -41 phoneme tables +42 phoneme tables new total base 96 96 base2 24 115 @@ -16,6 +16,7 @@ fr 34 118 fr_ca 11 118 hi 50 132 + ta 12 134 hu 23 112 nl 26 117 pl 15 107 @@ -23,7 +24,7 @@ cs 6 125 hr 20 130 mk 3 131 - sr 11 130 + sr 14 130 ru 38 126 it 17 118 la 21 114 @@ -427,6 +428,7 @@ r3/r_trill [R2] base [r] cy [r] nl [R] sk + [r*] sr [x] pt r3/r_trill2 [R] base [R] hr @@ -438,6 +440,7 @@ r3/r_trill3.wav [R3] base [r] nl r3/r_trill.wav [R2] base [R] sk + [r*] sr [x] pt r3/r_u [(u)] base r3/rx [*] base @@ -699,6 +702,7 @@ ustop/t_dnt [t] base [t] hu [t] pl [t] hr + [t] sr [t] ru [t;] ro [t[] vi @@ -741,7 +745,6 @@ ustop/ts_pzd_ [c] hi ustop/ts_pzd2 [c] hi [c] hu ustop/t_sr [d] sr - [t] sr ustop/ts_rfx [ts.] zh ustop/ts_rfx_unasp [ts.] zh ustop/ts_sr.wav [tS;] sr @@ -1106,6 +1109,7 @@ vowel/a [a] en_n [a] zh vowel/a# [a/] base2 [a2] en_sc + [&] sr [&] pt [&/] pt [a2] en_wi @@ -1120,7 +1124,8 @@ vowel/a_2 [a] base2 [A:] en_wi [A@] en_wi [aa] en_wi -vowel/a#_2 [&] hr +vowel/a#_2 [a] ta + [&] hr [a2] sv [&] is [a/] sw @@ -1150,6 +1155,7 @@ vowel/a_5 [a/] it [a] sw vowel/aa [a] fi [A] fr_ca + [a:] ta [A] no [A:] no [aa] zhy @@ -1185,6 +1191,8 @@ vowel/e [e] base2 [e] eo [e] fr [E:] fr + [e] ta + [e:] ta [e] hr [e/] it [e:] la @@ -1267,6 +1275,7 @@ vowel/i [i] base2 [i:] cy [i] eo [I] fr + [i:] ta [i:] hu [i] pl [i] it @@ -1301,6 +1310,7 @@ vowel/i#_5 [y] pt_pt [i/] pt_pt [y] ro vowel/i_6 [i:] en_us + [i] ta [i] hr vowel/i_en [i:] en [i] vi @@ -1338,6 +1348,7 @@ vowel/ii_5 [I] en_wi [I2] en_wi vowel/ii_6 [I] en_wm [I2] en_wm + [I] sr vowel/ii_en [i] en vowel/@_low [3] en_rp [@] en_rp @@ -1353,6 +1364,8 @@ vowel/o [o] base2 [o:] en [o:] de [o] hi + [o] ta + [o:] ta [o] it [o/] it [o:] la @@ -1450,7 +1463,8 @@ vowel/u_2 [u1] fi [u] sk [U] hr [u] ro -vowel/u#_2 [u-] sv +vowel/u#_2 [u-] ta + [u-] sv vowel/u_3 [yU] ro vowel/u_4 [u:] en_n vowel/u#_4 [U] en_sc @@ -1465,6 +1479,7 @@ vowel/u_bck [u] base2 [u] fi [u] fr_ca [u:] hi + [u:] ta [u:] hu [u] nl [u] pl @@ -1489,6 +1504,7 @@ vowel/uu_4 [U] fi vowel/uu_bck [U] en_n [U] fr_ca [U] hi + [u] ta [u] hu [U] pt [U] no diff --git a/phsource/ph_serbian b/phsource/ph_serbian index 26ae637e..d1d5eea4 100644 --- a/phsource/ph_serbian +++ b/phsource/ph_serbian @@ -13,14 +13,39 @@ // Only phonemes which differ from the inherited phonemes need // to be included here. +phoneme I + vowel starttype (i) endtype (i) + length 120 + formants vowel/ii_6 + linkout ; +endphoneme + + +phoneme & + vowel starttype (a) endtype (a) + length 140 + formants vowel/a# +endphoneme + + +phoneme r* // this is [R] from Slovak/Czech + liquid + vowelin f1=0 f2=1700 -300 300 f3=-300 80 + vowelout f1=2 f2=1700 -300 300 f3=-300 80 brk + formants r3/r_trill+r3/r_trill.wav%50 + trill + lengthmod 6 +endphoneme + + phoneme t // dental variant of /t/ vls dnt stop vowelin f1=0 f2=1600 -300 300 f3=-100 80 vowelout f1=0 f2=1600 -300 250 f3=-100 80 rms=20 lengthmod 2 - wave ustop/t_sr%50 - before _ ustop/t_sr%35 + wave ustop/t_dnt%50 + before _ ustop/t_dnt%50 switchvoicing d endphoneme @@ -97,8 +122,8 @@ phoneme tS vls pla afr sibilant vowelin f1=0 f2=2300 200 400 f3=-100 80 lengthmod 2 - wave ustop/tsh_sr.wav - before _ ustop/tsh_sr.wav + wave ustop/tsh_sr.wav%50 + before _ ustop/tsh_sr.wav%50 switchvoicing dZ endphoneme @@ -113,12 +138,14 @@ phoneme tS; endphoneme + + phoneme Z vcd pla frc sibilant vowelin f1=0 f2=2000 0 300 f3=-200 80 vowelout f1=2 f2=2000 0 300 f3=-200 80 brk - formants voc/zh+ufric/sh_sr.wav - before _ voc/zh+ufric/sh_sr.wav + formants voc/zh+ufric/sh_sr.wav%60 + before _ voc/zh+ufric/sh_sr.wav%50 lengthmod 6 switchvoicing S endphoneme @@ -130,8 +157,8 @@ phoneme S vowelout f1=0 f2=2100 100 300 f3=-100 80 length 100 lengthmod 3 - wave ufric/sh_sr.wav - before _ ufric/sh_sr.wav + wave ufric/sh_sr.wav%70 + before _ ufric/sh_sr.wav%60 switchvoicing Z endphoneme diff --git a/phsource/ph_tamil b/phsource/ph_tamil new file mode 100644 index 00000000..d6868723 --- /dev/null +++ b/phsource/ph_tamil @@ -0,0 +1,84 @@ + +// Phonemes for Tamil +// This inherits from ph_hindi + + + +phoneme a + vowel starttype (@) endtype (@) + length 130 + formants vowel/a#_2 +endphoneme + + +phoneme a: + vowel starttype (a) endtype (a) + length 270 + formants vowel/aa +endphoneme + + +phoneme e + vowel starttype (e) endtype (e) + length 130 + formants vowel/e +endphoneme + + +phoneme e: + vowel starttype (e) endtype (e) + length 270 + formants vowel/e +endphoneme + + +phoneme i + vowel starttype (i) endtype (i) + length 130 + formants vowel/i_6 +endphoneme + + +phoneme i: + vowel starttype (i) endtype (i) + length 270 + formants vowel/i +endphoneme + + + +phoneme o + vowel starttype (o) endtype (o) + length 130 + formants vowel/o +endphoneme + + +phoneme o: + vowel starttype (o) endtype (o) + length 270 + formants vowel/o +endphoneme + + +phoneme u + vowel starttype (u) endtype (u) + length 130 + formants vowel/uu_bck +endphoneme + + +phoneme u: + vowel starttype (u) endtype (u) + length 270 + formants vowel/u_bck +endphoneme + + +phoneme u- + vowel starttype (u) endtype (u) + length 130 + formants vowel/u#_2 +endphoneme + + diff --git a/phsource/ph_zh b/phsource/ph_zh new file mode 100644 index 00000000..3486d574 --- /dev/null +++ b/phsource/ph_zh @@ -0,0 +1,407 @@ +//based on "phonemes" +//==================================================== +// Tone Numbers +//==================================================== + +phoneme 11 // tone: low level + stress + tone 15 10 envelope/p_fall NULL +endphoneme + +phoneme 21 // tone: low fall + stress + tone 20 10 envelope/p_fall NULL +endphoneme + +phoneme 214 // tone: fall rise + stress + tone 20 40 envelope/p_214 NULL +endphoneme + +phoneme 22 // tone: mid-low level + stress + tone 21 19 envelope/p_fall NULL +endphoneme + +phoneme 33 // tone: mid level + stress + tone 31 29 envelope/p_fall NULL +endphoneme + +phoneme 35 // tone: mid rise + stress + tone 30 50 envelope/p_rise NULL +endphoneme + +phoneme 44 // tone: mid-high level + stress + tone 41 39 envelope/p_level NULL +endphoneme + +phoneme 51 // tone: high fall + stress + tone 50 10 envelope/p_fall NULL +endphoneme + +phoneme 53 // tone: high fall + stress + tone 50 30 envelope/p_fall NULL +endphoneme + +phoneme 55 // tone: high level + stress + tone 50 50 envelope/p_level NULL +endphoneme + +//==================================================== +// Consonants +//==================================================== + +phoneme p + vls blb stop + vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11 + vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=22 + lengthmod 2 + wave ustop/p_unasp +endphoneme + +phoneme ph + vls blb stop + vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11 + vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=22 + lengthmod 2 + wave ustop/p_ +endphoneme + +phoneme m //not clear before some vowel + vcd blb nasal + vowelout f1=2 f2=1000 -500 -350 f3=-200 80 brk + lengthmod 2 + formants m/_m +endphoneme + +phoneme f //not clear before some vowel + vls lbd frc + vowelout f1=0 f2=1000 -500 -350 f3=-200 80 + lengthmod 2 + wave ufric/f +endphoneme + +phoneme t + vls alv stop + vowelin f1=0 f2=1700 -300 300 f3=-100 80 + vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 + lengthmod 2 + wave ustop/t_unasp +endphoneme + +phoneme th + vls alv stop + vowelin f1=0 f2=1700 -300 300 f3=-100 80 + vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 + lengthmod 2 + wave ustop/t_ +endphoneme + +phoneme n + vcd alv nasal + vowelout f1=2 f2=1700 -300 250 f3=-100 80 rms=20 brk + length 30 + lengthmod 2 + formants n/_n + before _ n/n_ + before (i) n/ni +endphoneme + +phoneme l + liquid + vowelin f1=0 f2=2700 400 600 f3=300 80 rate len=20 + lengthmod 2 + formants l/_l + before (i) l/li +endphoneme + +phoneme k + vls uvl stop + vowelin f1=1 f2=1700 0 200 f3=-300 80 f4 + vowelout f1=1 f2=1700 0 200 f3=-300 80 f4 rms=30 + lengthmod 2 + wave ustop/k_unasp_ +endphoneme + +phoneme kh + vls uvl stop + vowelin f1=1 f2=1700 0 200 f3=-300 80 f4 + vowelout f1=1 f2=1700 0 200 f3=-300 80 f4 rms=30 + lengthmod 2 + wave ustop/k_ +endphoneme + +phoneme tS; + vls pal afr sibilant palatal + vowelin f1=0 f2=2700 400 600 f3=300 80 + lengthmod 2 + wave ustop/tsh_pzd_unasp +endphoneme + +phoneme tS;h + vls pal afr sibilant palatal + vowelin f1=0 f2=2700 400 600 f3=300 80 + lengthmod 2 + wave ustop/tsh_pzd +endphoneme + +phoneme S; + vls pla frc sibilant + vowelin f1=0 f2=2700 400 600 f3=300 80 + lengthmod 2 + wave ufric/sh_pzd +endphoneme + +phoneme ts + vls alv afr sibilant + vowelin f1=0 f2=1700 -300 300 f3=-100 80 + vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 + lengthmod 2 + wave ustop/ts_unasp +endphoneme + +phoneme tsh + vls alv afr sibilant + vowelin f1=0 f2=1700 -300 300 f3=-100 80 + vowelout f1=0 f2=1700 -300 250 f3=-100 80 rms=20 + lengthmod 2 + wave ustop/ts +endphoneme + +phoneme ts. + vls pla frc sibilant + vowelin f1=0 f2=1800 -100 300 f3=-300 80 + vowelout f1=0 f2=1800 -100 300 f3=-300 80 + length 100 + lengthmod 3 + wave ustop/ts_rfx_unasp +endphoneme + +phoneme ts.h + vls pla frc sibilant + vowelin f1=0 f2=1800 -100 300 f3=-300 80 + vowelout f1=0 f2=1800 -100 300 f3=-300 80 + length 100 + lengthmod 3 + wave ustop/ts_rfx +endphoneme + +phoneme j + liquid + palatal + length 40 + formants j/_j + lengthmod 1 +endphoneme + +phoneme w + liquid + length 40 + lengthmod 1 + formants w/_w +endphoneme + +//==================================================== +// Vowels and Diphtnongs +//==================================================== + +phoneme N //should be more different from n + vcd vel nasal + length 10 + formants NULL + before _ nn/nn_ + after _ nn/_nn + lengthmod 1 + after (i) nn/inn +endphoneme + +phoneme a + vowel starttype (a) endtype (a) + length 250 + formants vowel/a +endphoneme + +phoneme A + vowel starttype (a) endtype (a) + length 250 + formants vowel/aa + before N vowel/aa_2 +endphoneme + +phoneme ai + vowel starttype (a) endtype (i) + length 250 + formants vdiph/ae +endphoneme + +phoneme Au + vowel starttype (a) endtype (u) + length 250 + formants vwl_zh/aau +endphoneme + +phoneme @ + vowel starttype (@) endtype (@) + length 230 + formants vowel/3_2%120 + before N vowel/@_bck +endphoneme + +phoneme @r //tmp use V3_r + vowel starttype (@) endtype (@) + length 250 + formants vowelr/V3_r +endphoneme + +phoneme E + vowel starttype (e) endtype (e) + length 250 + formants vowel/ee_2 +endphoneme + +phoneme ei + vowel starttype (e) endtype (i) + length 250 + formants vdiph/ei +endphoneme + +phoneme i + vowel starttype (i) endtype (i) + length 250 + formants vowel/i + before N vowel/ii_2 +endphoneme + +phoneme i[ //after ts tsh s + vowel starttype (i) endtype (i) + length 250 + formants vwl_zh/i_dnt +endphoneme + +phoneme i. //after ts. ts.h s. z. + vowel starttype (i) endtype (i) + length 250 + formants vwl_zh/i_rfx +endphoneme + +phoneme iA //try more before N + vowel starttype (i) endtype (a) + length 250 + formants vwl_zh/iaa +endphoneme + +phoneme iAu + vowel starttype (i) endtype (u) + length 250 + formants vwl_zh/iaau +endphoneme + +phoneme iE + vowel starttype (i) endtype (e) + length 250 + formants vwl_zh/iee +endphoneme + +phoneme io + vowel starttype (i) endtype (o) + length 250 + formants vdiph2/iioo +endphoneme + +phoneme iou + vowel starttype (i) endtype (u) + length 250 + formants vwl_zh/iou +endphoneme + +phoneme o + vowel starttype (o) endtype (o) + length 250 + formants vowel/o +endphoneme + +phoneme o- + vowel starttype (o) endtype (o) + length 250 + formants vowel/o- +endphoneme + +phoneme ou + vowel starttype (o) endtype (u) + length 250 + formants vdiph/8u +endphoneme + +phoneme u //try more before N + vowel starttype (u) endtype (u) + length 250 + formants vowel/u + before N vowel/o +endphoneme + +phoneme uA + vowel starttype (u) endtype (a) + length 250 + formants vwl_zh/uaa +endphoneme + +phoneme ua + vowel starttype (u) endtype (a) + length 250 + formants vdiph2/oa +endphoneme + +phoneme uai + vowel starttype (u) endtype (i) + length 250 + formants vwl_zh/uai +endphoneme + +phoneme u@ + vowel starttype (u) endtype (@) + length 250 + formants vdiph2/o@ +endphoneme + +phoneme uei + vowel starttype (u) endtype (i) + length 250 + formants vwl_zh/uei +endphoneme + +phoneme uo + vowel starttype (u) endtype (o) + length 250 + formants vwl_zh/uo +endphoneme + +phoneme y //try more before N + vowel starttype (i) endtype (u) + length 250 + formants vowel/y + before N vdiph2/yu +endphoneme + +phoneme y& + vowel starttype (i) endtype (e) + length 250 + formants vwl_zh/y& +endphoneme + +phoneme yE //try more so not similar to iE + vowel starttype (i) endtype (e) + length 250 + formants vwl_zh/yee +endphoneme + +phoneme y@ + vowel starttype (i) endtype (@) + length 250 + formants vdiph2/y#@ +endphoneme \ No newline at end of file diff --git a/phsource/phonemes b/phsource/phonemes index 2314841a..9b09cd8e 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -1172,6 +1172,9 @@ include ph_french_ca phonemetable hi base include ph_hindi +phonemetable ta hi +include ph_tamil + phonemetable hu base include ph_hungarian diff --git a/phsource/ufric/sh_sr.wav b/phsource/ufric/sh_sr.wav index 3e7abc301ab40066cb38625ce2629ecc8dcb7d32..5c43a91e1b6799687cff946c784caad65ac7ff4e 100644 GIT binary patch literal 5828 zcmWMqWpoq=1Ki!az1=* zTmk?H5Ce+}O9~Hv=KPOyg?LMB4$NWl1yg`iz8sEBDw6b14! zi0`TP`;j85+@8*=kg9l-Sh>C&yN!9v!|8O_0BWG(v@{G?Iy6)n@Pz2jYLecC3!Qs? zT&NtF9Li%m)klP9x<2V|F@1${-tvGW&>>G2{nELjX#}q}wi!wC{$KGyq4Qiw z`G+9FE-*)-3ozWy!RsR=G2vcWqtaU`{tjN{?!}a97Rdgys&&soxuSA*ZEzfmB_GSV z-afz(5|2`3FjuG;>@YLOvB0@B^cW6^r-ZFQg0??RRbB;aws@~}2omqvV~-0^&>wUz zlq2gYX~O~AH{MM4P)-?{%U&i@QpJ`sq8rN!*9$j6C%rG2=bR7zX|{7P7;V71^xr%8 zC?5(YSd^wi$d{TaaJzE_JPmo|$nz|KCrD=rX!lP}F7%Gl;Hk_PLbvKFq_-FPCj?0f zL?$9{=ry30or52+pQXMPhXlQ${nTBe-sdOYL90=mUJZ7Ioq`uOH5vXAyCQ~RH{Gpn z7SsTxdwY8Im^|W{sE2)#&O_A;&a?NEVw!;}I3ua2zClbpoJ_AlmP^ZN($wF+3VJU5 z3poV`LB0E|lgGkQ3>XM3;H>5XoM+w#_8R{gax0Q7YZl(Xv#cqhTETI&f!adVfs=!b z10r?2T+w1qrDL`W5U-VN$CGRW0`0;|-Ww{Gf&)vuS7ccw%oZe|s@7TSBG6#^walOgda`id;To@^iF z69Ti@f6%ee0@*aEm-_&<70PDP;fqX9hu?1yd?UCTB8fcy5aCWwgtmk*3mZ^2TPG=p z@9Sf=``B-z7E6SV@xDCuCN}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WI?22XF3RiSIAWZ#R*d5A*jrGUxKb-Xi`B0{fu$3@M;fi3P@gE_ zbOBdl;PPLX6WkPEfa9!BZ!N7dlJWMi5ZJ&Zmaxz2q>dO#d(SKGO}~ qWUN;|QnR#cu!6~>#~2wxwfuna;E>+WWtr)LFfGy|Q4fs`;Qs)Gy7J8c diff --git a/phsource/vowel/a#_2 b/phsource/vowel/a#_2 index c163a58c1c24555ede5a6a7c08651570ca662a44..30cb011aafc63642c731d4542afcaa62700b161b 100644 GIT binary patch delta 113 zcmaE0@Ww(gIKb68B-k~Og@J(~Q90g-eWRc~3!~TOK$fq}%smVYn>{(cFiZS?GFt(t zfPuk*ZOyzL5Ejb`2BwLI!i-UyV>uo$v;3Xm+%VaZN1f4eb0!anKigu@~ delta 78 zcmaE3@xVYZIKb68B-k~Og@J(~Q90g-ZKI$)3!}s4K$fq}%*X%#-|Wfpg_-5gDTUdS ieFfARZ8nz*JOJ`9a5Ha?6yacD`E&K(^v$Uf>?{BUQ5$&x diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 932f0c32..2f15c184 100755 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -976,7 +976,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int int done; unsigned char vowel_stress[N_WORD_PHONEMES/2]; - char syllable_type[N_WORD_PHONEMES/2]; + char syllable_weight[N_WORD_PHONEMES/2]; unsigned char phonetic[N_WORD_PHONEMES]; static char consonant_types[16] = {0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0}; @@ -1040,7 +1040,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int // followed by two consonants, a long consonant, or consonant and end-of-word weight++; } - syllable_type[ix] = weight; + syllable_weight[ix] = weight; ix++; } } @@ -1164,16 +1164,14 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int { int wt; int max_weight = -1; - int min_weight = 10; int prev_stressed; - for(ix = 1; ix < vowel_count; ix++) + // find the heaviest syllable, excluding the final syllable + for(ix = 1; ix < (vowel_count-1); ix++) { if(vowel_stress[ix] == 0) { - if((wt = syllable_type[ix]) < min_weight) - min_weight = wt; - if(wt >= max_weight) + if((wt = syllable_weight[ix]) >= max_weight) { max_weight = wt; prev_stressed = stressed_syllable; @@ -1181,14 +1179,19 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int } } } - if(max_weight > min_weight) + + if((syllable_weight[vowel_count-1] == 2) && (max_weight< 2)) { - // different weights, don't stress the final syllable - if((stressed_syllable == vowel_count-1) && (syllable_type[vowel_count-2] > 0)) - { - stressed_syllable = vowel_count-2; - } + // the only double=heavy syllable is the final syllable, so stress this + stressed_syllable = vowel_count-1; } + else + if(max_weight <= 0) + { + // all syllables, exclusing the last, are light. Stress the first syllable + stressed_syllable = 1; + } + vowel_stress[stressed_syllable] = 4; max_stress = 4; } @@ -1253,7 +1256,7 @@ void Translator::SetWordStress(char *output, unsigned int dictionary_flags, int if((stress == 3) && (langopts.stress_flags & 0x20)) continue; // don't use secondary stress - if((v > 1) && (langopts.stress_flags & 0x40) && (syllable_type[v]==0) && (syllable_type[v+1]>0)) + if((v > 1) && (langopts.stress_flags & 0x40) && (syllable_weight[v]==0) && (syllable_weight[v+1]>0)) { // don't put secondary stress on a light syllable which is followed by a heavy syllable continue; diff --git a/src/intonation.cpp b/src/intonation.cpp index 06c4f18d..29beff1d 100755 --- a/src/intonation.cpp +++ b/src/intonation.cpp @@ -43,7 +43,7 @@ typedef struct { short pitch2; } SYLLABLE; -SYLLABLE syllable_tab[N_PHONEME_LIST]; +SYLLABLE *syllable_tab; static int tone_pitch_env; /* used to return pitch envelope */ @@ -242,7 +242,7 @@ static int drops_0[8] = {0x400,0x400,0x700,0x700,0x700,0xa00,0x1800,0x0e00}; static short oflow[] = {0, 20, 12, 4, 0}; static short oflow_emf[] = {5, 24, 15, 10, 5}; static short oflow_less[] = {1, 17, 10, 5, 1}; -static short back_emf[] = {36, 32, 0}; +static short back_emf[] = {35, 32, 0}; typedef struct { unsigned char pitch_env0; /* pitch envelope, tonic syllable at end */ @@ -285,7 +285,7 @@ static TONE_TABLE tone_table[N_TONE_TABLE] = { 20, 25, 34, 20, drops_0, 3, 3, 5, oflow, NULL, 15, 29, 0}, {PITCHfall, 41, 4, PITCHfall, 41, 27, // exclamation - 20, 25, 34, 24, drops_0, 3, 4, 5, oflow_emf, back_emf, 18, 5, 0}, + 20, 25, 34, 24, drops_0, 3, 4, 5, oflow_emf, back_emf, 16, 5, 0}, {PITCHfall, 38, 2, PITCHfall, 42, 30, // statement, emphatic 20, 25, 34, 22, drops_0, 3, 3, 5, oflow, NULL, 15, 5, 0}, @@ -376,7 +376,7 @@ static void count_pitch_vowels(int start, int end, int clause_end) if(no_tonic) { - tone_posn = tone_posn2 = end-1; + tone_posn = tone_posn2 = end; // next position after the end of the truncated clause } else if(last_primary >= 0) @@ -880,6 +880,10 @@ void Translator::CalcPitches(int clause_type) int count_primary; int ph_end=n_phoneme_list; + SYLLABLE syllable_tab2[N_PHONEME_LIST]; + + syllable_tab = syllable_tab2; // don't use permanent storage. it's only needed during the call of CalcPitches() + if(langopts.intonation == 1) { CalcPitches_Tone(clause_type); @@ -892,7 +896,7 @@ void Translator::CalcPitches(int clause_type) option = 0; group_tone_emph = group_tone = punct_to_tone[option][clause_type]; - group_tone_emph = punct_to_tone[option][4]; // emphatic form of statement + group_tone_emph = punct_to_tone[option][5]; // emphatic form of statement if(clause_type == 4) no_tonic = 1; /* incomplete clause, used for abbreviations such as Mr. Dr. Mrs. */ @@ -907,6 +911,7 @@ void Translator::CalcPitches(int clause_type) if(p->synthflags & SFLAG_SYLLABLE) { syllable_tab[n_st].flags = 0; + syllable_tab[n_st].env = PITCHfall; syllable_tab[n_st++].stress = p->tone; // stress level if(p->tone >= 4) diff --git a/src/readclause.cpp b/src/readclause.cpp index 44a836d9..73e0e432 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -1967,22 +1967,15 @@ if(option_ssml) parag=1; } ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1; - if(!iswalnum(c1) && (ix > (n_buf-20))) + if(((ix > (n_buf-20)) && !IsAlpha(c1) && !iswdigit(c1)) || (ix >= (n_buf-2))) { // clause too long, getting near end of buffer, so break here + // try to break at a word boundary (unless we actually reach the end of buffer). buf[ix] = ' '; buf[ix+1] = 0; UngetC(c2); return(CLAUSE_NONE); } - if(ix >= (n_buf-2)) - { - // reached end of buffer, must break now - buf[n_buf-2] = ' '; - buf[n_buf-1] = 0; - UngetC(c2); - return(CLAUSE_NONE); - } } buf[ix] = ' '; buf[ix+1] = 0; diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 693ec546..522f4910 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.29.26 18.Dec.07"; +const char *version_string = "1.29.29 20.Dec.07"; const int version_phdata = 0x012924; int option_device_number = -1; diff --git a/src/synthesize.cpp b/src/synthesize.cpp index 680c836e..c6ca9fb6 100755 --- a/src/synthesize.cpp +++ b/src/synthesize.cpp @@ -33,9 +33,6 @@ #include "voice.h" #include "translate.h" -#define PITCHfall 0 -#define PITCHrise 1 - extern FILE *f_log; static void SmoothSpect(void); diff --git a/src/synthesize.h b/src/synthesize.h index c08383e5..00c73b6e 100755 --- a/src/synthesize.h +++ b/src/synthesize.h @@ -18,7 +18,7 @@ ***************************************************************************/ -#define N_PHONEME_LIST 700 // enough for source[] full of text, else it will truncate +#define N_PHONEME_LIST 1000 // enough for source[N_TR_SOURCE] full of text, else it will truncate #define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough #define N_SEQ_FRAMES 25 // max frames in a spectrum sequence (real max is ablut 8) diff --git a/src/tr_english.cpp b/src/tr_english.cpp index 6818d584..4d48a4cd 100644 --- a/src/tr_english.cpp +++ b/src/tr_english.cpp @@ -43,6 +43,7 @@ Translator_English::Translator_English() : Translator() langopts.stress_rule = 0; langopts.numbers = 0x41 + NUM_ROMAN; + langopts.param[LOPT_COMBINE_WORDS] = 5; // allow "mc" to cmbine with the following word } @@ -52,7 +53,7 @@ static unsigned char initials_bitmap[86] = { 0x20, 0x24, 0x20, 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x28, 0x08, 0x00, 0x88, 0x22, 0x04, 0x00, // 16 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x88, 0x22, 0x04, 0x00, 0x02, 0x00, 0x00, // 32 + 0x00, 0x88, 0x22, 0x04, 0x00, 0x02, 0x00, 0x04, // 32 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x8a, 0x03, 0x00, 0x00, 0x40, 0x00, // 48 0x02, 0x00, 0x41, 0xca, 0x9b, 0x06, 0x20, 0x80, diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 41e85e61..61766220 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -45,6 +45,7 @@ #define OFFSET_GREEK 0x380 #define OFFSET_CYRILLIC 0x420 #define OFFSET_DEVANAGARI 0x900 +#define OFFSET_TAMIL 0xb80 static const unsigned int replace_cyrillic_latin[] = @@ -292,7 +293,7 @@ Translator *SelectTranslator(const char *name) tr->charset_a0 = charsets[19]; // ISCII tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable - tr->langopts.stress_rule = 6; // stress on last heaviest syllable + tr->langopts.stress_rule = 6; // stress on last heaviest syllable, excluding final syllable tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable tr->langopts.numbers = 0x811; tr->langopts.numbers2 = 0x100; @@ -314,9 +315,14 @@ Translator *SelectTranslator(const char *name) { static const unsigned char stress_amps_hr[8] = {16,16, 20,20, 20,24, 24,22 }; static const short stress_lengths_hr[8] = {180,160, 200,200, 0,0, 220,230}; + static const short stress_lengths_sr[8] = {160,150, 200,200, 0,0, 250,260}; tr = new Translator(); - SetupTranslator(tr,stress_lengths_hr,stress_amps_hr); + + if(name2 == L('s','r')) + SetupTranslator(tr,stress_lengths_sr,stress_amps_hr); + else + SetupTranslator(tr,stress_lengths_hr,stress_amps_hr); tr->charset_a0 = charsets[2]; // ISO-8859-2 tr->langopts.stress_rule = 0; @@ -590,6 +596,30 @@ SetLengthMods(tr,3); // all equal } break; + case L('t','a'): + { + static const short stress_lengths_ta[8] = {190, 190, 210, 210, 0, 0, 230, 250}; + static const unsigned char stress_amps_ta[8] = {17,14, 20,19, 20,24, 24,22 }; + + tr = new Translator(); + SetupTranslator(tr,stress_lengths_ta,stress_amps_ta); + tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable + + tr->langopts.stress_rule = 6; // stress on last heaviest syllable, excluding final syllable + tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable + tr->langopts.numbers = 0x811; + tr->langopts.numbers2 = 0x100; + tr->letter_bits_offset = OFFSET_TAMIL; + + memset(tr->letter_bits,0,sizeof(tr->letter_bits)); + SetLetterBitsRange(tr,LETTERGP_A,0x05,0x14); // vowel letters + SetLetterBitsRange(tr,LETTERGP_A,0x3e,0x4c); // vowel signs + SetLetterBitsRange(tr,LETTERGP_B,0x3e,0x4d); // vowel signs, and virama + SetLetterBitsRange(tr,LETTERGP_C,0x15,0x39); // the main consonant range + tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words + } + break; + case L('t','r'): // Turkish { static const unsigned char stress_amps_tr[8] = {16,16, 20,20, 20,24, 24,22 }; diff --git a/src/translate.cpp b/src/translate.cpp index 215bb633..27b0586d 100755 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -88,8 +88,8 @@ static int embedded_ix; static int embedded_read; unsigned int embedded_list[N_EMBEDDED_LIST]; -// the source text of a single clause -#define N_TR_SOURCE 350 +// the source text of a single clause (UTF8 bytes) +#define N_TR_SOURCE 700 static char source[N_TR_SOURCE+40]; // extra space for embedded command & voice change info at end int n_replace_phonemes; @@ -339,12 +339,12 @@ unsigned char *length_mod_tabs[6] = { }; -/* index by 0=. 1=, 2=?, 3=! 4=none */ -static unsigned char punctuation_to_tone[4][5] = { - {0,1,2,3,4}, - {5,6,2,0,4}, - {0,1,2,3,0}, - {0,1,2,3,0} }; +/* index by 0=. 1=, 2=?, 3=! 4=none, 5=emphasized */ +static unsigned char punctuation_to_tone[4][6] = { + {0,1,2,3,0,4}, + {5,6,2,0,0,4}, + {0,1,2,3,0,0}, + {0,1,2,3,0,0} }; void SetLengthMods(Translator *tr, int value) @@ -369,6 +369,9 @@ int IsAlpha(unsigned int c) if((c >= 0x901) && (c <= 0x957)) return(1); // Devanagari vowel signs and other signs + if((c >= 0xb81) && (c <= 0xbe5)) + return(1); // Devanagari vowel signs and other signs + if((c >= 0x300) && (c <= 0x36f)) return(1); // combining accents diff --git a/src/translate.h b/src/translate.h index 98688ef3..41405cbb 100755 --- a/src/translate.h +++ b/src/translate.h @@ -25,7 +25,7 @@ #define N_WORD_PHONEMES 160 // max phonemes in a word #define N_WORD_BYTES 160 // max bytes for the UTF8 characters in a word -#define N_CLAUSE_WORDS 256 // max words in a clause +#define N_CLAUSE_WORDS 300 // max words in a clause #define N_RULE_GROUP2 120 // max num of two-letter rule chains #define N_HASH_DICT 1024 #define N_CHARSETS 20