<say-as tts:char>, if a character name is not defined, say its English name. phoneme tables, added beforenotvowel2 attribure for lang=tr lang=tr: initial draft git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@135 d46cf337-b52f-0410-862d-fd96e6ae7743master
| _#9 t,abu:l'Ato:* | _#9 t,abu:l'Ato:* | ||||
| _#32 l'e:*ts'aIC@n | _#32 l'e:*ts'aIC@n | ||||
| _?? zymb'o:l | |||||
| // Not Roman numbers | // Not Roman numbers | ||||
| v faU | v faU |
| Dictionary de_dict | Dictionary de_dict | ||||
| 3 @ @- a A A: aI aU | 3 @ @- a A A: aI aU | ||||
| E E2 E: e: EI I i2 I: | |||||
| i: O o: OY U u: W y | |||||
| y: Y: | |||||
| E E2 E: e: EI I i2 i: | |||||
| O o: OY U u: W y y: | |||||
| Y: | |||||
| * : ; b C C2 d D | * : ; b C C2 d D | ||||
| dZ f g h j k l m | dZ f g h j k l m | ||||
| * : ; b c d dZ f | * : ; b c d dZ f | ||||
| g h j k l L m n | g h j k l L m n | ||||
| N n^ p r R s S t | |||||
| t2 tS v w z Z z2 z3 | |||||
| N n2 n^ p r R s S | |||||
| t t2 tS v w z Z z2 | |||||
| z3 | |||||
| Dictionary hi_dict | Dictionary hi_dict | ||||
| g h j k l l^ m n | g h j k l l^ m n | ||||
| N n^ p Q r R r- s | N n^ p Q r R r- s | ||||
| S s# s; t T tS ts v | S s# s; t T tS ts v | ||||
| w w2 x z Z | |||||
| w x z Z | |||||
| Dictionary ro_dict | Dictionary ro_dict | ||||
| i i. i[ iou o o- ou u | i i. i[ iou o o- ou u | ||||
| uai y | uai y | ||||
| : f j k kh l m n | |||||
| N p ph r R s s. S; | |||||
| t th ts ts. ts. tS; tS; tsh | |||||
| v w x z z. | |||||
| (u) : f h j k kh l | |||||
| m n N p ph r s s. | |||||
| S; t th ts ts. ts. tS; tS; | |||||
| tsh v w x z z. | |||||
| Dictionary jbo_dict | Dictionary jbo_dict | ||||
| Dictionary ja_dict | Dictionary ja_dict | ||||
| Dictionary tr_dict | |||||
| a e E i I o O u | |||||
| u# W y Y | |||||
| : ; b d dZ f g h | |||||
| j k l m n p Q r | |||||
| R s S t tS v z Z |
| _} A@breIs | _} A@breIs | ||||
| _~ tIld@ | _~ tIld@ | ||||
| £ paUnd | |||||
| ¥ jEn | |||||
| § sEkS@n | |||||
| _¶ par@graf // in en_rules | |||||
| ¤ kVr@nsI2saIn | |||||
| © k0pI2raIt | |||||
| ° dI2gri:z | |||||
| − maIn@s | |||||
| ± plVs@maIn@s | |||||
| µ maIkroU | |||||
| ¼ a2kwO@t3 | |||||
| ½ a2hA:f | |||||
| ¾ Tri:kwO@t3 | |||||
| × taImz | |||||
| ÷ dI2vaIdbaI | |||||
| € jU@roUz | |||||
| ♯ SA@p | |||||
| ♭ flat | |||||
| ə SwA: | |||||
| // numeric | // numeric | ||||
| then DEn $verbf | then DEn $verbf | ||||
| // these should be stressed at the start of a sentence | // these should be stressed at the start of a sentence | ||||
| which ,wItS $pause $strend2 $only $verbsf | |||||
| who ,hu: $verbsf $pause $strend2 $onlys | |||||
| which ,wItS $pause $strend2 $only $verbf | |||||
| who ,hu: $verbf $pause $strend2 $onlys | |||||
| whose ,hu:z $pause $only | whose ,hu:z $pause $only | ||||
| what ,w0t $strend2 $onlys | what ,w0t $strend2 $onlys | ||||
| how ,haU $strend2 $onlys | how ,haU $strend2 $onlys |
| ë E | ë E | ||||
| ï i: | ï i: | ||||
| ö 3: | ö 3: | ||||
| ?5 ö VR | |||||
| ü u: | ü u: | ||||
| ç s | ç s | ||||
| ß s | ß s | ||||
| ?3 \\ bakslaS | ?3 \\ bakslaS | ||||
| ?3 / slaS | ?3 / slaS | ||||
| ' | ' | ||||
| £ paUnd | |||||
| ! _:Ekskl@meIS@n_: | ! _:Ekskl@meIS@n_: | ||||
| !) ! | !) ! | ||||
| ? (? kwEstS@nmA@ks | ? (? kwEstS@nmA@ks | ||||
| %) % (% | %) % (% | ||||
| %%) % (_ _:: | %%) % (_ _:: | ||||
| // extra symbols | |||||
| ¥ jEn | |||||
| § sEkS@n | |||||
| // extra symbols (mostly in en_list) | |||||
| ¶ par@graf | ¶ par@graf | ||||
| ¶¶ par@grafs | ¶¶ par@grafs | ||||
| ¤ kVr@nsI2saIn | |||||
| © k0pI2raIt | |||||
| ° dI2gri:z | |||||
| − maIn@s | |||||
| ± plVs@maIn@s | |||||
| µ maIkroU | |||||
| ¼ a2kwO@t3 | |||||
| ½ a2hA:f | |||||
| ¾ Tri:kwO@t3 | |||||
| × taImz | |||||
| ÷ dI2vaIdbaI | |||||
| € jU@roUz | |||||
| ♯ SA@p | |||||
| ♭ flat |
| // This file in UTF8 encoded | // This file in UTF8 encoded | ||||
| // letters | // letters | ||||
| ch tSe | |||||
| ll Ejje | |||||
| _cap m'aJ^us | |||||
| _?? s'imbolo | |||||
| _#32 Esp'aTjo | |||||
| // names of symbols | |||||
| _. punto | |||||
| _, koma | |||||
| _; p,untoik'oma | |||||
| _: d,osp'untos | |||||
| _! TE*R'aRaDmi**aTj'on | |||||
| _? TE*R'aRintE*R,oQaTj'on | |||||
| _¡ aB@-*'iRaDmi**aTj'on | |||||
| _¿ aB@-*'iRintE*R,oQaTj'on | |||||
| _= iQw'al | |||||
| _< mEn'oRke | |||||
| _> maJ^'oRke | |||||
| _' apost@-*'ofo | |||||
| _" kom'iJ^as | |||||
| _+ s'iQnodesum'aR | |||||
| _$ dolar | |||||
| _# almoaD'il^a | |||||
| _* astE*'isko | |||||
| _- gJ^on | |||||
| __ suB@-*aJ^'aDo | |||||
| _/ ba*Ra | |||||
| _\ b'a*RaimbERt'iDa | |||||
| _` aT'Entog@-*'aBe | |||||
| _( ,aB@-*epa**'EntEsis | |||||
| _) Tj,E*Rapa**'EntEsis | |||||
| _[ ,aB@-*ekoRtS'Ete | |||||
| _] Tj,E*RakoRtS'Ete | |||||
| _{ ,aB@-*eJ^'aBe | |||||
| _} Tj,E*RaJ^'aBe | |||||
| _« kom'iJ^as||iTkJ^'ERDas | |||||
| _» kom'iJ^as||dE**'EtSas | |||||
| ^ TiRkumfl'Exo | |||||
| € eU*o | |||||
| % porTj'Ento | |||||
| & ampERs'ant | |||||
| @ a*R'oBa | |||||
| / ba*Ra | |||||
| © kopi*R'aIt | |||||
| £ liB@-*as | |||||
| ¶ p'a*Rafo | |||||
| § sEkTj'on | |||||
| // numbers | // numbers | ||||
| x Ekis | x Ekis | ||||
| _y ,ig@-*'iEQa | _y ,ig@-*'iEQa | ||||
| y ,ig@-*'iEQa $atend | y ,ig@-*'iEQa $atend | ||||
| ch tSe | |||||
| ll Ejje | |||||
| á 'a||aTEntw'aDa | |||||
| é 'e||aTEntw'aDa | |||||
| í 'i||aTEntw'aDa | |||||
| _ó 'o||aTEntw'aDa | |||||
| ó 'o||aTEntw'aDa $atend | |||||
| ú 'u||aTEntw'aDa | |||||
| ü ,uDjE**'Esis | |||||
| _. punto | |||||
| _)ñ (_ En^e | _)ñ (_ En^e | ||||
| $ d'olar | $ d'olar | ||||
| € eU*o | |||||
| % porTj'Ento | |||||
| & ampErs'ant | |||||
| @ a*R'oBa | |||||
| / b'a*Ra | |||||
| © k,opi*R'aIt | |||||
| + m'as | + m'as | ||||
| _) ++ (_ masm'as | _) ++ (_ masm'as |
| // character names | // character names | ||||
| //_cap k,ap@-t@L | |||||
| _?A lEt@ | |||||
| _?? sE~b'OL | |||||
| //_cap k,ap@-t@L | |||||
| _?A lEt@ | |||||
| _?? sE~b'OL | |||||
| _#9 tabylasjO~ | |||||
| _#32 Espas | |||||
| _" gijmE | _" gijmE | ||||
| _# djEz | _# djEz |
| // 2006-11-18 Gilles Casse <[email protected]> | // 2006-11-18 Gilles Casse <[email protected]> | ||||
| // | // | ||||
| // Updated: 2008-01-29 Michel Such <[email protected]> | |||||
| // Updated: 2008-02-04 Michel Such <[email protected]> | |||||
| // | // | ||||
| // * The rules are based on Cicero TTS. | // * The rules are based on Cicero TTS. | ||||
| // | // | ||||
| em (b A~ // décembre | em (b A~ // décembre | ||||
| em (m A~ // emmancher | em (m A~ // emmancher | ||||
| em (p A~ | em (p A~ | ||||
| en (_ A~ // en | |||||
| en (_ A~n2 // en | |||||
| en (hA A~n // enharmonique | en (hA A~n // enharmonique | ||||
| en (A A~n // enivrer | en (A A~n // enivrer | ||||
| en (_A A~n // en avion | |||||
| C) en (d_ A~ // comprend dépend | C) en (d_ A~ // comprend dépend | ||||
| C) en (ds_ A~ | C) en (ds_ A~ | ||||
| _) h (ac _! // hache | _) h (ac _! // hache | ||||
| _) h (ai _! // haine haillon | _) h (ai _! // haine haillon | ||||
| _) h (al _! // halte | _) h (al _! // halte | ||||
| _) h (amea _! // hameau | |||||
| _) h (amp _! // hampe | _) h (amp _! // hampe | ||||
| _) h (an _! // hanche | _) h (an _! // hanche | ||||
| _) h (app _! // happer | _) h (app _! // happer | ||||
| _) h (au _! // haut | _) h (au _! // haut | ||||
| _) h (av _! // havre | _) h (av _! // havre | ||||
| _) h (ern _! // hernie | _) h (ern _! // hernie | ||||
| _) h (éro _! // héros, héron | |||||
| _) h (ers _! // herse | _) h (ers _! // herse | ||||
| _) h (eurt _! // heurter | _) h (eurt _! // heurter | ||||
| _) h (ibo _! // hibou | _) h (ibo _! // hibou | ||||
| A) s (oft s // microsoft | A) s (oft s // microsoft | ||||
| y) s (A z // paysage | y) s (A z // paysage | ||||
| CCan) s (A z // transition | CCan) s (A z // transition | ||||
| xpan) s (A s // expansion | |||||
| ibu) s (_ s | ibu) s (_ s | ||||
| um (b W~ // humble | um (b W~ // humble | ||||
| um (p W~ | um (p W~ | ||||
| un (C W~ // emprunt lundi | un (C W~ // emprunt lundi | ||||
| un (_ W~ // brun | |||||
| un (_A W~n // un avion | |||||
| C) un (_ W~ // brun | |||||
| uc) un (_ W~n2 // aucun | |||||
| un (_ W~n2 // un avion | |||||
| g) u (A // fatigue | g) u (A // fatigue | ||||
| g) u (ï y // ambiguïté | g) u (ï y // ambiguïté | ||||
| n En | n En | ||||
| p pe: | p pe: | ||||
| q ku-: | q ku-: | ||||
| r Err | |||||
| r E:R | |||||
| s Es | s Es | ||||
| t te: | t te: | ||||
| v ve: | v ve: |
| // This file is UTF8 encoded | |||||
| // Spelling-to-phoneme words for Turkish | |||||
| a a | |||||
| b be | |||||
| c dZE | |||||
| ç tSE | |||||
| d dE | |||||
| e E | |||||
| f fE | |||||
| g g;E | |||||
| ğ jumuS'ak||g;'E | |||||
| h hE | |||||
| ı u# | |||||
| i i | |||||
| j ZE | |||||
| k ka | |||||
| l lE | |||||
| m mE | |||||
| n nE | |||||
| o O | |||||
| ö W | |||||
| p pE | |||||
| q kvE | |||||
| r RE | |||||
| s sE | |||||
| ş SE | |||||
| t tE | |||||
| u u | |||||
| ü y | |||||
| v vE | |||||
| w dubElv'E | |||||
| x Eks | |||||
| y jE | |||||
| z zE | |||||
| _?? sEmb'Ol | |||||
| _0 su#fu#r | |||||
| _1 bir | |||||
| _2 iki | |||||
| _3 YtS | |||||
| _4 dWrt | |||||
| _5 beS | |||||
| _6 altu# | |||||
| _7 jedi | |||||
| _8 sekiz | |||||
| _9 dokuz | |||||
| _10 on | |||||
| _1X on | |||||
| _2X jirmi | |||||
| _3X otuz | |||||
| _4X ku#rk | |||||
| _5X elli | |||||
| _6X altmu#S | |||||
| _7X jetmiS | |||||
| _8X seksEn | |||||
| _9X doksan | |||||
| _0C jyz | |||||
| _0M1 bIn | |||||
| _0M2 miljon | |||||
| _0M3 miljar | |||||
| _dpt _virg,Yl | |||||
| // exceptions | |||||
| ankara $1 | |||||
| // Turkish translation rules | |||||
| // This file is UTF-8 encoded | |||||
| .group a | |||||
| a a | |||||
| .group b | |||||
| b b | |||||
| .group c | |||||
| c dZ | |||||
| .group ç | |||||
| ç tS | |||||
| .group d | |||||
| d d | |||||
| .group e | |||||
| e e | |||||
| .group f | |||||
| f f | |||||
| .group g | |||||
| g g | |||||
| .group ğ | |||||
| ğ Q | |||||
| A) ğ : | |||||
| .group h | |||||
| h h | |||||
| .group i | |||||
| i i | |||||
| .group ı | |||||
| ı u# | |||||
| .group j | |||||
| j Z | |||||
| .group k | |||||
| k k | |||||
| .group l | |||||
| l l | |||||
| .group m | |||||
| m m | |||||
| @) ma (_S2 m%a | |||||
| @) me (_S2 m%e | |||||
| @) mı (_S2 m%u# | |||||
| .group n | |||||
| n n | |||||
| .group o | |||||
| o o | |||||
| .group ö | |||||
| ö W | |||||
| .group p | |||||
| p p | |||||
| .group q | |||||
| q k | |||||
| .group r | |||||
| r r | |||||
| .group s | |||||
| s s | |||||
| .group ş | |||||
| ş S | |||||
| .group t | |||||
| t t | |||||
| .group u | |||||
| u u | |||||
| .group ü | |||||
| ü y | |||||
| .group v | |||||
| v v | |||||
| .group w | |||||
| w v | |||||
| .group x | |||||
| x ks | |||||
| .group y | |||||
| y j | |||||
| .group z | |||||
| z z | |||||
| .group | |||||
| $ dolar |
| <tr><td><code>[aU]</code><td>m<b>ou</b>th | <tr><td><code>[aU]</code><td>m<b>ou</b>th | ||||
| <tr><td><code>[oU]</code><td>g<b>oa</b>t | <tr><td><code>[oU]</code><td>g<b>oa</b>t | ||||
| <tr><td><code>[aI@]</code> | |||||
| <tr><td><code>[aU@]</code> | |||||
| <tr><td><code>[aI@]</code><td>sc<b>ie</b>nce | |||||
| <tr><td><code>[aU@]</code><td>h<b>our</b> | |||||
| </tbody> | </tbody> | ||||
| </table> | </table> | ||||
| language nb | language nb | ||||
| gender male | gender male | ||||
| intonation 4 |
| name turkish-test | |||||
| language tr | |||||
| gender male | |||||
| 46 phoneme tables | |||||
| 47 phoneme tables | |||||
| new total | new total | ||||
| base 98 98 | |||||
| base2 24 117 | |||||
| en 54 147 | |||||
| en_n 30 147 | |||||
| en_us 34 147 | |||||
| en_sc 39 149 | |||||
| en_rp 34 147 | |||||
| en_wm 30 147 | |||||
| en_wi 30 147 | |||||
| af 38 130 | |||||
| cy 29 124 | |||||
| de 33 125 | |||||
| eo 13 110 | |||||
| jbo 4 111 | |||||
| fi 40 129 | |||||
| fr 42 122 | |||||
| fr_ca 11 122 | |||||
| hi 50 134 | |||||
| ta 15 136 | |||||
| hu 23 114 | |||||
| nl 28 121 | |||||
| pl 15 109 | |||||
| sk 29 127 | |||||
| cs 6 127 | |||||
| hr 20 132 | |||||
| mk 3 133 | |||||
| sr 14 132 | |||||
| ru 38 128 | |||||
| it 17 120 | |||||
| la 21 116 | |||||
| es 7 117 | |||||
| pt 27 133 | |||||
| pt_pt 20 133 | |||||
| ro 36 141 | |||||
| el 8 117 | |||||
| grc 12 122 | |||||
| sv 25 120 | |||||
| no 28 124 | |||||
| is 32 123 | |||||
| vi 42 136 | |||||
| zhy 40 131 | |||||
| zh 62 146 | |||||
| sw 14 107 | |||||
| th 50 141 | |||||
| id 14 119 | |||||
| ja 7 103 | |||||
| base 99 99 | |||||
| base2 24 118 | |||||
| en 54 148 | |||||
| en_n 30 148 | |||||
| en_us 34 148 | |||||
| en_sc 39 150 | |||||
| en_rp 34 148 | |||||
| en_wm 30 148 | |||||
| en_wi 30 148 | |||||
| af 38 131 | |||||
| cy 29 125 | |||||
| de 33 126 | |||||
| eo 13 111 | |||||
| jbo 4 112 | |||||
| fi 40 130 | |||||
| fr 43 124 | |||||
| fr_ca 11 124 | |||||
| hi 50 135 | |||||
| ta 15 137 | |||||
| hu 23 115 | |||||
| nl 28 122 | |||||
| pl 15 110 | |||||
| sk 29 128 | |||||
| cs 6 128 | |||||
| hr 20 133 | |||||
| mk 3 134 | |||||
| sr 14 133 | |||||
| ru 38 129 | |||||
| it 17 121 | |||||
| la 21 117 | |||||
| es 7 118 | |||||
| pt 27 134 | |||||
| pt_pt 20 134 | |||||
| ro 36 142 | |||||
| el 8 118 | |||||
| grc 12 123 | |||||
| sv 25 121 | |||||
| no 28 125 | |||||
| is 32 124 | |||||
| vi 42 137 | |||||
| zhy 40 132 | |||||
| zh 62 147 | |||||
| sw 14 108 | |||||
| th 50 142 | |||||
| id 14 120 | |||||
| tr 14 123 | |||||
| ja 7 104 | |||||
| Data file Used by | Data file Used by | ||||
| b/b [b] base | b/b [b] base | ||||
| [n;] ro | [n;] ro | ||||
| [n] zh | [n] zh | ||||
| n/n_ [n] base | n/n_ [n] base | ||||
| [n2] fr | |||||
| [n;] ro | [n;] ro | ||||
| n/n@ [(@)] base | n/n@ [(@)] base | ||||
| n/n#_ [n#] is | n/n#_ [n#] is | ||||
| [a] la | [a] la | ||||
| [a] sv | [a] sv | ||||
| [a] sw | [a] sw | ||||
| [a] tr | |||||
| vowel/aa [a] fi | vowel/aa [a] fi | ||||
| [A] fr_ca | [A] fr_ca | ||||
| [A] no | [A] no | ||||
| [E] is | [E] is | ||||
| [E] id | [E] id | ||||
| [E2] id | [E2] id | ||||
| [E] tr | |||||
| [e] ja | [e] ja | ||||
| vowel/e_mid2 [E] af | vowel/e_mid2 [E] af | ||||
| [E] de | [E] de | ||||
| [e] ro | [e] ro | ||||
| [e] el | [e] el | ||||
| [e] sw | [e] sw | ||||
| [e] tr | |||||
| vowel/@_fnt [@] en_wi | vowel/@_fnt [@] en_wi | ||||
| [@2] en_wi | [@2] en_wi | ||||
| [@2] hr | [@2] hr | ||||
| [i] ta | [i] ta | ||||
| [i] hr | [i] hr | ||||
| [i] id | [i] id | ||||
| [i] tr | |||||
| vowel/i#_7 [i[] zh | vowel/i#_7 [i[] zh | ||||
| vowel/i_en [i:] en | vowel/i_en [i:] en | ||||
| [i:] fr | [i:] fr | ||||
| [I] hr | [I] hr | ||||
| [I] sv | [I] sv | ||||
| [I] no | [I] no | ||||
| [I] tr | |||||
| vowel/ii_4 [I] en | vowel/ii_4 [I] en | ||||
| [I2] en | [I2] en | ||||
| [I] en_n | [I] en_n | ||||
| [W] af | [W] af | ||||
| [W] de | [W] de | ||||
| vowel/oe_2 [W] no | vowel/oe_2 [W] no | ||||
| [W] tr | |||||
| vowel/oe_4 [W] sv | vowel/oe_4 [W] sv | ||||
| vowel/o_mid [O] fr | vowel/o_mid [O] fr | ||||
| [o] hu | [o] hu | ||||
| [o] tr | |||||
| vowel/oo [O:] en_sc | vowel/oo [O:] en_sc | ||||
| [O] en_wi | [O] en_wi | ||||
| [O:] en_wi | [O:] en_wi | ||||
| [O] th | [O] th | ||||
| [O:] th | [O:] th | ||||
| [O] id | [O] id | ||||
| [O] tr | |||||
| [o] ja | [o] ja | ||||
| vowel/oo_1 [O:] en_n | vowel/oo_1 [O:] en_n | ||||
| [O:] en_rp | [O:] en_rp | ||||
| [u] id | [u] id | ||||
| vowel/u# [u-] en | vowel/u# [u-] en | ||||
| [u:] en_sc | [u:] en_sc | ||||
| [Y] tr | |||||
| vowel/u_2 [u1] fi | vowel/u_2 [u1] fi | ||||
| [u] sk | [u] sk | ||||
| [U] hr | [U] hr | ||||
| [u] ro | [u] ro | ||||
| [u] tr | |||||
| vowel/u#_2 [u-] ta | vowel/u#_2 [u-] ta | ||||
| [u-] sv | [u-] sv | ||||
| vowel/u_3 [yU] ro | vowel/u_3 [yU] ro | ||||
| [u] pt_pt | [u] pt_pt | ||||
| vowel/u#_6 [u:] en_us | vowel/u#_6 [u:] en_us | ||||
| vowel/u_7 [u] vi | vowel/u_7 [u] vi | ||||
| vowel/u#_7 [u#] tr | |||||
| vowel/u_bck [u] base2 | vowel/u_bck [u] base2 | ||||
| [U] cy | [U] cy | ||||
| [u] fi | [u] fi | ||||
| vowel/uu_2 [U] base2 | vowel/uu_2 [U] base2 | ||||
| [U] de | [U] de | ||||
| [U] ta | [U] ta | ||||
| [U] tr | |||||
| vowel/uu_3 [u] af | vowel/uu_3 [u] af | ||||
| vowel/uu_4 [U] fi | vowel/uu_4 [U] fi | ||||
| [U] sv | [U] sv | ||||
| vowel/y#_3 [W] is | vowel/y#_3 [W] is | ||||
| vowel/y_4 [y:] no | vowel/y_4 [y:] no | ||||
| vowel/y_5 [y:] sv | vowel/y_5 [y:] sv | ||||
| [y] tr | |||||
| vowel/yy [y"] fr_ca | vowel/yy [y"] fr_ca | ||||
| [y] no | [y] no | ||||
| vowel/yy_3 [y] sv | vowel/yy_3 [y] sv |
| vowelout f1=2 f2=1700 -300 300 f3=-100 80 | vowelout f1=2 f2=1700 -300 300 f3=-100 80 | ||||
| formants d/tap2+x/d%70 | formants d/tap2+x/d%70 | ||||
| after @ d/x_tap | after @ d/x_tap | ||||
| lengthmod 2 | |||||
| lengthmod 5 | |||||
| endphoneme | endphoneme | ||||
| endphoneme | endphoneme | ||||
| phoneme n2 | |||||
| beforenotvowel NULL | |||||
| vcd alv nasal | |||||
| vowelout f1=2 f2=1700 -300 250 f3=-100 80 rms=20 brk | |||||
| length 100 | |||||
| lengthmod 4 | |||||
| formants n/n_ | |||||
| before _ n/n_ | |||||
| endphoneme | |||||
| phoneme p | phoneme p | ||||
| vls blb stop | vls blb stop | ||||
| vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11 | vowelin f1=0 f2=1000 -50 -100 f3=-200 80 amp=11 |
| phoneme Yy | phoneme Yy | ||||
| vowel starttype (@) endtype (u) | vowel starttype (@) endtype (u) | ||||
| length 270 | length 270 | ||||
| long | |||||
| formants vwl_no/y#y | formants vwl_no/y#y | ||||
| endphoneme | endphoneme | ||||
| phoneme i | |||||
| vowel starttype (i) endtype (i) | |||||
| beforenotvowel2 I | |||||
| length 150 | |||||
| formants vowel/i_6 | |||||
| endphoneme | |||||
| phoneme I | |||||
| vowel starttype (i) endtype (i) | |||||
| length 150 | |||||
| formants vowel/ii_3 | |||||
| endphoneme | |||||
| phoneme y | |||||
| vowel starttype (u) endtype (u) | |||||
| beforenotvowel2 Y | |||||
| length 155 | |||||
| formants vowel/y_5 | |||||
| endphoneme | |||||
| phoneme Y | |||||
| vowel starttype (u) endtype (u) | |||||
| length 155 | |||||
| formants vowel/u# | |||||
| endphoneme | |||||
| phoneme e | |||||
| vowel starttype (e) endtype (e) | |||||
| beforenotvowel2 E | |||||
| length 180 | |||||
| formants vowel/e_mid2 | |||||
| endphoneme | |||||
| phoneme E | |||||
| vowel starttype (e) endtype (e) | |||||
| length 180 | |||||
| formants vowel/e_mid | |||||
| endphoneme | |||||
| phoneme W | |||||
| vowel starttype (@) endtype (@) | |||||
| length 180 | |||||
| formants vowel/oe_2 | |||||
| endphoneme | |||||
| phoneme a | |||||
| vowel starttype (a) endtype (a) | |||||
| length 190 | |||||
| formants vowel/a_5 | |||||
| endphoneme | |||||
| phoneme u | |||||
| vowel starttype (u) endtype (u) | |||||
| beforenotvowel2 U | |||||
| length 150 | |||||
| formants vowel/u_2 | |||||
| endphoneme | |||||
| phoneme U | |||||
| vowel starttype (u) endtype (u) | |||||
| length 150 | |||||
| formants vowel/uu_2 | |||||
| endphoneme | |||||
| phoneme u# | |||||
| vowel starttype (@) endtype (@) | |||||
| length 150 | |||||
| formants vowel/u#_7 | |||||
| endphoneme | |||||
| phoneme o | |||||
| vowel starttype (o) endtype (o) | |||||
| beforenotvowel2 O | |||||
| length 190 | |||||
| formants vowel/o_mid | |||||
| endphoneme | |||||
| phoneme O | |||||
| vowel starttype (o) endtype (o) | |||||
| length 190 | |||||
| formants vowel/oo | |||||
| endphoneme | |||||
| phonemenumber 25 t# // reduced version of [t] | phonemenumber 25 t# // reduced version of [t] | ||||
| phonemenumber 26 '! // stress - emphasized | phonemenumber 26 '! // stress - emphasized | ||||
| phonemenumber 27 _;_ // clause pause | phonemenumber 27 _;_ // clause pause | ||||
| phonemenumber 28 _^^ // Change language + phoneme table number | |||||
| // The base phoneme table contains the utility phonemes, the consonants, | // The base phoneme table contains the utility phonemes, the consonants, | ||||
| // and a schwa. The vowels are defined in the language specific phoneme | // and a schwa. The vowels are defined in the language specific phoneme | ||||
| lengthmod 1 | lengthmod 1 | ||||
| endphoneme | endphoneme | ||||
| phoneme _^^ // Change phoneme table (followed by phoneme table number) | |||||
| pause | |||||
| starttype _ endtype _ | |||||
| length 1 | |||||
| lengthmod 1 | |||||
| endphoneme | |||||
| phoneme _X1 // a language specific action | phoneme _X1 // a language specific action | ||||
| pause | pause | ||||
| starttype _ endtype _ | starttype _ endtype _ | ||||
| phonemetable id base2 | phonemetable id base2 | ||||
| include ph_indonesian | include ph_indonesian | ||||
| phonemetable tr base2 | |||||
| include ph_turkish | |||||
| phonemetable ja base | phonemetable ja base | ||||
| include ph_japanese | include ph_japanese |
| #define tOLDNAME 14 | #define tOLDNAME 14 | ||||
| #define tREDUCETO 15 | #define tREDUCETO 15 | ||||
| #define tFIXEDCODE 16 | #define tFIXEDCODE 16 | ||||
| #define tBEFOREVOWEL 17 | #define tBEFOREVOWEL 17 | ||||
| #define tBEFOREVOWELPAUSE 18 | #define tBEFOREVOWELPAUSE 18 | ||||
| #define tBEFORENOTVOWEL 19 | #define tBEFORENOTVOWEL 19 | ||||
| #define tLINKOUT 20 | |||||
| #define tBEFORENOTVOWEL2 20 | |||||
| #define tSWITCHVOICING 21 | #define tSWITCHVOICING 21 | ||||
| #define tVOWELIN 22 | |||||
| #define tVOWELOUT 23 | |||||
| #define tAPPENDPH 24 // always insert another phoneme (linkout) after this one | |||||
| #define tIMPORTPH 25 | |||||
| #define tBEFOREPAUSE 26 | |||||
| #define tLINKOUT 23 | |||||
| #define tVOWELIN 24 | |||||
| #define tVOWELOUT 25 | |||||
| #define tAPPENDPH 26 // always insert another phoneme (linkout) after this one | |||||
| #define tIMPORTPH 27 | |||||
| #define tBEFOREPAUSE 28 | |||||
| #define tPHONEMENUMBER 29 | #define tPHONEMENUMBER 29 | ||||
| #define tPHONEMETABLE 30 | #define tPHONEMETABLE 30 | ||||
| #define tINCLUDE 31 | #define tINCLUDE 31 | ||||
| static const int flags_alternative[] = {phBEFOREVOWEL,phBEFOREVOWELPAUSE,phBEFORENOTVOWEL,phBEFORENOTVOWEL2,phSWITCHVOICING}; | |||||
| extern void Write4Bytes(FILE *f, int value); | extern void Write4Bytes(FILE *f, int value); | ||||
| extern int Read4Bytes(FILE *f); | extern int Read4Bytes(FILE *f); | ||||
| extern void MakeVowelLists(void); | extern void MakeVowelLists(void); | ||||
| {"length", 12}, | {"length", 12}, | ||||
| {"longlength", 13}, | {"longlength", 13}, | ||||
| {"reduceto", 15}, | {"reduceto", 15}, | ||||
| {"beforevowel", 17}, | |||||
| {"beforevowelpause", 18}, | |||||
| {"beforenotvowel",19}, | |||||
| {"linkout",20}, | |||||
| {"switchvoicing",21}, | |||||
| {"vowelin",22}, | |||||
| {"vowelout",23}, | |||||
| {"appendph",24}, | |||||
| {"import_phoneme",25}, | |||||
| {"beforepause",26}, | |||||
| {"beforevowel", tBEFOREVOWEL}, | |||||
| {"beforevowelpause", tBEFOREVOWELPAUSE}, | |||||
| {"beforenotvowel",tBEFORENOTVOWEL}, | |||||
| {"beforenotvowel2",tBEFORENOTVOWEL2}, | |||||
| {"linkout",tLINKOUT}, | |||||
| {"switchvoicing",tSWITCHVOICING}, | |||||
| {"vowelin",tVOWELIN}, | |||||
| {"vowelout",tVOWELOUT}, | |||||
| {"appendph",tAPPENDPH}, | |||||
| {"import_phoneme",tIMPORTPH}, | |||||
| {"beforepause",tBEFOREPAUSE}, | |||||
| // flags | // flags | ||||
| {"wavef", 0x2000000+phWAVE}, | {"wavef", 0x2000000+phWAVE}, | ||||
| ph->phflags = (ph->phflags & 0xfffffff) + (value << 28); | ph->phflags = (ph->phflags & 0xfffffff) + (value << 28); | ||||
| break; | break; | ||||
| case tBEFORENOTVOWEL: | |||||
| ph->phflags |= phBEFORENOTVOWEL; // and drop through to tBEFOREVOWEL | |||||
| case tBEFOREVOWELPAUSE: | |||||
| ph->phflags |= phBEFOREVOWELPAUSE; | |||||
| case tBEFOREVOWEL: | case tBEFOREVOWEL: | ||||
| if((phcode = NextItem(tPHONEMEMNEM)) == -1) | |||||
| phcode = LookupPhoneme(item_string,1); | |||||
| ph->alternative_ph = phcode; | |||||
| break; | |||||
| case tBEFOREVOWELPAUSE: | |||||
| case tBEFORENOTVOWEL: | |||||
| case tBEFORENOTVOWEL2: | |||||
| case tSWITCHVOICING: | case tSWITCHVOICING: | ||||
| ph->phflags |= phSWITCHVOICING; | |||||
| ph->phflags |= flags_alternative[item - tBEFOREVOWEL]; | |||||
| if((phcode = NextItem(tPHONEMEMNEM)) == -1) | if((phcode = NextItem(tPHONEMEMNEM)) == -1) | ||||
| phcode = LookupPhoneme(item_string,1); | phcode = LookupPhoneme(item_string,1); | ||||
| ph->alternative_ph = phcode; | ph->alternative_ph = phcode; |
| } | } | ||||
| break; | break; | ||||
| case 7: // LANG=tr, the last syllable for any vowel markes explicitly as unstressed | |||||
| if(stressed_syllable == 0) | |||||
| { | |||||
| stressed_syllable = vowel_count - 1; | |||||
| for(ix=2; ix < vowel_count; ix++) | |||||
| { | |||||
| if(vowel_stress[ix] == 1) | |||||
| { | |||||
| stressed_syllable = ix-1; | |||||
| break; | |||||
| } | |||||
| } | |||||
| vowel_stress[stressed_syllable] = 4; | |||||
| max_stress = 4; | |||||
| } | |||||
| break; | |||||
| case 9: // mark all as stressed | case 9: // mark all as stressed | ||||
| for(ix=1; ix<vowel_count; ix++) | for(ix=1; ix<vowel_count; ix++) | ||||
| { | { |
| const char* text1 = "Hello, World2 <mark name=\"mark2\"/>. This is the second sentence"; | |||||
| const char* text1 = "Hello world. Testing."; | |||||
| void TestTest(int control) | void TestTest(int control) | ||||
| {//======================= | {//======================= | ||||
| f_wavtest = OpenWaveFile3("/home/jsd1/speechdata/text/test.wav"); | f_wavtest = OpenWaveFile3("/home/jsd1/speechdata/text/test.wav"); | ||||
| f_events = fopen("/home/jsd1/speechdata/text/events","w"); | f_events = fopen("/home/jsd1/speechdata/text/events","w"); | ||||
| fprintf(f_events,"Type Audio Text Length Id\n"); | |||||
| fprintf(f_events,"Type Audio Text Length Id\n"); | |||||
| fclose(f_events); | fclose(f_events); | ||||
| espeak_Initialize(AUDIO_OUTPUT_PLAYBACK,1000,NULL,0); | |||||
| espeak_Initialize(AUDIO_OUTPUT_RETRIEVAL,1000,NULL,1); | |||||
| espeak_SetSynthCallback(TestSynthCallback); | espeak_SetSynthCallback(TestSynthCallback); | ||||
| espeak_SetUriCallback(TestUriCallback); | espeak_SetUriCallback(TestUriCallback); | ||||
| #include "speech.h" | #include "speech.h" | ||||
| #include "phoneme.h" | #include "phoneme.h" | ||||
| #include "synthesize.h" | #include "synthesize.h" | ||||
| #include "voice.h" | |||||
| #include "translate.h" | #include "translate.h" | ||||
| char ph_stress[2]; | char ph_stress[2]; | ||||
| char ph_buf3[30]; | char ph_buf3[30]; | ||||
| if((letter <= 32) || iswspace(letter)) | |||||
| { | |||||
| // lookup space as _&32 etc. | |||||
| sprintf(&single_letter[1],"_#%d ",letter); | |||||
| Lookup(&single_letter[1],ph_buf1); | |||||
| return; | |||||
| } | |||||
| len = utf8_out(letter,&single_letter[2]); | len = utf8_out(letter,&single_letter[2]); | ||||
| single_letter[len+2] = ' '; | single_letter[len+2] = ' '; | ||||
| int n_bytes; | int n_bytes; | ||||
| int letter; | int letter; | ||||
| int len; | int len; | ||||
| int phoneme_tab_en; | |||||
| char *p2; | char *p2; | ||||
| char *pbuf; | char *pbuf; | ||||
| char capital[20]; | char capital[20]; | ||||
| char ph_buf[50]; | |||||
| char ph_buf2[50]; | |||||
| char ph_buf[60]; | |||||
| char ph_buf2[60]; | |||||
| char ph_buf_en[60]; | |||||
| char hexbuf[6]; | char hexbuf[6]; | ||||
| static char single_letter[10] = {0,0}; | static char single_letter[10] = {0,0}; | ||||
| } | } | ||||
| letter = towlower(letter); | letter = towlower(letter); | ||||
| if((letter <= 32) || iswspace(letter)) | |||||
| { | |||||
| // lookup space as _&32 etc. | |||||
| sprintf(&single_letter[1],"_#%d ",letter); | |||||
| Lookup(&single_letter[1],ph_buf); | |||||
| strcat(phonemes,ph_buf); | |||||
| return(n_bytes); | |||||
| } | |||||
| LookupLetter(letter, word[n_bytes], ph_buf); | LookupLetter(letter, word[n_bytes], ph_buf); | ||||
| if(ph_buf[0] == phonSWITCH) | if(ph_buf[0] == phonSWITCH) | ||||
| strcpy(phonemes,ph_buf); | strcpy(phonemes,ph_buf); | ||||
| return(0); | return(0); | ||||
| } | } | ||||
| if(ph_buf[0] == 0) | |||||
| { | |||||
| phoneme_tab_en = SetTranslator2("en"); | |||||
| translator2->LookupLetter(letter, word[n_bytes], ph_buf_en); | |||||
| if(ph_buf_en[0] != 0) | |||||
| { | |||||
| sprintf(ph_buf,"%c%c%s%c%c",phonSWITCH2, phoneme_tab_en + phonTOP, ph_buf_en, phonSWITCH2, voice->phoneme_tab_ix + phonTOP); | |||||
| } | |||||
| SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | |||||
| } | |||||
| if(ph_buf[0] == 0) | if(ph_buf[0] == 0) | ||||
| { | { | ||||
| // character name not found | // character name not found | ||||
| void Translator::SetSpellingStress(char *phonemes, int control) | |||||
| {//============================================================ | |||||
| void Translator::SetSpellingStress(char *phonemes, int control, int n_chars) | |||||
| {//========================================================================= | |||||
| // Individual letter names, reduce the stress of some. | // Individual letter names, reduce the stress of some. | ||||
| int ix; | int ix; | ||||
| unsigned int c; | unsigned int c; | ||||
| count = 0; | count = 0; | ||||
| for(ix=0; (c = buf[ix]) != 0; ix++) | for(ix=0; (c = buf[ix]) != 0; ix++) | ||||
| { | { | ||||
| if(c == phonSTRESS_P) | |||||
| if((c == phonSTRESS_P) && (n_chars > 1)) | |||||
| { | { | ||||
| count++; | count++; | ||||
| #define phTRILL 0x80 | #define phTRILL 0x80 | ||||
| #define phVOWEL2 0x100 // liquid that is considered a vowel | #define phVOWEL2 0x100 // liquid that is considered a vowel | ||||
| #define phPALATAL 0x200 | #define phPALATAL 0x200 | ||||
| #define phLONG 0x1000 | |||||
| #define phAPPENDPH 0x2000 // always insert another phoneme (link_out) after this one | #define phAPPENDPH 0x2000 // always insert another phoneme (link_out) after this one | ||||
| #define phBRKAFTER 0x4000 // [*] add a post-pause | #define phBRKAFTER 0x4000 // [*] add a post-pause | ||||
| #define phBEFOREPAUSE 0x8000 // replace with the link_out phoneme if the next phoneme is a pause | #define phBEFOREPAUSE 0x8000 // replace with the link_out phoneme if the next phoneme is a pause | ||||
| #define phALTERNATIVE 0x0c00 // bits 10,11 specifying use of alternative_ph | |||||
| #define phALTERNATIVE 0x1c00 // bits 10,11,12 specifying use of alternative_ph | |||||
| #define phBEFOREVOWEL 0x0000 | #define phBEFOREVOWEL 0x0000 | ||||
| #define phBEFOREVOWELPAUSE 0x0400 | #define phBEFOREVOWELPAUSE 0x0400 | ||||
| #define phBEFORENOTVOWEL 0x0c00 | #define phBEFORENOTVOWEL 0x0c00 | ||||
| #define phBEFORENOTVOWEL2 0x1000 | |||||
| #define phSWITCHVOICING 0x0800 | #define phSWITCHVOICING 0x0800 | ||||
| #define phNONSYLLABIC 0x100000 // don't count this vowel as a syllable when finding the stress position | #define phNONSYLLABIC 0x100000 // don't count this vowel as a syllable when finding the stress position | ||||
| #define phLONG 0x200000 | |||||
| // fixed phoneme code numbers, these can be used from the program code | // fixed phoneme code numbers, these can be used from the program code | ||||
| #define phonCONTROL 1 | #define phonCONTROL 1 | ||||
| #define phonT_REDUCED 25 | #define phonT_REDUCED 25 | ||||
| #define phonSTRESS_TONIC 26 | #define phonSTRESS_TONIC 26 | ||||
| #define phonPAUSE_CLAUSE 27 | #define phonPAUSE_CLAUSE 27 | ||||
| #define phonSWITCH2 28 | |||||
| #define phonTOP 28 // highest pre-defined phoneme number | |||||
| extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop | extern const unsigned char pause_phonemes[8]; // 0, vshort, short, pause, long, glottalstop | ||||
| alternative = ph->alternative_ph; | alternative = ph->alternative_ph; | ||||
| break; | break; | ||||
| case phBEFORENOTVOWEL2: // LANG=tr | |||||
| if(((plist2+1)->sourceix != 0) || | |||||
| ((next->type != phVOWEL) && ((phoneme_tab[(plist2+2)->phcode]->type != phVOWEL) || ((plist2+2)->sourceix != 0)))) | |||||
| { | |||||
| alternative = ph->alternative_ph; | |||||
| } | |||||
| break; | |||||
| case phBEFOREVOWELPAUSE: | case phBEFOREVOWELPAUSE: | ||||
| if((next->type == phVOWEL) || (next->type == phPAUSE)) | if((next->type == phVOWEL) || (next->type == phPAUSE)) | ||||
| alternative = ph->alternative_ph; | alternative = ph->alternative_ph; |
| #endif | #endif | ||||
| #ifdef _ESPEAKEDIT | #ifdef _ESPEAKEDIT | ||||
| #define USE_PORTAUDIO | |||||
| #define USE_ASYNC | #define USE_ASYNC | ||||
| #define LOG_FRAMES // write keyframe info to log-espeakedit | #define LOG_FRAMES // write keyframe info to log-espeakedit | ||||
| #endif | #endif |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.h" | #include "wave.h" | ||||
| const char *version_string = "1.31.04 30.Jan.08"; | |||||
| const int version_phdata = 0x013100; | |||||
| const char *version_string = "1.31.05 04.Feb.08"; | |||||
| const int version_phdata = 0x013105; | |||||
| int option_device_number = -1; | int option_device_number = -1; | ||||
| case L('t','r'): // Turkish | case L('t','r'): // Turkish | ||||
| { | { | ||||
| static const unsigned char stress_amps_tr[8] = {16,16, 20,20, 20,24, 24,22 }; | static const unsigned char stress_amps_tr[8] = {16,16, 20,20, 20,24, 24,22 }; | ||||
| static const short stress_lengths_tr[8] = {180,150, 200,180, 0,0, 230,270}; | |||||
| static const short stress_lengths_tr[8] = {170,170, 190,170, 0,0, 250,270}; | |||||
| tr = new Translator(); | tr = new Translator(); | ||||
| SetupTranslator(tr,stress_lengths_tr,stress_amps_tr); | SetupTranslator(tr,stress_lengths_tr,stress_amps_tr); | ||||
| tr->charset_a0 = charsets[9]; // ISO-8859-9 - Latin5 | tr->charset_a0 = charsets[9]; // ISO-8859-9 - Latin5 | ||||
| tr->langopts.stress_rule = 3; // stress on the last syllable | |||||
| tr->langopts.stress_rule = 7; // stress on the last syllable, before any explicitly unstressed syllable | |||||
| tr->langopts.numbers = 0x1009; | |||||
| tr->langopts.numbers = 0x1d09; | |||||
| tr->langopts.max_initial_consonants = 2; | tr->langopts.max_initial_consonants = 2; | ||||
| } | } | ||||
| break; | break; |
| Translator *translator = NULL; // the main translator | Translator *translator = NULL; // the main translator | ||||
| static Translator *translator2 = NULL; // secondary translator for certain words | |||||
| Translator *translator2 = NULL; // secondary translator for certain words | |||||
| static char translator2_language[20] = {0}; | static char translator2_language[20] = {0}; | ||||
| FILE *f_trans = NULL; // phoneme output text | FILE *f_trans = NULL; // phoneme output text | ||||
| while(*wordx != ' ') | while(*wordx != ' ') | ||||
| { | { | ||||
| wordx += TranslateLetter(wordx, phonemes,spell_word); | wordx += TranslateLetter(wordx, phonemes,spell_word); | ||||
| posn++; | |||||
| if(phonemes[0] == phonSWITCH) | if(phonemes[0] == phonSWITCH) | ||||
| { | { | ||||
| // change to another language in order to translate this word | // change to another language in order to translate this word | ||||
| return(0); | return(0); | ||||
| } | } | ||||
| } | } | ||||
| SetSpellingStress(phonemes,spell_word); | |||||
| SetSpellingStress(phonemes,spell_word,posn); | |||||
| } | } | ||||
| else | else | ||||
| if(found == 0) | if(found == 0) | ||||
| // find a remainder that we can pronounce. | // find a remainder that we can pronounce. | ||||
| emphasize_allcaps = 0; | emphasize_allcaps = 0; | ||||
| wordx += TranslateLetter(wordx,phonemes,0); | wordx += TranslateLetter(wordx,phonemes,0); | ||||
| posn++; | |||||
| if(phonemes[0] == phonSWITCH) | if(phonemes[0] == phonSWITCH) | ||||
| { | { | ||||
| // change to another language in order to translate this word | // change to another language in order to translate this word | ||||
| if(length > 0) | if(length > 0) | ||||
| wordx[-1] = ' '; // prevent this affecting the pronunciation of the pronuncable part | wordx[-1] = ' '; // prevent this affecting the pronunciation of the pronuncable part | ||||
| } | } | ||||
| SetSpellingStress(phonemes,0); | |||||
| SetSpellingStress(phonemes,0,posn); | |||||
| // anything left ? | // anything left ? | ||||
| if(*wordx != ' ') | if(*wordx != ' ') | ||||
| return(count); | return(count); | ||||
| } | } | ||||
| int SetTranslator2(const char *new_language) | |||||
| {//========================================= | |||||
| // Set translator2 to a second language | |||||
| int new_phoneme_tab; | |||||
| if((new_phoneme_tab = SelectPhonemeTableName(new_language)) >= 0) | |||||
| { | |||||
| if((translator2 != NULL) && (strcmp(new_language,translator2_language) != 0)) | |||||
| { | |||||
| // we already have an alternative translator, but not for the required language, delete it | |||||
| delete translator2; | |||||
| translator2 = NULL; | |||||
| } | |||||
| if(translator2 == NULL) | |||||
| { | |||||
| translator2 = SelectTranslator(new_language); | |||||
| strcpy(translator2_language,new_language); | |||||
| if(translator2->LoadDictionary(new_language,0) != 0) | |||||
| { | |||||
| SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | |||||
| new_phoneme_tab = -1; | |||||
| translator2_language[0] = 0; | |||||
| } | |||||
| } | |||||
| } | |||||
| return(new_phoneme_tab); | |||||
| } // end of SetTranslator2 | |||||
| int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause) | int Translator::TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause) | ||||
| {//====================================================================================== | {//====================================================================================== | ||||
| int flags=0; | int flags=0; | ||||
| if(word_flags & FLAG_EMBEDDED) | if(word_flags & FLAG_EMBEDDED) | ||||
| { | { | ||||
| embedded_flag = SFLAG_EMBEDDED; | embedded_flag = SFLAG_EMBEDDED; | ||||
| value = embedded_list[embedded_read] >> 8; | |||||
| switch(embedded_cmd = embedded_list[embedded_read] & 0x1f) | |||||
| do | |||||
| { | { | ||||
| case EMBED_Y: | |||||
| option_sayas = value; | |||||
| break; | |||||
| case EMBED_F: | |||||
| option_emphasis = value; | |||||
| break; | |||||
| embedded_cmd = embedded_list[embedded_read++]; | |||||
| value = embedded_cmd >> 8; | |||||
| case EMBED_B: | |||||
| // break command | |||||
| if(value == 0) | |||||
| pre_pause = 0; // break=none | |||||
| else | |||||
| pre_pause += value; | |||||
| break; | |||||
| } | |||||
| while((embedded_list[embedded_read++] & 0x80) == 0); // read over the embedded commands for this word | |||||
| switch(embedded_cmd & 0x1f) | |||||
| { | |||||
| case EMBED_Y: | |||||
| option_sayas = value; | |||||
| break; | |||||
| case EMBED_F: | |||||
| option_emphasis = value; | |||||
| break; | |||||
| case EMBED_B: | |||||
| // break command | |||||
| if(value == 0) | |||||
| pre_pause = 0; // break=none | |||||
| else | |||||
| pre_pause += value; | |||||
| break; | |||||
| } | |||||
| } while((embedded_cmd & 0x80) == 0); | |||||
| } | } | ||||
| if(word[0] == 0) | if(word[0] == 0) | ||||
| new_language = (char *)(&p[1]); | new_language = (char *)(&p[1]); | ||||
| if(new_language[0]==0) | if(new_language[0]==0) | ||||
| new_language = "en"; | new_language = "en"; | ||||
| if((switch_phonemes = SelectPhonemeTableName(new_language)) >= 0) | |||||
| { | |||||
| if((translator2 != NULL) && (strcmp(new_language,translator2_language) != 0)) | |||||
| { | |||||
| // we already have an alternative translator, but not for the required language, delete it | |||||
| delete translator2; | |||||
| translator2 = NULL; | |||||
| } | |||||
| if(translator2 == NULL) | |||||
| { | |||||
| translator2 = SelectTranslator(new_language); | |||||
| strcpy(translator2_language,new_language); | |||||
| switch_phonemes = SetTranslator2(new_language); | |||||
| if(translator2->LoadDictionary(new_language,0) != 0) | |||||
| { | |||||
| SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table | |||||
| switch_phonemes = -1; | |||||
| translator2_language[0] = 0; | |||||
| } | |||||
| } | |||||
| } | |||||
| if(switch_phonemes >= 0) | if(switch_phonemes >= 0) | ||||
| { | { | ||||
| // re-translate the word using the new translator | // re-translate the word using the new translator | ||||
| srcix = source_ix+1; | srcix = source_ix+1; | ||||
| } | } | ||||
| else | else | ||||
| if(ph_code == phonSWITCH2) | |||||
| { | |||||
| SetPlist2(&ph_list2[n_ph_list2],phonSWITCH); | |||||
| ph_list2[n_ph_list2++].tone_number = *p++ - phonTOP; // phoneme table number (phonTOP is added to avoid confusion with special phoneme numbers) | |||||
| } | |||||
| else | |||||
| if(ph_code == phonX1) | if(ph_code == phonX1) | ||||
| { | { | ||||
| // a language specific action | // a language specific action |
| private: | private: | ||||
| int TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause); | int TranslateWord2(char *word, WORD_TAB *wtab, int pre_pause, int next_pause); | ||||
| int TranslateLetter(char *letter, char *phonemes, int control); | int TranslateLetter(char *letter, char *phonemes, int control); | ||||
| void SetSpellingStress(char *phonemes, int control); | |||||
| void SetSpellingStress(char *phonemes, int control, int n_chars); | |||||
| void WriteMnemonic(int *ix, int mnem); | void WriteMnemonic(int *ix, int mnem); | ||||
| void MakePhonemeList(int post_pause, int new_sentence); | void MakePhonemeList(int post_pause, int new_sentence); | ||||
| int SubstitutePhonemes(PHONEME_LIST2 *plist_out); | int SubstitutePhonemes(PHONEME_LIST2 *plist_out); | ||||
| extern int speech_parameters[]; | extern int speech_parameters[]; | ||||
| extern Translator *translator; | extern Translator *translator; | ||||
| extern Translator *translator2; | |||||
| extern const unsigned short *charsets[N_CHARSETS]; | extern const unsigned short *charsets[N_CHARSETS]; | ||||
| extern char dictionary_name[40]; | extern char dictionary_name[40]; | ||||
| extern char ctrl_embedded; // to allow an alternative CTRL for embedded commands | extern char ctrl_embedded; // to allow an alternative CTRL for embedded commands | ||||
| extern void SetLengthMods(Translator *tr, int value); | extern void SetLengthMods(Translator *tr, int value); | ||||
| Translator *SelectTranslator(const char *name); | Translator *SelectTranslator(const char *name); | ||||
| int SetTranslator2(const char *name); | |||||
| int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *err_name,int flags); | int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *err_name,int flags); | ||||
| void LoadConfig(void); | void LoadConfig(void); | ||||
| int PhonemeCode(unsigned int mnem); | int PhonemeCode(unsigned int mnem); |