diff --git a/dictsource/de_list b/dictsource/de_list index f20a80e8..56d91fe4 100644 --- a/dictsource/de_list +++ b/dictsource/de_list @@ -97,6 +97,7 @@ x Iks _ar aR'AbIS _cyr ky:R'IlIS _he hEbr'E:IS +_zh Ci:n'e:zIS // Numbers diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index af156f6d..4b4b295b 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -68,7 +68,7 @@ r R R3 s S t T tS v w x z Z -Dictionary hu_dict 2013-03-08 +Dictionary hu_dict 2013-03-10 a A a: e E e: i i: o o: u u: Y y y: Y: @@ -80,7 +80,7 @@ S s2 t t2 tS ts v w z Z -Dictionary de_dict 2013-02-25 +Dictionary de_dict 2013-03-10 3 @ @- a A A: aI aU A~ E E2 E: e: EI i I @@ -104,7 +104,7 @@ p Q r R s s; t T ts v x z -Dictionary en_dict 2013-03-08 +Dictionary en_dict 2013-03-10 0 0# 3 3: @ @- @2 @5 @L a a# A: A@ aa aI aI3 @@ -191,22 +191,22 @@ N n^ p r R R2 s S t tS ts tS; v x z Z -Dictionary hi_dict 2013-03-01 +Dictionary hi_dict 2013-03-09 @ @- @2 a a: aI aU a~ e E e: E: E~ i I i: l- o O o: O: O~ o~ r- u U u: u~ V -#X1 #X2 - : b bh c ch -d d. dh dh. f g gh h -H j J Jh k kh l l. -m n N n. n^ p ph Q +#X1 #X2 - : b b# c c# +d d# d. d.# f g g# h +H j J J# k k# l l. +m n N n. n^ p p# Q q r r. s S s. t T -t. th th. v w x z +t# t. t.# v w x z -Dictionary ta_dict 2013-03-08 +Dictionary ta_dict 2013-03-10 a a: aI aU e E e: i I i: o o: u U u2 u: @@ -216,7 +216,7 @@ U: V V# d. dZ f g h H j k l l. m n N n. n^ p Q r R s S s. t T -t. th tS v w z z. +t. tS v w z z. Dictionary hy_dict 2008-12-22 @@ -379,7 +379,7 @@ S s; S; t t; tS ts tS; ts; v w x z Z Z; -Dictionary pt_dict 2013-03-08 +Dictionary pt_dict 2013-03-10 & &/ &U~ &~ @ @- a A aI aU e E eI EI eU EU @@ -540,21 +540,21 @@ n^ p p` r s S t t` tS tS` v w x z Z -Dictionary ml_dict 2013-03-06 +Dictionary ml_dict 2013-03-10 @ a a# a: aI aU e E e: i I i: o o: r- u u: V y -#X1 #X2 : ; b bh c ch -d d# d. dh dh. dZ f g -gh h j J Jh k kh l -l. m n N n. n^ p ph +#X1 #X2 : ; b b# c c# +d d# d. d.# d2 dZ f g +g# h j J J# k k# l +l. m n N n. n^ p p# r R r. R2 s s. S; t -t. th th. tS v w z +t# t. t.# tS v w z -Dictionary ne_dict 2013-01-10 +Dictionary ne_dict 2013-03-09 @ @/ @2 @3 a a: aI aU a~ e E e: E: eI e~ E~ @@ -562,25 +562,25 @@ i I i: i~ o O o: O: O~ o~ u U u: u~ V VI VU V~ -- : ; b bh c ch d -d. dh dh. f g gh h H -j J Jh k kh l l. m -n N n. n^ p ph Q q -r r. s S s. t t. th -th. v w x z +- : ; b b# c c# d +d# d. d.# f g g# h H +j J J# k k# l l. m +n N n. n^ p p# Q q +r r. s S s. t t# t. +t.# v w x z -Dictionary pa_dict 2013-03-01 +Dictionary pa_dict 2013-03-09 @ a a~ e E e~ E~ i 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 H j -J Jh k kh l l. m n -N n. n^ p ph Q R R2 -s S t t. th th. v x +: ; b b# c c# d d# +d. d.# f g g# h H j +J J# k k# l l. m n +N n. n^ p p# Q R R2 +s S t t# t. t.# v x z @@ -603,16 +603,16 @@ N n^ p q R s S S; t tS v w x z -Dictionary ur_dict 2013-03-08 +Dictionary ur_dict 2013-03-09 @ a a: aI aU e E e: i I i: O o: U u: V -: ; b bh c ch d D -d. dh dh. f g gh h H -j J Jh k kh l m n -N p ph Q q r R r. -s S s. t T t. th th. +: ; b b# c c# d D +d# d. d.# f g g# h H +j J J# k k# l m n +N p p# Q q r R r. +s S s. t T t# t. t.# v w x z Z z. @@ -682,30 +682,30 @@ q R R2 s s2 t v w x z -Dictionary dv_dict 2011-01-08 +Dictionary dv_dict 2013-03-09 @ @2 a a: aI e e: E: E~ i I i: o O o: O: O~ u U u: V -: ? b c ch d D d. -dZ f g h j k kh l +: ? b c c# d D d. +dZ f g h j k k# l l. m n N n. n^ p Q q r R s S s. t T -t. th th. tS v w x z +t# t. t.# tS v w x z Z -Dictionary kn_dict 2011-12-05 +Dictionary kn_dict 2013-03-09 a a: aI aU e E e: i I i: o o: r- u u: -#X1 #X2 : b bh c ch d -d. dh dh. dZ f g gh h -j J Jh k kh l l. m -n N n. n^ p ph r s -S s. S; t t. th th. tS +#X1 #X2 : b b# c c# d +d# d. d.# dZ f g g# h +j J J# k k# l l. m +n N n. n^ p p# r s +S s. S; t t# t. t.# tS v w z @@ -721,16 +721,16 @@ R R3 s S t T tS ts v w x X z -Dictionary te_dict 2011-12-05 +Dictionary te_dict 2013-03-09 a a: aI aU e E e: i i: l- o o: r- u u: V -#X1 #X2 : ; b bh c ch -d d. dh dh. dZ f g gh -h j J Jh k kh l l. -m n N n. n^ p ph r -s s. S; t t. th th. tS +#X1 #X2 : ; b b# c c# +d d# d. d.# dZ f g g# +h j J J# k k# l l. +m n N n. n^ p p# r +s s. S; t t# t. t.# tS v w z @@ -750,11 +750,10 @@ Dictionary si_dict 2013-01-18 & &: @ a a: aI aU e e: i i: o o: u u: -b bh d d. dh dZ f g -gh h j k kh l l. m -m# n N n# N# n. n.# n^ -n^# p ph r s S s. t -t. th tS v w +b d d. dZ f g h j +k l l. m m# n N n# +N# n. n.# n^ n^# p r s +S s. t t. tS v w Dictionary et_dict 2012-06-12 @@ -782,16 +781,16 @@ q r s S t tS v w x z Z -Dictionary bo_dict 2011-12-05 +Dictionary bo_dict 2013-03-09 a a: e e: i i: l- o o: r- u u: -: ? b bh c ch d d. -dh dh. dz dzh g gh H j -J k kh l m n N n. -n^ p ph r s S s. t -t. th th. ts tsh w z Z +: ? b b# c c# d d# +d. d.# dz dz# g g# H j +J k k# l m n N n. +n^ p p# r s S s. t +t# t. t.# ts ts# w z Z Dictionary kk_dict 2011-12-07 @@ -872,18 +871,18 @@ R R2 s S t T t# tS w x -Dictionary bn_dict 2013-02-28 +Dictionary bn_dict 2013-03-09 @ a a: aI a~ e E e: E: E~ i I i: i~ o O o: O: O~ o~ r- u U u: u~ V -#X1 #X2 : b bh c ch d -d. dh dh. g gh h H j -J Jh k kh l m n N -n. n^ p ph r r. s S -s. t t. th th. v w z +#X1 #X2 : b b# c c# d +d# d. d.# g g# h H j +J J# k k# l m n N +n. n^ p p# r r. s S +s. t t# t. t.# v w z Dictionary ga_dict 2013-03-08 diff --git a/dictsource/en_list b/dictsource/en_list index 6b276019..54507487 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -127,7 +127,7 @@ _, k0m@ _- h,aIf@n ?3 _- daS _. d0t -?3_. pi@rI@d +?3_.p pi@rI@d _: koUl@n _; sEmIk'oUl@n _< lEsDan @@ -276,7 +276,8 @@ _my mj'A:nmA@ _ka dZ'O@dZ@n _ko k3r'i@n _eth i:TI'0pIk - +_ja dZ'ap@ni:z +_zh tS'aIni:z // Cyrillic letters а a @@ -385,6 +386,18 @@ _eth i:TI'0pIk ר ReS_ ש Sin_ ת tav_ +ְ SvA: +ֱ E +ֲ a +ֳ o +ִ i: +ֵ E +ֶ E +ַ a +ָ a +ֹ o +ֻ u +ּ d'agES // phonetic modifiers @@ -4184,19 +4197,22 @@ like laIk $strend2 // General American -?3 agile adZ@L -?3 docile doUs@L -?3 facile fas@L -?3 fertile f3:t@L -?3 fragile fradZ@L -?3 futile fju:t@L -?3 hostile h0st@L -?3 mobile moUb@L +agile $alt2 +docile $alt2 +ductile $alt2 +facile $alt2 +fertile $alt2 +fragile $alt2 +futile $alt2 +hostile $alt2 +mobile $alt2 ?3 missile mIs@L -?3 projectile pr@dZEkt@L -?3 puerile pjU@r@L -?3 sterile stEr@L -?3 virile vIr@L +projectile $alt2 +puerile $alt2 +senile $alt2 +sterile $alt2 +tensile $alt2 +virile $alt2 ?3 volatile v0la#t@L diff --git a/dictsource/en_rules b/dictsource/en_rules index 2a40b577..e5ee4f9e 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -1275,7 +1275,7 @@ _) be (gg bE _) belarus bEl@r'u:s _) be (lC bE - _) be (lli bI2 + _) be (llig bI2 _) be (sC bI2 _) be (stia bE _) be (tB bE @@ -2681,7 +2681,7 @@ for (see f%O@ for (ward f'o@ // straightforward ft (en f - &) ful (_S3 f@L + &) ful (_S3i f@L &) fully (_S5 f@li &) fulness (_S7 f@Ln@s @@ -2921,6 +2921,7 @@ nt) il (_ @L @v) il (_ @L @) ila (_ 'Il@ +?3 &) ile (_$w_alt2 @L _C) i (lage aI _d) i (lat %aI l) il (ah_ aIl @@ -4401,6 +4402,7 @@ os (al_ 'oUz _l) os (e u:z ose (_ oUz + c) ose (_ oUs purp) ose @s _r) os (e# oUz c) os (ec oUs diff --git a/dictsource/hi_list b/dictsource/hi_list index 43663a6e..e28b4e50 100755 --- a/dictsource/hi_list +++ b/dictsource/hi_list @@ -8,9 +8,9 @@ _2 d'o: _3 t'i:n _4 c:'a:r: _5 'pa~c -_6 ch'@2 +_6 c#'@2 _7 s'a:t -_8 'a:th. +_8 'a:t.# _9 n'O: ?3 _9 n'aU @@ -18,11 +18,11 @@ _10 d'Vs _11 gj'a:r-ah _12 b'a:rah _13 t'e:r@2h -_14 ch'O:d@2h +_14 c#'O:d@2h _15 p'Vndr@2h _16 s'o:l@2h _17 sVtr@2h -_18 a:th:arah +_18 a:t#:arah _19 Unn'Is _20 b'i:s @@ -31,9 +31,9 @@ _22 b'a:Is _23 t'ue:Is _24 c'O:bIs _25 p@c:'Is -_26 ch@bb'i:rs +_26 c#@bb'i:rs _27 s@t:'a:Is -_28 ath:'a:Is +_28 at#:'a:Is _29 ,Unt'Is _30 t'i:s @@ -42,7 +42,7 @@ _32 b'at:'I'S _33 tE~t'Is // E~ ? _34 cO~t'Is _35 pE~t'Is -_36 chaT'tIs +_36 c#aT'tIs _37 sE~t'Is _38 art'Is _39 Unta:l'Is @@ -53,7 +53,7 @@ _42 baIa:l'Is _43 tE~ta:l'Is _44 cO:wa:l'Is _45 paI'nta:l'Is -_46 chhIja:l'Is +_46 c#hIja:l'Is _47 sE~ta:l'Is _48 arta:l'Is _49 'Un^ca:s @@ -63,32 +63,32 @@ _51 Ikj'a:wVn _52 b'a:wVn _53 t'IrpVn _54 c'Ou:wVn -_55 p'achpVn -_56 chh@p:'Vn +_55 p'ac#pVn +_56 c#h@p:'Vn _57 santa:'w@n -_58 ath:a:'w@n -_59 Uns'Vth +_58 at#:a:'w@n +_59 Uns'Vt# -_60 s'a:th. -_61 'Iks@th. -_62 b'a:s@th. -_63 t'Irs@th. -_64 cO:'s@th. -_65 paI's@th. -_66 ch'Ija:s@th. -_67 s'Vrs@th. -_68 ars@th. +_60 s'a:t.# +_61 'Iks@t.# +_62 b'a:s@t.# +_63 t'Irs@t.# +_64 cO:'s@t.# +_65 paI's@t.# +_66 c#'Ija:s@t.# +_67 s'Vrs@t.# +_68 ars@t.# _69 Un@h,at:'Vr: _70 sat:'Vr: -_71 Ikhat:'Vr: +_71 Ik#at:'Vr: _72 b@hat:'Vr: _73 tIhat:'Vr: _74 cO:hat:'Vr: -_75 pach,at:'Vr: -_76 chIhat:'Vr: +_75 pac#,at:'Vr: +_76 c#Ihat:'Vr: _77 s@t@hat:'Vr: -_78 athhat:'Vr: +_78 at#hat:'Vr: _79 ,Un^Ia:s'i: _80 ,Vss'i: @@ -97,9 +97,9 @@ _82 baIa:s'i _83 tIra:s'i _84 cO:ra:s'i _85 pI'ca:s'i -_86 chIja:s'i +_86 c#Ija:s'i _87 sVt:a:s'i -_88 ath:a:s'i +_88 at#:a:s'i _89 nVwa:s'i _90 nVb:'e: @@ -108,50 +108,50 @@ _92 b'a:n@we: _93 tIr'a:n@we: _94 cO:r'a:m@we: _95 p@c'a:n@we: -_96 chIj'a:n@we: +_96 c#Ij'a:n@we: _97 s@t:'a:n@we: -_98 ath:'a:n@we: +_98 at#:'a:n@we: _99 nIn^j'a:n@we: _0C s'O: _0M1 h@J,a:r -_0M2 l'a:kh +_0M2 l'a:k# _0M3 k@ro:r.V _0M4 'Vr@b -_0M5 kh'Vr@b +_0M5 k#'Vr@b _dpt _d@s@ml'o:_ // ?? what is Hi for "." ? // Single consonants क k@ क़ q@ -ख kh@ +ख k#@ ख़ x@ ग g@ ग़ Q@ -घ gh@ +घ g#@ ङ N@ च c@ -छ ch@ +छ c#@ ज J@ ज़ z@ -झ Jh@ +झ J#@ ञ n^@ ट t.@ -ठ th.@ +ठ t.#@ ड d.@ ड़ r.@ -ढ dh.@ +ढ d.#@ ण n.@ // retroflex n.@ त t@ -थ th@ +थ t#@ द d@ -ध dh@ +ध d#@ न n@ प p@ -फ ph@ +फ p#@ फ़ f@ ब b@ -भ bh@ +भ b#@ म m@ य j@ र r@ @@ -194,6 +194,13 @@ _dpt _d@s@ml'o:_ // ?? what is Hi for "." ? ॣ #X2l-: ॐ #X1o~m +_?? Vks.@r +_a ej +_b bi: +_c si: +_d di: +_e i: +_f Ef // Punctuation । dVn.d.V diff --git a/dictsource/hi_rules b/dictsource/hi_rules index b8cd8e16..ffbd8801 100755 --- a/dictsource/hi_rules +++ b/dictsource/hi_rules @@ -172,8 +172,8 @@ क़ (B q .group ख - ख khV - ख (B kh + ख k#V + ख (B k# ख़ xV ख़ (B x @@ -184,8 +184,8 @@ ग़ (B Q .group घ - घ ghV - घ (B gh + घ g#V + घ (B g# .group ङ ङ NV @@ -198,8 +198,8 @@ च (्य c: .group छ - छ chV - छ (B ch + छ c#V + छ (B c# .group ज ज JV @@ -208,8 +208,8 @@ ज़ (B z .group झ - झ JhV - झ (B Jh + झ J#V + झ (B J# .group ञ ञ n^V @@ -222,8 +222,8 @@ ट (्य t.: .group ठ - ठ th.V - ठ (B th. + ठ t.#V + ठ (B t.# .group ड ड d.V @@ -233,8 +233,8 @@ ड़ (B r. .group ढ - ढ dh.V - ढ (B dh. + ढ d.#V + ढ (B d.# ढ़ r.hV // nukta (should retroflex flap) ढ़ (B r.h // nukta @@ -249,16 +249,16 @@ त (्य t: .group थ - थ thV - थ (B th + थ t#V + थ (B t# .group द द dV द (B d .group ध - ध dhV - ध (B dh + ध d#V + ध (B d# .group न न nV @@ -276,8 +276,8 @@ प (्य p: .group फ - फ phV - फ (B ph + फ p#V + फ (B p# फ़ fV फ़ (B f @@ -286,8 +286,8 @@ ब (B b .group भ - भ bhV - भ (B bh + भ b#V + भ (B b# .group म म mV diff --git a/dictsource/hu_list b/dictsource/hu_list index fe8aa7ab..e7b22828 100755 --- a/dictsource/hu_list +++ b/dictsource/hu_list @@ -409,7 +409,7 @@ _tld tildE // characters _#9 tAb -_#32 so:kYz +_#32 s'o:kYz _cap n'AJ_| _?? kAR2AktEr||ko:d // unknown characters (change this) @@ -5382,7 +5382,7 @@ _¤ pe:nznEmjEl ® bEjEJzEt: ™ ve:djEJ _` tompA -_  so:kYz +_  s'o:kYz _« bElSY:|bAl|ide:zY:jEl _» bElSY:|jobb|ide:zY:jEl _­ la:JkYtY:jEl @@ -5423,8 +5423,9 @@ _¡ AlSo:indEks // Alphabets _ar 'AR2Ab -_cry ts'iR2ill +_cyr ts'iR2ill _he h'e:bER2 +_zh k'i:nAi // Main Exceptions List diff --git a/dictsource/hu_rules b/dictsource/hu_rules index 53de3bc1..350cb7e9 100644 --- a/dictsource/hu_rules +++ b/dictsource/hu_rules @@ -459,6 +459,7 @@ shetlan) d (szige d szaba) d (szem d _tren) dsz (e d|s vakon) d (sz d +vé) d (jeggy d .group dz fogó) dz (kod ts @@ -1021,6 +1022,8 @@ szivárvá) ny (játsz n^ _elle) n (jav n vagyo) n (jog n nny (elv n|n^ +haszo) n (jár n +boszorká) ny (jelet n^ .group o o o @@ -1162,6 +1165,7 @@ _tetszé) s S ki) s (szőlő S körö) s (szeg S kolbászo) s S +feldolgozá) s S .group ss ssz ss2 @@ -1757,6 +1761,7 @@ fáklyá) sz (ene Sz pénze) sz (k s ellenállá) sz (ón Sz ré) sz (árás Sz +_te) szts (or st|S .group t t t @@ -1988,6 +1993,7 @@ _tisztele) tj (el tj zené) tj (átsz tj szen) tj (akab tj közérze) tj (aví tj +ké) tj (átszm tj .group ts ts (_S2 tS //general rule with word end of ts letters @@ -2204,6 +2210,8 @@ felira) ts (áv t|S leme) tsz (vén ts _cha) tsz (ob t|s robo) ts (of t|S +merényle) ts (or t|S + .group tt tt t: diff --git a/dictsource/kn_list b/dictsource/kn_list index 11760945..7d3ffb92 100755 --- a/dictsource/kn_list +++ b/dictsource/kn_list @@ -39,29 +39,29 @@ _?? aks.ara // 'unknown character' // letter names ಕ್ ik -ಖ್ ikh +ಖ್ ik# ಗ್ ig -ಘ್ igh +ಘ್ ig# ಙ್ iN ಚ್ ic -ಛ್ ich +ಛ್ ic# ಜ್ iJ -ಝ್ iJh +ಝ್ iJ# ಞ್ in^ ಟ್ it. -ಠ್ ith. +ಠ್ it.# ಡ್ id. -ಢ್ idh. +ಢ್ id.# ಣ್ in. ತ್ it -ಥ್ ith +ಥ್ it# ದ್ id -ಧ್ id. +ಧ್ id# ನ್ in ಪ್ ip -ಫ್ iph +ಫ್ ip# ಬ್ ib -ಭ್ ibh +ಭ್ ib# ಮ್ im ಯ್ ij ರ್ ir @@ -101,17 +101,17 @@ U+ccd vattu // symbols % pratis.ata -! a:scharjachinhe +! a:sc#arjac#inhe _? aks.ara . pu:rn.avira:ma , alpavira:ma ¼ ka:lu -½ ardha +½ ard#a ¾ mukka:lu -(1 / 2) ardha +(1 / 2) ard#a (1 / 4) ka:lu (3 / 4) mukka:lu -÷ bha:ga:ka:ra +÷ b#a:ga:ka:ra & mattu @@ -125,8 +125,8 @@ _5 'aIdu _6 'a:ru _7 'e:l.u _8 'ent.u -_9 'ombath:u -_1X h'ath:u +_9 'ombat#:u +_1X h'at#:u _11 hann'ondu _12 han:erad.u _13 hadim'u:ru @@ -135,93 +135,93 @@ _15 hadinaIdu _16 hadina:ru _17 hadin'e:l.u _18 hadin'ent.u -_19 ha'th:'ombath:u +_19 ha't#:'ombat#:u -_2X Ip:ath:u -_21 'Ip:a'th:ondu -_22 Ip:a'th:erad.u -_23 Ip:a'th:m'u:ru -_24 Ip:a'th:n'a:lku -_25 Ip:a'th:'aIdu -_26 Ip:a'th:a:ru -_27 Ip:a'th:e:l.u -_28 Ip:a'th:ent.u -_29 Ip:a'th:ombath:u +_2X Ip:at#:u +_21 'Ip:a't#:ondu +_22 Ip:a't#:erad.u +_23 Ip:a't#:m'u:ru +_24 Ip:a't#:n'a:lku +_25 Ip:a't#:'aIdu +_26 Ip:a't#:a:ru +_27 Ip:a't#:e:l.u +_28 Ip:a't#:ent.u +_29 Ip:a't#:ombat#:u -_3X m'ovath:u -_31 m'ovath:ondu -_32 m'ovatherad.u -_33 m'ovathm'u:ru -_34 m'ovathn'a:lku -_35 m'ovath'aIdu -_36 m'ovatha:ru -_37 m'ovathe:l.u -_38 m'ovathent.u -_39 m'ovathombath:u +_3X m'ovat#:u +_31 m'ovat#:ondu +_32 m'ovat#erad.u +_33 m'ovat#m'u:ru +_34 m'ovat#n'a:lku +_35 m'ovat#'aIdu +_36 m'ovat#a:ru +_37 m'ovat#e:l.u +_38 m'ovat#ent.u +_39 m'ovat#ombat#:u -_4X n'alavath:u -_41 n'alavath:ondu -_42 n'alavatherad.u -_43 n'alavathm'u:ru -_44 n'alavathn'a:lku -_45 n'alavathaIdu -_46 n'alavatha:ru -_47 n'alavathe:l.u -_48 n'alavathent.u -_49 n'alavathombath:u +_4X n'alavat#:u +_41 n'alavat#:ondu +_42 n'alavat#erad.u +_43 n'alavat#m'u:ru +_44 n'alavat#n'a:lku +_45 n'alavat#aIdu +_46 n'alavat#a:ru +_47 n'alavat#e:l.u +_48 n'alavat#ent.u +_49 n'alavat#ombat#:u -_5X 'aIvath:u -_51 aIvath:ondu -_52 aIvatherad.u -_53 aIvathm'u:ru -_54 aIvathn'a:lku -_55 aIvath'aIdu -_56 aIvatha:ru -_57 aIvathe:l.u -_58 aIvathent.u -_59 aIvathombath:u -_6X 'aravath:u -_61 aravath:ondu -_62 aravatherad.u -_63 aravathm'u:ru -_64 aravathn'a:lku -_65 aravathaIdu -_66 aravatha:ru -_67 aravathe:l.u -_68 aravathent.u -_69 aravathombath:u +_5X 'aIvat#:u +_51 aIvat#:ondu +_52 aIvat#erad.u +_53 aIvat#m'u:ru +_54 aIvat#n'a:lku +_55 aIvat#'aIdu +_56 aIvat#a:ru +_57 aIvat#e:l.u +_58 aIvat#ent.u +_59 aIvat#ombat#:u +_6X 'aravat#:u +_61 aravat#:ondu +_62 aravat#erad.u +_63 aravat#m'u:ru +_64 aravat#n'a:lku +_65 aravat#aIdu +_66 aravat#a:ru +_67 aravat#e:l.u +_68 aravat#ent.u +_69 aravat#ombat#:u -_7X 'Ep:ath:u -_71 Ep:ath:ondu -_72 Ep:atherad.u -_73 Ep:athm'u:ru -_74 Ep:athn'a:lku -_75 Ep:athaIdu -_76 Ep:atha:ru -_77 Ep:athe:l.u -_78 Ep:athent.u -_79 Ep:athombath:u -_8X 'Embath:u -_81 Embath:ondu -_82 Embatherad.u -_83 Embathm'u:ru -_84 Embathn'a:lku -_85 EmbathaIdu -_86 Embatha:ru -_87 Embathe:l.u -_88 Embathent.u -_89 Embathombath:u +_7X 'Ep:at#:u +_71 Ep:at#:ondu +_72 Ep:at#erad.u +_73 Ep:at#m'u:ru +_74 Ep:at#n'a:lku +_75 Ep:at#aIdu +_76 Ep:at#a:ru +_77 Ep:at#e:l.u +_78 Ep:at#ent.u +_79 Ep:at#ombat#:u +_8X 'Embat#:u +_81 Embat#:ondu +_82 Embat#erad.u +_83 Embat#m'u:ru +_84 Embat#n'a:lku +_85 Embat#aIdu +_86 Embat#a:ru +_87 Embat#e:l.u +_88 Embat#ent.u +_89 Embat#ombat#:u -_9X th'ombath:u -_91 th'ombath:ondu -_92 th'ombath:erad.u -_93 th'ombathm'u:ru -_94 th'ombathn'a:lku -_95 th'ombathaIdu -_96 th'ombatha:ru -_97 th'ombathe:l.u -_98 th'ombathent.u -_99 th'ombathombath:u +_9X t#'ombat#:u +_91 t#'ombat#:ondu +_92 t#'ombat#:erad.u +_93 t#'ombat#m'u:ru +_94 t#'ombat#n'a:lku +_95 t#'ombat#aIdu +_96 t#'ombat#a:ru +_97 t#'ombat#e:l.u +_98 t#'ombat#ent.u +_99 t#'ombat#ombat#:u _0C0 n'u:ru _1C0 nu:ru diff --git a/dictsource/kn_rules b/dictsource/kn_rules index f8cd483f..25c21c57 100644 --- a/dictsource/kn_rules +++ b/dictsource/kn_rules @@ -24,16 +24,16 @@ ಕ (B k .group ಖ - ಖ kha - ಖ (B kh + ಖ k#a + ಖ (B k# .group ಗ ಗ ga ಗ (B g .group ಘ - ಘ gha - ಘ (B gh + ಘ g#a + ಘ (B g# .group ಙ ಙ Na @@ -44,8 +44,8 @@ ಚ (B c .group ಛ - ಛ cha - ಛ (B ch + ಛ c#a + ಛ (B c# .group ಜ ಜ Ja @@ -54,8 +54,8 @@ ಜ಼ (B z .group ಝ - ಝ Jha - ಝ (B Jh + ಝ J#a + ಝ (B J# .group ಞ ಞ n^a @@ -66,16 +66,16 @@ ಟ (B t. .group ಠ - ಠ th.a - ಠ (B th. + ಠ t.#a + ಠ (B t.# .group ಡ ಡ d.a ಡ (B d. .group ಢ - ಢ dh.a - ಢ (B dh. + ಢ d.#a + ಢ (B d.# .group ಣ ಣ n.a @@ -86,16 +86,16 @@ ತ (B t .group ಥ - ಥ tha - ಥ (B th + ಥ t#a + ಥ (B t# .group ದ ದ da ದ (B d .group ಧ - ಧ dha - ಧ (B dh + ಧ d#a + ಧ (B d# .group ನ ನ na @@ -106,8 +106,8 @@ ಪ (B p .group ಫ - ಫ pha - ಫ (B ph + ಫ p#a + ಫ (B p# ಫ಼ fa // nukta ಫ಼ (B f @@ -116,8 +116,8 @@ ಬ (B b .group ಭ - ಭ bha - ಭ (B bh + ಭ b#a + ಭ (B b# .group ಮ ಮ ma diff --git a/dictsource/ml_list b/dictsource/ml_list index da527242..586ad83e 100644 --- a/dictsource/ml_list +++ b/dictsource/ml_list @@ -8,8 +8,8 @@ U+d02 'a#m U+d03 visarg@m U+d3d avagraha -U+d4d chandraka:r@m -U+d4e chil.acharam // ?? +U+d4d c#andraka:r@m +U+d4e c#il.ac#aram // ?? ൺ _'yn. // chillu consonants ൻ _in @@ -79,7 +79,7 @@ z zEd & samuccaj@m _. bindu _, aNkuS;@m -_; ro:dhini +_; ro:d#ini _? co:dj@cihn@m _! a:S;c@rjacihn@m diff --git a/dictsource/ml_rules b/dictsource/ml_rules index 49c0d321..3094aba9 100644 --- a/dictsource/ml_rules +++ b/dictsource/ml_rules @@ -36,16 +36,16 @@ ക്ക (B k: .group ഖ - ഖ kha - ഖ (B kh + ഖ k#a + ഖ (B k# .group ഗ ഗ ga ഗ (B g .group ഘ - ഘ gha - ഘ (B gh + ഘ g#a + ഘ (B g# .group ങ ങ Na @@ -56,16 +56,16 @@ ച (B c .group ഛ - ഛ cha - ഛ (B ch + ഛ c#a + ഛ (B c# .group ജ ജ Ja ജ (B J .group ഝ - ഝ Jha - ഝ (B Jh + ഝ J#a + ഝ (B J# .group ഞ ഞ n^a @@ -81,16 +81,16 @@ ട്ട (B t.: .group ഠ - ഠ th.a - ഠ (B th. + ഠ t.#a + ഠ (B t.# .group ഡ ഡ d.a ഡ (B d. .group ഢ - ഢ dh.a - ഢ (B dh. + ഢ d.#a + ഢ (B d.# .group ണ ണ n.a @@ -106,16 +106,16 @@ ത്ത (B t: .group ഥ - ഥ tha - ഥ (B th + ഥ t#a + ഥ (B t# .group ദ ദ da ദ (B d .group ധ - ധ dha - ധ (B dh + ധ d#a + ധ (B d# .group ന ന na @@ -131,8 +131,8 @@ പ്പ (B p: .group ഫ - ഫ pha - ഫ (B p + ഫ p#a + ഫ (B p# _പ്രൊ) ഫ (സര് fa @@ -142,8 +142,8 @@ ബ (B b .group ഭ - ഭ bha - ഭ (B bh + ഭ b#a + ഭ (B b# .group മ മ ma @@ -160,7 +160,7 @@ .group റ റ R2a റ (B R2 - ന്) റ d# + ന്) റ d2 റ്റ t.t. // ?? R2R2 = t.t. .group ല diff --git a/dictsource/ne_list b/dictsource/ne_list index 8649eb69..301edb57 100644 --- a/dictsource/ne_list +++ b/dictsource/ne_list @@ -30,20 +30,20 @@ _2 d'u:,i: _3 t'i:n _4 c'a:r: _5 p'a:nc -_6 ch'@2 +_6 c#'@2 _7 s'a:t -_8 'a:th. +_8 'a:t.# _9 n'V'u: _10 d'Vs -_11 e:'gh'a:r'V +_11 e:'g#'a:r'V _12 b'a:r@2 _13 t'e:hr@ -_14 ch'O:d@2 +_14 c#'O:d@2 _15 p'Vndr@2 _16 s'o:r@2 _17 s'Vtr@2 -_18 a'th.'a:r@2 +_18 a't.#'a:r@2 _19 U:nn'a:i's _20 b'i:s @@ -52,9 +52,9 @@ _22 b'a:Is _23 t'e:Is _24 c'O:b'Is _25 p@c:'Is -_26 ch@b'b'i:s +_26 c#@b'b'i:s _27 s@t:'a:Is -_28 ath:'a:Is +_28 at#:'a:Is _29 U:n'Vnt'Is _30 t'i:s @@ -63,7 +63,7 @@ _32 b'at:'Is _33 t'e:t't'i:s _34 cO~,t'I:s _35 pE~t'Is -_36 ch@:t't'I:s +_36 c#@:t't'I:s _37 sE~t'Is _38 art'Is _39 U:n'an'c'a:l'i:s @@ -74,9 +74,9 @@ _42 baIa:l'Is _43 t'ri:c'a:l'i:s _44 cO:wa:l'Is _45 paI'nta:l'Is -_46 chhIja:l'Is +_46 c#hIja:l'Is _47 s@'d.cta:l'Is -_48 a'th.'c'a:l'Is +_48 a't.#'c'a:l'Is _49 U'n'an'c'a:s : _50 p@c'a:s @@ -85,20 +85,20 @@ _52 b'a:wVn'n:'V _53 t'rI:p'an'nV _54 c'Ou:wVn'nV _55 p'ac'pVn'nV -_56 chh@p:'Vn'nV +_56 c#h@p:'Vn'nV _57 s'Vn't:'a:w@n'n':V -_58 a'nth:'a:w@n'n':V -_59 U'n'Vn's'a:th.i: +_58 a'nt#:'a:w@n'n':V +_59 U'n'Vn's'a:t.#i: -_60 s'a:th.i: -_61 e:k'as@th.'th.i: -_62 b'E:s@th.':th.'i: -_63 t'r'i:,s@th.'th.'i: -_64 c'O:s@th.'th.'i: -_65 p'E~'s@th.'th.'i: -_66 ch'E's@th.'th.'i: -_67 s'Vt's@th.'th.'i: -_68 a'th.,s@th.'th.'i: +_60 s'a:t.#i: +_61 e:k'as@t.#'t.#i: +_62 b'E:s@t.#':t.#'i: +_63 t'r'i:,s@t.#'t.#'i: +_64 c'O:s@t.#'t.#'i: +_65 p'E~'s@t.#'t.#'i: +_66 c#'E's@t.#'t.#'i: +_67 s'Vt's@t.#'t.#'i: +_68 a't.#,s@t.#'t.#'i: _69 U:n'an's'Vtt'ar'i: _70 s'at't@r'i:: @@ -106,10 +106,10 @@ _71 e:k'ah'at:'Vr: _72 b@h'att'Vr: _73 tIjatt:'Vr: _74 cO:hat:'Vr: -_75 pach,at:'Vr: -_76 ch@'j'ah'at't'Vr: +_75 pac#,at:'Vr: +_76 c#@'j'ah'at't'Vr: _77 s@t@hatt:'Vr: -_78 athhatt:'Vr: +_78 at#hatt:'Vr: _79 U'n'a:s'i: _80 a's's'i: @@ -118,9 +118,9 @@ _82 baIa:s'i: _83 trIj'a:s'i: _84 cO:ra:s'i: _85 p'ac'a:s'i: -_86 ch@j'a:s'i: +_86 c#@j'a:s'i: _87 s'V:t'a:s'i: -_88 a'th.:a:s'i: +_88 a't.#:a:s'i: _89 u:n'a:n'ab'b'e: _90 n@b'b'e: @@ -129,24 +129,24 @@ _92 b'aj'a:n@b'b'e: _93 trIj'a:n@b'b'e: _94 cO:r'a:n@b'b'e: _95 p@n'c'a:n@b'b'e: -_96 ch@j'a:n@b'b'e: +_96 c#@j'a:n@b'b'e: _97 s@n't:'a:n@b'b'e: -_98 a'n'th.'a:n@b'b'e: +_98 a'n't.#'a:n@b'b'e: _99 U:n'n'a:nsh@je: _0C s'aj@ _0M1 h@z'a:r@ -_0M2 l'a:kh@ +_0M2 l'a:k#@ _0M3 k'a'ro:d.@ _0M4 'Vr@b -_0M5 kh'Vr@b'V +_0M5 k#'Vr@b'V _0M6 n'i:l' _0M7 p'Vd'm@ -_0M8 sh'an,kh@ -_0M9 m'ah'a:,sh'ankh@ -_0M10 p@r'a:rrd:dh@ +_0M8 sh'an,k#@ +_0M9 m'ah'a:,sh'ank#@ +_0M10 p@r'a:rrd:d#@ -_dpt _th'o:plo_ +_dpt _t#'o:plo_ // Symbols in Nepali @@ -157,34 +157,34 @@ _dpt _th'o:plo_ // Single consonants क k@ क़ q@ -ख kh@ +ख k#@ ख़ x@ ग g@ ग़ Q@ -घ gh@ +घ g#@ ङ N@ च c@ -छ ch@ +छ c#@ ज J@ ज़ z@ -झ Jh@ +झ J#@ ञ n^@ ट t.@ -ठ th.@ +ठ t.#@ ड d.@ ड़ r.@ -ढ dh.@ +ढ d.#@ ण n.@ // retroflex n.@ त t@ -थ th@ +थ t#@ द d@ -ध dh@ +ध d#@ न n@ प p@ -फ ph@ +फ p#@ फ़ f@ ब b@ -भ bh@ +भ b#@ म m@ य j@ र r@ @@ -222,17 +222,17 @@ _dpt _th'o:plo_ पो $u $pause हो $u $brk के k'e,: $brk -दुःख d'u,,kh@ -सुख s'u=kh@ +दुःख d'u,,k#@ +सुख s'u=k#@ जव J'Vv@ राष्ट्रिय r'a:S,t.rI:j@2 $2 सित s'it@ होइन h'oi:n@2 - भएन bh'Vj'en@2 + भएन b#'Vj'en@2 गएन g'Vj'en@2 - खाएन khaj'en@2 + खाएन k#aj'en@2 दिएन d'ij'en@2 -छुन ch'un'@ +छुन c#'un'@ बाट b'a:t.@ अथवा $pause वा $pause diff --git a/dictsource/ne_rules b/dictsource/ne_rules index 078afbbe..6f36f225 100644 --- a/dictsource/ne_rules +++ b/dictsource/ne_rules @@ -572,13 +572,13 @@ .group ख - ख khV - ख (B kh -?1 ख (_ kh - ्) ख (_ kh@/ - ख (्ख kh, - खँ khV~' - खॅ khV~' + ख k#V + ख (B k# +?1 ख (_ k# + ्) ख (_ k#@/ + ख (्ख k#, + खँ k#V~' + खॅ k#V~' .group ग ग gV @@ -590,13 +590,13 @@ गॅ gV~' .group घ - घ ghV - घ (B gh -?1 घ (_ gh - घ (्घ gh, - ्) घ (_ gh@/ - घँ ghV~' - घॅ ghV~' + घ g#V + घ (B g# +?1 घ (_ g# + घ (्घ g#, + ्) घ (_ g#@/ + घँ g#V~' + घॅ g#V~' .group ङ // Phoneme adjustment suggested @@ -616,12 +616,12 @@ चॅ cV~' .group छ - छ chV - छ (B ch - ्) छ (C ch@ - छ (_ ch@ - छँ chV~' - छॅ chV~' + छ c#V + छ (B c# + ्) छ (C c#@ + छ (_ c#@ + छँ c#V~' + छॅ c#V~' .group ज ज JV @@ -633,12 +633,12 @@ ्) ज (_ J@/ .group झ // Phoneme adjustment suggested. - झ JhV - झ (B Jh - झँ JhV~' - झॅ JhV~' + झ J#V + झ (B J# + झँ J#V~' + झॅ J#V~' झ (्झ J, - झ (_ Jh + झ (_ J# .group ञ // Phoneme adjustment suggested ञ n^V @@ -659,13 +659,13 @@ ट (्य t.: .group ठ - ठ th.V - ठ (B th. - ठँ t.hV~' - ठॅ t.hV~' - ठ (्ठ th., - ्) ठ (_ th.@/ -?1 ठ (_ t.h + ठ t.#V + ठ (B t.# + ठँ t.#V~' + ठॅ t.#V~' + ठ (्ठ t.#, + ्) ठ (_ t.#@/ +?1 ठ (_ t.# .group ड ड d.V @@ -682,14 +682,14 @@ ड़ॅ d.:V~' .group ढ - ढ dh.V - ढ (B dh. - ढँ d.hV~' - ढॅ d.hV~' - ्) ढ (_ dh.@/ -?1 ढ (_ d.h - ढ़ d.hV: // nukta - ढ़ (B d.h // nukta + ढ d.#V + ढ (B d.# + ढँ d.#V~' + ढॅ d.#V~' + ्) ढ (_ d.#@/ +?1 ढ (_ d.# + ढ़ d.#V: // nukta + ढ़ (B d.# // nukta .group ण ण n.V // Phoneme adjustment suggested @@ -709,13 +709,13 @@ ?1 त (_ t, .group थ - थ thV - थँ thV~' - थॅ thV~' - थ (B th - ्) थ (_ th@/ - थ (्य th, -?1 थ (_ th + थ t#V + थँ t#V~' + थॅ t#V~' + थ (B t# + ्) थ (_ t#@/ + थ (्य t#, +?1 थ (_ t# .group द द dV @@ -729,12 +729,12 @@ ्) द (_ d@/ .group ध - ध dhV - धँ dhV~' - धॅ dhV~' - ध (B dh -?1 ध (_ dh - ्) ध (_ dh@/ + ध d#V + धँ d#V~' + धॅ d#V~' + ध (B d# +?1 ध (_ d# + ्) ध (_ d#@/ .group न न nV @@ -763,13 +763,13 @@ ्) प (_ p@/ .group फ - फ phV - फँ phV~' - फॅ phV~' - फ (B ph - फ (्न ph: -?1 फ (_ ph - ्) फ (_ ph@/ + फ p#V + फँ p#V~' + फॅ p#V~' + फ (B p# + फ (्न p#: +?1 फ (_ p# + ्) फ (_ p#@/ .group ब ब bV @@ -781,12 +781,12 @@ ्) ब (_ b@/ .group भ - भ bhV - भँ bhV~' - भॅ bhV~' - भ (B bh -?1 भ (_ bh - भ (्य bh, + भ b#V + भँ b#V~' + भॅ b#V~' + भ (B b# +?1 भ (_ b# + भ (्य b#, ्) भ (_ bh@/ .group म @@ -1064,65 +1064,65 @@ .group [ [ l'eftbr'ak'et - [ (_A th'ul'ok'osht.@2suru - [ (_C th'ul'ok'osht.@2suru - [ (_० th'ul'ok'osht.@2suru - [ (_१ th'ul'ok'osht.@2suru - [ (_२ th'ul'ok'osht.@2suru - [ (_३ th'ul'ok'osht.@2suru - [ (_४ th'ul'ok'osht.@2suru - [ (_५ th'ul'ok'osht.@2suru - [ (_६ th'ul'ok'osht.@2suru - [ (_७ th'ul'ok'osht.@2suru - [ (_८ th'ul'ok'osht.@2suru - [ (_९ th'ul'ok'osht.@2suru + [ (_A t#'ul'ok'osht.@2suru + [ (_C t#'ul'ok'osht.@2suru + [ (_० t#'ul'ok'osht.@2suru + [ (_१ t#'ul'ok'osht.@2suru + [ (_२ t#'ul'ok'osht.@2suru + [ (_३ t#'ul'ok'osht.@2suru + [ (_४ t#'ul'ok'osht.@2suru + [ (_५ t#'ul'ok'osht.@2suru + [ (_६ t#'ul'ok'osht.@2suru + [ (_७ t#'ul'ok'osht.@2suru + [ (_८ t#'ul'ok'osht.@2suru + [ (_९ t#'ul'ok'osht.@2suru .group ] ] r'aitbr'ak'et - A_) ] th'ul'ok'osht.@2b'Vnd@2 - C_) ] th'ul'ok'osht.@2b'Vnd@2 - ०_) ] th'ul'ok'osht.@2b'Vnd@2 - १_) ] th'ul'ok'osht.@2b'Vnd@2 - २_) ] th'ul'ok'osht.@2b'Vnd@2 - ३_) ] th'ul'ok'osht.@2b'Vnd@2 - ४_) ] th'ul'ok'osht.@2b'Vnd@2 - ५_) ] th'ul'ok'osht.@2b'Vnd@2 - ६_) ] th'ul'ok'osht.@2b'Vnd@2 - ७_) ] th'ul'ok'osht.@2b'Vnd@2 - ८_) ] th'ul'ok'osht.@2b'Vnd@2 - ९_) ] th'ul'ok'osht.@2b'Vnd@2 + A_) ] t#'ul'ok'osht.@2b'Vnd@2 + C_) ] t#'ul'ok'osht.@2b'Vnd@2 + ०_) ] t#'ul'ok'osht.@2b'Vnd@2 + १_) ] t#'ul'ok'osht.@2b'Vnd@2 + २_) ] t#'ul'ok'osht.@2b'Vnd@2 + ३_) ] t#'ul'ok'osht.@2b'Vnd@2 + ४_) ] t#'ul'ok'osht.@2b'Vnd@2 + ५_) ] t#'ul'ok'osht.@2b'Vnd@2 + ६_) ] t#'ul'ok'osht.@2b'Vnd@2 + ७_) ] t#'ul'ok'osht.@2b'Vnd@2 + ८_) ] t#'ul'ok'osht.@2b'Vnd@2 + ९_) ] t#'ul'ok'osht.@2b'Vnd@2 .group { { l'eftbr'eIs - { (_A b'a:Ng'ek'oshth.@2suru - { (_C b'a:Ng'ek'oshth.@2suru - { (_० b'a:Ng'ek'oshth.@2suru - { (_१ b'a:Ng'ek'oshth.@2suru - { (_२ b'a:Ng'ek'oshth.@2suru - { (_३ b'a:Ng'ek'oshth.@2suru - { (_४ b'a:Ng'ek'oshth.@2suru - { (_५ b'a:Ng'ek'oshth.@2suru - { (_६ b'a:Ng'ek'oshth.@2suru - { (_७ b'a:Ng'ek'oshth.@2suru - { (_८ b'a:Ng'ek'oshth.@2suru - { (_९ b'a:Ng'ek'oshth.@2suru + { (_A b'a:Ng'ek'osht.#@2suru + { (_C b'a:Ng'ek'osht.#@2suru + { (_० b'a:Ng'ek'osht.#@2suru + { (_१ b'a:Ng'ek'osht.#@2suru + { (_२ b'a:Ng'ek'osht.#@2suru + { (_३ b'a:Ng'ek'osht.#@2suru + { (_४ b'a:Ng'ek'osht.#@2suru + { (_५ b'a:Ng'ek'osht.#@2suru + { (_६ b'a:Ng'ek'osht.#@2suru + { (_७ b'a:Ng'ek'osht.#@2suru + { (_८ b'a:Ng'ek'osht.#@2suru + { (_९ b'a:Ng'ek'osht.#@2suru .group } } r'aItbr'eIs - A_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - C_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ०_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - १_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - २_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ३_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ४_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ५_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ६_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ७_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ८_) } b'a:Ng'ek'oshth.@2b'Vnd@2 - ९_) } b'a:Ng'ek'oshth.@2b'Vnd@2 + A_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + C_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ०_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + १_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + २_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ३_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ४_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ५_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ६_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ७_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ८_) } b'a:Ng'ek'osht.#@2b'Vnd@2 + ९_) } b'a:Ng'ek'osht.#@2b'Vnd@2 @@ -1132,19 +1132,19 @@ // Special Symbols with special meanings .group । pur',n.@,w'ir'a:m // Fullstop of Devanagari - ॥ d'i:rgh@,w'ir'a:m // Double Fullstop - means Read sentence twice. + ॥ d'i:rg#@,w'ir'a:m // Double Fullstop - means Read sentence twice. ॱ dVS@mal@w@2 // Decimal of devanagari (dot [.] is mostly used!). ॰ saNks.e:p@s'u:c@k@ - $ dOlV + $ dOlV % prVtish'vt // Rarely used Special symbols. Written after Indepedent Vowel or between a Consonants and Symbolic Vowels! ़ n'u'k't'a: // Name of symbol. ॑ Ud'Vtt,@ - ॓ Ud:dh@r,@n.@a:r'Vmbh@ - ॔ ,Ud:dh@r,@n.@'Vnt@ - ॽ k,@n.th.@w'Ira:m + ॓ Ud:d#@r,@n.@a:r'Vmb#@ + ॔ ,Ud:d#@r,@n.@'Vnt@ + ॽ k,@n.t.#@w'Ira:m ॒ a'n'ud'Vtt,@ diff --git a/dictsource/pt_list b/dictsource/pt_list index 2638dd55..471eb01c 100755 --- a/dictsource/pt_list +++ b/dictsource/pt_list @@ -45,6 +45,7 @@ _tld tS'iU _ar 'a*aby _cyr si*'ilikU _he eb*'aIkU +_zh Sin'es // character names @@ -828,6 +829,7 @@ galileia $alt gameta $alt2 geleia $alt gelo $alt $verb +genebra $alt germe $alt gesso $alt2 golpe $alt diff --git a/dictsource/pt_rules b/dictsource/pt_rules index b30bdb2c..e7b36766 100755 --- a/dictsource/pt_rules +++ b/dictsource/pt_rules @@ -361,10 +361,8 @@ _soub) e (L05_ E _rend) e (L06_ e _vend) e (L06_ e -_atend) e (L06_ e + tend) e (L06_ e / a- con- en- es- _compreend) e (L06_ e -_entend) e (L06_ e -_estend) e (L06_ e respond) e (L06_ e // cor- _enraivec) e (L07_ e _espairec) e (L07_ e @@ -383,6 +381,8 @@ _espairec) e (L07_ e vert) e (L07_ e // in- re- con- _eleg) e (L07_ e _ergu) e (L07_ e +_escond) e (L06_ e + _mord) e (L06_ e _mord) e (L07_ e _morr) e (L07_ e _perd) e (L07_ e @@ -396,9 +396,12 @@ _adormec) e (L07_ e _agradec) e (L07_ e _amanhec) e (L07_ e _anoitec) e (L07_ e +_arrepend) e (L06_ e _arrepend) e (L07_ e _cresc) e (L07_ e +_defend) e (L06_ e _defend) e (L07_ e +_depend) e (L06_ e _depend) e (L07_ e _emagrec) e (L07_ e _enlouquec) e (L07_ e @@ -410,17 +413,19 @@ _escond) e (L07_ e _escurec) e (L07_ e _esquec) e (L07_ e _interromp) e (L07_ e -_obedec) e (L07_ e +obedec) e (L07_ e / des- +_suspend) e (L07_ e _perec) e (L07_ e _rejuvenec) e (L07_ e aprend) e (L07_ e // re- conhec) e (L07_ e // & re- des- -entend) e (L07_ e + tend) e (L07_ e / en- con- a- es- preend) e (L07_ e // sur- com- respond) e (L07_ e // cor- qu) e (brL04_ E acel) e (rL04_ E / des- _hosp) e (dL03_ E +_amort) e (çL03_ e _in) e (ptL03_ E _gr) e (gL03_ e _n) e (grL03_ e @@ -486,7 +491,7 @@ _emagr) e (çL03 _aqu) e (çL03_ e _car) e (çL03_ e _mer) e (çL03_ e - _pad) e (çL03_ e // com- + pad) e (çL03_ e // com- _per) e (çL03_ e conh) e (çL03_ e // re- _esqu) e (çL03_ e diff --git a/dictsource/ta_list b/dictsource/ta_list index 03a308a2..0e285130 100644 --- a/dictsource/ta_list +++ b/dictsource/ta_list @@ -117,6 +117,7 @@ U+bf9 ru:ba:j _ar arVbU _cyr sirillik _he ;ebire:jVm +_zh tS'i:nV // abbreviations diff --git a/dictsource/te_list b/dictsource/te_list index 2e4daf58..fa2ebd0c 100644 --- a/dictsource/te_list +++ b/dictsource/te_list @@ -50,20 +50,20 @@ _1X padi _11 padakond.u _12 pannemd.u _13 padamu:d.u: -_14 padhna:lugu +_14 pad#na:lugu _15 padihe:nu _16 padaha:ru _17 padihe:d.u -_18 paddhenimidi +_18 padd#enimidi _19 pamdommadi _2X iravaI _3X muppaI -_4X nalubhaI -_5X ja:bhaI +_4X nalub#aI +_5X ja:b#aI _6X aravaI -_7X d.ebhbaI -_8X jenabhaI -_9X tombhaI +_7X d.eb#baI +_8X jenab#aI +_9X tomb#aI _0C vandala _0C0 vandalu _1C okavanda @@ -92,8 +92,8 @@ _?? aks.aram // 'unknown character' _, ka:ma: _; semi:ko:lan _: ko:lan -_! a:S;carja:rthaka -_? praS;na:rthaka +_! a:S;carja:rt#aka +_? praS;na:rt#aka _- haIfan __ amd.ar||sko:r @@ -114,29 +114,29 @@ U+c4d vottu // consonants with virama క్ ik -ఖ్ ikh +ఖ్ ik# గ్ ig -ఘ్ igh +ఘ్ ig# ఙ్ iN చ్ ic -ఛ్ ich +ఛ్ ic# జ్ iJ -ఝ్ iJh +ఝ్ iJ# ఞ్ in^ ట్ it. -ఠ్ ith. +ఠ్ it.# డ్ id. -ఢ్ idh. +ఢ్ id.# ణ్ in. త్ it -థ్ ith +థ్ it# ద్ id -ధ్ idh +ధ్ id# న్ in ప్ ip -ఫ్ iph +ఫ్ ip# బ్ ib -భ్ ibh +భ్ ib# మ్ im య్ ij ర్ ir diff --git a/dictsource/te_rules b/dictsource/te_rules index 4b18cdb5..2ceb5476 100644 --- a/dictsource/te_rules +++ b/dictsource/te_rules @@ -24,16 +24,16 @@ క (B k .group ఖ - ఖ kha - ఖ (B kh + ఖ k#a + ఖ (B k# .group గ గ ga గ (B g .group ఘ - ఘ gha - ఘ (B gh + ఘ g#a + ఘ (B g# .group ఙ ఙ Na @@ -44,16 +44,16 @@ చ (B c .group ఛ - ఛ cha - ఛ (B ch + ఛ c#a + ఛ (B c# .group జ జ Ja జ (B J .group ఝ - ఝ Jha - ఝ (B Jh + ఝ J#a + ఝ (B J# .group ఞ ఞ n^a @@ -64,16 +64,16 @@ ట (B t. .group ఠ - ఠ th.a - ఠ (B th. + ఠ t.#a + ఠ (B t.# .group డ డ d.a డ (B d. .group ఢ - ఢ dh.a - ఢ (B dh. + ఢ d.#a + ఢ (B d.# .group ణ ణ n.a @@ -84,16 +84,16 @@ త (B t .group థ - థ tha - థ (B th + థ t#a + థ (B t# .group ద ద da ద (B d .group ధ - ధ dha - ధ (B dh + ధ d#a + ధ (B d# .group న న na @@ -104,16 +104,16 @@ ప (B p .group ఫ - ఫ pha - ఫ (B ph + ఫ p#a + ఫ (B p# .group బ బ ba బ (B b .group భ - భ bha - భ (B bh + భ b#a + భ (B b# .group మ మ ma diff --git a/phsource/compile_report b/phsource/compile_report index fa7f3990..98f7e983 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -13,6 +13,7 @@ consonants 10 118 en-wi 30 156 af 39 138 cy 29 134 + ga 29 133 de 41 141 eo 13 116 jbo 2 116 @@ -21,17 +22,18 @@ consonants 10 118 et 40 135 fr 64 146 fr-ca 11 146 - hi 57 150 - bn 5 150 - ne 18 158 - ur 6 150 - ta 23 154 - kn 17 150 - ml 22 154 + nl 35 130 + hi 57 149 + bn 5 149 + ne 18 157 + ur 6 149 + pa 15 151 + ta 23 153 + kn 17 149 + ml 21 152 hu 25 124 lt 44 139 lv 29 127 - nl 35 130 pl 22 122 sk 28 137 cs 7 137 @@ -66,8 +68,8 @@ consonants 10 118 hy 23 119 da 46 139 ka 20 115 + fa 9 112 rw 15 132 - pa 15 152 prs 8 113 sl 10 137 gd 6 109 @@ -77,15 +79,13 @@ consonants 10 118 ak 8 111 am 15 114 wo 18 120 - dv 14 150 - te 16 150 - si 24 156 + dv 14 149 + te 16 149 + si 24 155 tn 27 121 mt 32 129 - bo 10 154 + bo 10 153 kk 20 118 - fa 9 112 - ga 29 133 tt 23 120 ko 15 116 kl 18 119 @@ -98,7 +98,7 @@ b/b_ [b] base [b] fr b/b@ [b] base b/b@2 [b] base - [bh] hi + [b#] hi b/ba [b] base b/be [b] base b/bi [b] base @@ -108,7 +108,7 @@ b/br [b] fr b/bu [b] base b/xb [b] base [b] fr - [bh] hi + [b#] hi b/xbr [b] fr d/d [d] base [d[] base @@ -152,7 +152,7 @@ d/dr [*] base [d^] et [d] fr [d.] hi - [dh.] hi + [d.#] hi [d] kn [d] hu [d] lt @@ -176,7 +176,7 @@ d/xd [d] base [d] et [d] fr [z] fr - [dh] hi + [d#] hi [d] kn [d] hu [d] lt @@ -186,17 +186,17 @@ d/xd [d] base [d] sq [d] mt [dz] bo - [dzh] bo -d/xd3 [dh] hi + [dz#] bo +d/xd3 [d#] hi d/xd_pzd [d^] et [d;] lt [d;] pl d/xdr [d] fr [d.] hi - [dh.] hi + [d.#] hi d/xdz [dz] consonants [dz] bo - [dzh] bo + [dz#] bo d/x_tap [t#] en [*] pt dzh/dzh [dZ] base @@ -231,7 +231,7 @@ dzh/xdzh [dZ] base [dZ;] ru [dZ;] sq dzh/xdz_pzd [J] base - [Jh] hi + [J#] hi [J] tr [J] ku envelope/i_risefall [11] zh @@ -239,10 +239,10 @@ envelope/i_risefall2 [+2] rw envelope/p_214 [5] vi [5] vi-hue [214] zh -envelope/p_512 [6] vi +envelope/p_512 [+] pa + [6] vi [4] vi-hue [6] vi-hue - [+] pa envelope/p_fall [2] vi [7] vi [2] vi-hue @@ -273,7 +273,7 @@ envelope/vi_5amp [5] vi envelope/vi_6amp [6] vi [2] vi-hue [6] vi-hue -g2/xg [gh] hi +g2/xg [g#] hi g/g [g] base [g-] en [g] cy @@ -450,7 +450,7 @@ l/l_ [l] base [l/] fr l/l_@ [l/3] base [l/] fr -l/l@ [¨\7] base +l/l@ [¨\0] base [l#] base [l] fr [l/2] fr @@ -484,7 +484,7 @@ l/L2_oL [l/2] base l/L2_uL [l/2] base l/l_3 [l/] de l/l_4 [ll] sq -l/la [¨\7] base +l/la [¨\0] base [l#] base [l] fr [l/2] fr @@ -492,7 +492,7 @@ l/la [ [K] tn l/l_a [l/3] base [l/] fr -l/le [¨\7] base +l/le [¨\0] base [l#] base [l] fr [l/2] fr @@ -504,7 +504,7 @@ l/L_eL_af [&] af [&:] af l/l_front [L] sq l/l_front_ [l/4] sq -l/li [¨\7] base +l/li [¨\0] base [l#] base [l] fr [l/2] fr @@ -518,7 +518,7 @@ ll/ll [L] base ll/_ll [L] base l/l_long [l] base [l] fr -l/lo [¨\7] base +l/lo [¨\0] base [l#] base [l/2] fr [K] nso @@ -529,7 +529,7 @@ l^/l_rfx [l.] base [l;] lt [l] ru [l^] ru -l/lu [¨\7] base +l/lu [¨\0] base [l#] base [l] fr [l/2] fr @@ -870,11 +870,10 @@ ustop/k_ [k] base [k] el [k] sq ustop/k_asp [kh] consonants - [gh] hi + [g#] hi [kh] zh [k#] ka [kh] tn -ustop/k_asp2 [kh2] ml ustop/k_asp_a [k#] ka ustop/k_asp_e [k#] ka ustop/k_asp_u [k#] ka @@ -896,7 +895,6 @@ ustop/kl [k] base [k] base2 [k] et [k] fr - [kh2] ml [k] lv [k] el [k] zhy @@ -928,7 +926,7 @@ ustop/p_ [p] base [p] fr [ph] tn ustop/p_asp [ph] consonants - [bh] hi + [b#] hi [ph] zh [ph] tn ustop/percus02 [#X2] hi @@ -968,8 +966,8 @@ ustop/q [q] base ustop/q_u [q] base ustop/t [t] base [t] en-us - [dh.] hi - [th.] hi + [d.#] hi + [t.#] hi [t] zhy [t] da ustop/t_ [t] base @@ -985,8 +983,8 @@ ustop/t_dnt [t] base [t] base2 [t] en-us [t] et - [dh] hi - [th] hi + [d#] hi + [t#] hi [t] hu [t] lt [t] pl @@ -1011,14 +1009,14 @@ ustop/ts [ts] consonants [z] zhy [tsh] zh [ts] tn - [tsh] bo - [dzh] bo + [ts#] bo + [dz#] bo ustop/ts_ [ts] consonants [dz] consonants [ts] lv [ts] tn - [tsh] bo - [dzh] bo + [ts#] bo + [dz#] bo ustop/ts2 [ts] lv [ts] hy [ts] ka @@ -1044,7 +1042,7 @@ ustop/tsh_pzd_unasp [tS;] zh ustop/tsh_sr [tS] sr ustop/tsh_unasp [tS`] am ustop/ts_pzd [tS;] base - [Jh] hi + [J#] hi [tS;] lt [tS;] ru [dZ;] sq @@ -1085,8 +1083,8 @@ vdiph2/ei_4 [ei] zh vdiph2/eo [eo] ro vdiph2/e_u [e[u] ro vdiph2/i@ [i@] en-n - [i@] hy [i@] ga + [i@] hy vdiph2/i@_2 [i@] en-wm vdiph2/ie [i@] en-wi [ie] fi @@ -1176,6 +1174,7 @@ vdiph/ae [E:] fr-ca vdiph/ae_2 [aI] en-n vdiph/ai [aI] base2 [aI] en-wi + [aI] ga [aI] eo [aI] kn [aI] ml @@ -1189,7 +1188,6 @@ vdiph/ai [aI] base2 [aI] hy [aI] da [aI] te - [aI] ga [aI] kl vdiph/ai_2 [aI] en [aI] cy @@ -1220,18 +1218,18 @@ vdiph/au_2 [au] zhy vdiph/au_3 [aU] en-rp vdiph/au_4 [aU] base2 [aU] cy + [aU] ga + [aU#] ga [aU] eo [aU] lt [aU] sk [aU] id - [aU] ga - [aU#] ga vdiph/ee-e [E:] hi vdiph/eei [EI] base2 [eI] en [EI] de - [eI] ne [EI] nl + [eI] ne [EI] vi [eI] hy [eI] prs @@ -1240,8 +1238,8 @@ vdiph/eei_2 [eI] eo [ei] lt [ei] lv [eI] id - [ei] mt [eI] fa + [ei] mt vdiph/eei_3 [eI] lt [eI] sk [eI] ku @@ -1268,9 +1266,9 @@ vdiph/ei [eI] base2 vdiph/eu [eU] base2 [eU] cy [eU] eo + [eU] nl [eU] ne [eU] lt - [eU] nl [eU] sk [eU] pt [eU] vi @@ -1335,9 +1333,9 @@ vdiph/ou_4 [o:] nl vdiph/@u [u:] en-wm [@:U] vi vdiph/@u_2 [oU] en-rp -vdiph/@u_3 [@U] ro +vdiph/@u_3 [@U] ga + [@U] ro [@U] vi - [@U] ga vdiph/@u_en [oU] en [@U] id vdiph/ui [uI] base2 @@ -1413,8 +1411,8 @@ vnasal/o_n [o~] hi vnasal/o_n2 [o~] af vnasal/o_n4 [O~] fr vnasal/oo_n2 [O~] en - [O~] hi [O~] nl + [O~] hi [o] zh vnasal/oo_n3 [O~] pl vnasal/&u_n [O#] vi @@ -1485,7 +1483,7 @@ voc/z_ [z] base [z;] ro [z] sq [dz] bo - [dzh] bo + [dz#] bo voc/zh [Z] base [z.] base [R^] sk @@ -1507,6 +1505,7 @@ vowel/@ [@] base [@5] en [@] en-rp [V] cy + [@/] ga [@] kn [@] hy [@] ka @@ -1514,7 +1513,6 @@ vowel/@ [@] base [@] wo [@:] wo [@] te - [@/] ga vowel/@- [@-] base [r*] hr [@-] da @@ -1529,8 +1527,8 @@ vowel/& [a] en-rp [&] sv [&#] da [?&#] da - [&] az [a] fa + [&] az vowel/0 [0] en [O] hi [O] pt @@ -1596,9 +1594,9 @@ vowel/a [a] base [aa] en-wm [a] cy [a] de + [a:] nl [a] ta [a:] hu - [a:] nl [a] pl [a] sk [a:] sk @@ -1635,10 +1633,10 @@ vowel/a_2 [a] base2 [a] da [?a] da [a] rw -vowel/a#_2 [a] kn - [a] ml - [A] nl +vowel/a#_2 [A] nl [a:] nl + [a] kn + [a] ml [a#] pl [&] hr [a] sv @@ -1670,6 +1668,7 @@ vowel/a#_3 [a#] en [a#] en-n [a#] en-us [a#] en-wm + [a#] ga [3] de [a] hi [a] ml @@ -1685,10 +1684,9 @@ vowel/a#_3 [a#] en [a] sq [a/] sq [3] da - [a#] ga -vowel/a_4 [a] es +vowel/a_4 [a] ga + [a] es [a] el - [a] ga vowel/a#_4 [a:] nl [a] bg [a/] it @@ -1725,9 +1723,9 @@ vowel/aa# [O] en-us vowel/aa_2 [A:] en [A@] en [A:] cy + [A:] ga [A] zh [A@] tn - [A:] ga vowel/aa_3 [A:] af [A] sq [A] prs @@ -1741,10 +1739,10 @@ vowel/aa_6 [A] de [A:] de vowel/aa_8 [0] en-us [A:] en-us + [0] ga [A1] et [A] nl [a:] is - [0] ga [A] tt [a] ko vowel/aa_9 [a] fi @@ -1761,9 +1759,9 @@ vowel/@_bck [@] hi [V] ne [@/] ne [@] ur + [@] pa [@] bg [@] zh - [@] pa vowel/e [e] base [e] base2 [e:] en @@ -1773,6 +1771,7 @@ vowel/e [e] base [eI] en-wi [e:] af [e:] cy + [e:] ga [e] ne [e] ta [e:] ta @@ -1799,22 +1798,21 @@ vowel/e [e] base [e] dv [e:] dv [e:] te - [e:] ga [E] kl vowel/e# [I] en-sc [e] et [E] kl -vowel/e_2 [eI] en-sc +vowel/e_2 [i] en-n + [eI] en-sc [e:] de [e] hi [e:] hi + [e] pa [e] it [e:] sv [e:] no - [e] pa [e] sl -vowel/e_3 [i] en-n - [e:] hu +vowel/e_3 [e:] hu [e] ku vowel/e_5 [i] en-sc vowel/e_6 [e] ht @@ -1844,11 +1842,11 @@ vowel/ee_1 [E] base2 [e] zhy vowel/ee_2 [E] cy [E2] nl + [E] pa [E] zh [E#] ku [&] da [?&] da - [E] pa [&] kk vowel/ee#_2 [E1] et [E-] sv @@ -1871,6 +1869,7 @@ vowel/ee_6 [&] sk [&] si [&:] si vowel/e_mid [E] en-rp + [E] ga [E] fr [E-] fr [E~] fr @@ -1902,7 +1901,6 @@ vowel/e_mid [E] en-rp [E] sl [E] ht [e] si - [E] ga vowel/e_mid2 [E] af [E] de [E2] de @@ -1923,6 +1921,7 @@ vowel/e_mid2 [E] af [e] sq [E] da [?E] da + [e] fa [e] nso [e] az [e] am @@ -1930,7 +1929,6 @@ vowel/e_mid2 [E] af [e:] si [e] mt [e] bo - [e] fa vowel/@_fnt [@] en-wi [@2] en-wi [@2] hr @@ -1946,6 +1944,7 @@ vowel/i [i] base [i] en-wm [i] en-wi [i:] cy + [i:] ga [i] eo [i] ne [i:] ta @@ -1963,6 +1962,7 @@ vowel/i [i] base [i] sw [i] hy [i] ka + [i] fa [i] rw [i#] rw [i] prs @@ -1973,8 +1973,6 @@ vowel/i [i] base [i:] te [i:] si [i] bo - [i] fa - [i:] ga [i] tt [i] kl vowel/i# [y:] cy @@ -2037,8 +2035,8 @@ vowel/ii [I] en-n [I] de [I:] de [I] fr-ca - [I] ml [I] nl + [I] ml [I] is [I:] is [i] zhy @@ -2054,21 +2052,21 @@ vowel/ii# [I#] en-us [I] kk [e] tt vowel/ii_2 [I] en + [I] ga [i] zh [I] da [I] mt - [I] ga vowel/ii#_2 [y] pl [y] am vowel/ii_3 [I] cy [I] fi [I1] et [I] hi + [I] pa [i] sk [I] hr [I] sv [I] no - [I] pa [i] sl vowel/ii#_3 [I2] en-us vowel/ii_4 [I2] en @@ -2092,8 +2090,8 @@ vowel/ii_6 [I] en-wm [I] sq [i] wo vowel/ii_7 [i] en - [i] sq [i] ga + [i] sq vowel/ii_8 [i] kk vowel/ii_final [i] en-us [i] en-rp @@ -2109,23 +2107,25 @@ vowel/@_low [@] en-rp [@/] ne [@] ur [@2] ur + [@] pa + [V] pa [@] ml [@] ro [a#] no [@] id - [@] pa - [V] pa [@] si vowel/@_low2 [@2] en-us vowel/o [o] base2 [o:] en [oU] en-n [oU] en-wi + [o:] ga [o:] de [o] eo [o:] et [o] fr [o] hi + [o:] pa [o] ta [o:] ta [o] kn @@ -2143,14 +2143,12 @@ vowel/o [o] base2 [o] hy [o] rw [o#] rw - [o:] pa [o] ak [o] wo [o:] wo [o] te [o:] te [o] bo - [o:] ga [o] kl vowel/o_2 [o:] cy [o:] hi @@ -2192,10 +2190,10 @@ vowel/o_mid [U@] en-rp [o] hu [o] bg [o] tr + [o] fa [o] az [o] dv [o:] dv - [o] fa [o] tt vowel/o_mid2 [O] fr [O] ht @@ -2256,9 +2254,9 @@ vowel/oo_4 [O] base2 [3:] en-wi [O1] et [O:] hi + [O] pa [O] it [O] an - [O] pa vowel/oo_5 [O] pl [O] is [O] sq @@ -2285,6 +2283,7 @@ vowelr/V_r [IR] en vowel/u [u] base [u:] en-wi [u:] cy + [u1] ga [u:] de [u] eo [u] ml @@ -2302,7 +2301,6 @@ vowel/u [u] base [u] ak [u:] wo [u] bo - [u1] ga [u] tt vowel/u# [u:] en-sc [Y] tr @@ -2344,13 +2342,15 @@ vowel/u#_7 [@] tr [@] az vowel/u_bck [u] base2 [U] cy + [u:] ga [u] fi [u] fr-ca + [u] nl [u:] hi [u] ne + [u] pa [u:] hu [u:] lt - [u] nl [u] pl [u:] sk [u] hr @@ -2372,25 +2372,23 @@ vowel/u_bck [u] base2 [u] ka [u] rw [u#] rw - [u] pa [u] mt - [u:] ga [u] ko vowel/u_bck2 [u] et [u] fr [u:] fr [u:] la [u] es - [u] ht [u] fa + [u] ht [u] kl vowel/u_bck3 [u:] et [u] kk vowel/uu [U] en [U] en-n [U] en-wm - [U] tn [U] ga + [U] tn vowel/uu# [U] ku vowel/uu_2 [U] base2 [U] de @@ -2406,13 +2404,13 @@ vowel/uu_4 [U] fi vowel/uu_bck [U] en-wi [U] fr-ca [U] hi + [U] pa [u] kn [u:] kn [u] hu [U] pt [U] no [u] zhy - [U] pa vowel/V [3] en-sc [@] bg [@] vi @@ -2427,13 +2425,13 @@ vowel/V_2 [V] en [V] ku vowel/V_3 [V] en-rp [V] hi + [V] pa [V] ta [a] bg - [V] pa vowel/V_4 [V] en-sc + [O] ga [V] da [?V] da - [O] ga vowel/V_6 [V] en-us [a#] lv vowel/y [y] base2 @@ -2443,8 +2441,8 @@ vowel/y [y] base2 [y:] et [y] fr [y-] fr - [y:] hu [y] nl + [y:] hu [y] la [yu] zhy [y] sq @@ -2460,8 +2458,8 @@ vowel/y# [Y] base2 [Y] et [Y:] et [Y] fr - [Y:] hu [8] nl + [Y:] hu [Y] ro [oe] zhy [W] tr diff --git a/phsource/ph_english_n b/phsource/ph_english_n index bd3bd128..0bf6b8e0 100644 --- a/phsource/ph_english_n +++ b/phsource/ph_english_n @@ -58,8 +58,7 @@ endphoneme phoneme i // optional variant of [I] for end of words vowel starttype #i endtype #i length 150 - IfNextVowelAppend(;) - FMT(vowel/e_3) + FMT(vowel/e_2) endphoneme diff --git a/phsource/ph_english_us b/phsource/ph_english_us index 662689c7..746ff73f 100644 --- a/phsource/ph_english_us +++ b/phsource/ph_english_us @@ -97,6 +97,7 @@ phoneme I# vowel starttype #i endtype #i unstressed length 160 + ipa ᵻ // FMT(vowel/@_fnt) FMT(vowel/ii#) endphoneme diff --git a/phsource/ph_hindi b/phsource/ph_hindi index 0ca2925c..02272d61 100644 --- a/phsource/ph_hindi +++ b/phsource/ph_hindi @@ -294,7 +294,7 @@ phoneme p endphoneme -phoneme ph +phoneme p# import_phoneme consonants/ph endphoneme @@ -304,10 +304,10 @@ phoneme b // this is [b] endphoneme -phoneme bh +phoneme b# vcd blb stop lengthmod 5 - voicingswitch ph + voicingswitch p# Vowelin f1=0 f2=1000 -50 -100 f3=-200 80 Vowelout f1=0 f2=1000 -500 -350 f3=-300 80 rms=30 @@ -330,7 +330,7 @@ phoneme t // dental variant of /t/ endphoneme -phoneme th // dental variant of /t/ +phoneme t# // dental variant of /t/ vls dnt stop lengthmod 2 voicingswitch d @@ -349,10 +349,10 @@ phoneme d // dental variant of /d/ endphoneme -phoneme dh +phoneme d# vcd dnt stop lengthmod 5 - voicingswitch th + voicingswitch t# Vowelin f1=0 f2=1500 -300 300 f3=-100 80 Vowelout f1=0 f2=1500 -300 250 f3=-100 80 rms=20 @@ -379,11 +379,11 @@ phoneme t. WAV(ustop/t_short) endphoneme -phoneme th. +phoneme t.# vls rfx stop lengthmod 2 - ipa ʈh - voicingswitch dh. + ipa ʈU+02B0 + voicingswitch d.# Vowelin f1=0 f2=1800 -300 300 f3=-400 80 Vowelout f1=0 f2=1800 -300 250 f3=-400 80 rms=20 colr=2 // WAV(ustop/th_rfx) @@ -410,11 +410,11 @@ phoneme d. endphoneme -phoneme dh. +phoneme d.# vcd rfx stop lengthmod 5 - ipa ɖh - voicingswitch th. + ipa ɖU+02B0 + voicingswitch t.# Vowelin f1=1 f2=1800 -300 300 f3=-400 80 Vowelout f1=1 f2=1800 -300 300 f3=-400 80 colr=2 @@ -439,7 +439,7 @@ phoneme c endphoneme -phoneme ch +phoneme c# CALL base/tS; ipa ch endphoneme @@ -450,10 +450,10 @@ phoneme J endphoneme -phoneme Jh +phoneme J# vcd pal afr sibilant lengthmod 5 - voicingswitch ch + voicingswitch c# Vowelin f1=0 f2=2700 400 600 f3=300 80 rate len=70 Vowelout f1=0 f2=2700 400 600 f3=300 80 colr=1 @@ -477,9 +477,9 @@ phoneme k voicingswitch g endphoneme -phoneme kh +phoneme k# import_phoneme consonants/kh - voicingswitch gh + voicingswitch g# endphoneme @@ -489,10 +489,10 @@ phoneme g endphoneme -phoneme gh +phoneme g# vcd dnt stop lengthmod 5 - voicingswitch kh + voicingswitch k# Vowelin f1=1 f2=2300 200 300 f3=-150 80 rms=20 Vowelout f1=0 f2=2300 300 400 f3=-150 80 rms=20 diff --git a/phsource/ph_malayalam b/phsource/ph_malayalam index bfcc104d..47b677d3 100644 --- a/phsource/ph_malayalam +++ b/phsource/ph_malayalam @@ -139,7 +139,7 @@ phoneme R import_phoneme base/R2 endphoneme -phoneme d# // 'rr' sounds like English 'd' +phoneme d2 // 'rr' sounds like English 'd' import_phoneme base/d endphoneme diff --git a/phsource/phonemes b/phsource/phonemes index cfc8da01..96bbb958 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -1690,6 +1690,9 @@ include ph_afrikaans phonemetable cy base include ph_welsh +phonemetable ga base +include ph_irish + phonemetable de base include ph_german @@ -1714,6 +1717,9 @@ include ph_french phonemetable fr-ca fr include ph_french_ca +phonemetable nl base +include ph_dutch + phonemetable hi base include ph_hindi @@ -1727,6 +1733,9 @@ include ph_nepali phonemetable ur hi include ph_urdu +phonemetable pa hi +include ph_punjabi + phonemetable ta hi include ph_tamil @@ -1737,6 +1746,7 @@ phonemetable ml hi include ph_malayalam + phonemetable hu base include ph_hungarian @@ -1747,9 +1757,6 @@ include ph_lithuanian phonemetable lv base include ph_latvian -phonemetable nl base -include ph_dutch - phonemetable pl base include ph_polish @@ -1854,6 +1861,9 @@ include ph_danish phonemetable ka base include ph_georgian +phonemetable fa base +include ph_farsi + //************************************************************************************** // The following lines are experimental, for future additions. @@ -1872,9 +1882,6 @@ include ph_kinyarwanda //phonemetable mn base //include ph_mongolian -phonemetable pa hi -include ph_punjabi - phonemetable prs base include ph_dari @@ -1924,12 +1931,6 @@ include ph_tibetan phonemetable kk base include ph_kazakh -phonemetable fa base -include ph_farsi - -phonemetable ga base -include ph_irish - phonemetable tt base include ph_tatar @@ -1939,3 +1940,4 @@ include ph_korean phonemetable kl base include ph_greenlandic + diff --git a/src/compiledict.cpp b/src/compiledict.cpp index 10427913..f360a084 100644 --- a/src/compiledict.cpp +++ b/src/compiledict.cpp @@ -67,7 +67,8 @@ MNEM_TAB mnem_rules[] = { {"p_alt5", 0x25}, {"p_alt6", 0x26}, {"p_alt", 0x21}, - {NULL, -1} }; + {NULL, -1} +}; MNEM_TAB mnem_flags[] = { // these in the first group put a value in bits0-3 of dictionary_flags @@ -182,13 +183,13 @@ const char *LookupMnemName(MNEM_TAB *table, const int value) //========================================================== /* Lookup a mnemonic string in a table, return its name */ { - while(table->mnem != NULL) - { - if(table->value==value) - return(table->mnem); - table++; - } - return(""); /* not found */ + while(table->mnem != NULL) + { + if(table->value==value) + return(table->mnem); + table++; + } + return(""); /* not found */ } /* end of LookupMnemValue */ @@ -200,27 +201,27 @@ void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len) int len; int total = 0; - buf[0] = 0; + buf[0] = 0; if((stress = flags[0] & 0xf) != 0) { - sprintf(buf, "%s", LookupMnemName(mnem_flags, stress + 0x40)); - total = strlen(buf); - buf += total; + sprintf(buf, "%s", LookupMnemName(mnem_flags, stress + 0x40)); + total = strlen(buf); + buf += total; } - for(ix=8; ix<64; ix++) - { - if(((ix < 30) && (flags[0] & (1 << ix))) || ((ix >= 0x20) && (flags[1] & (1 << (ix-0x20))))) - { - name = LookupMnemName(mnem_flags, ix); - len = strlen(name) + 1; - total += len; - if(total >= buf_len) - continue; - sprintf(buf, " %s", name); - buf += len; - } - } + for(ix=8; ix<64; ix++) + { + if(((ix < 30) && (flags[0] & (1 << ix))) || ((ix >= 0x20) && (flags[1] & (1 << (ix-0x20))))) + { + name = LookupMnemName(mnem_flags, ix); + len = strlen(name) + 1; + total += len; + if(total >= buf_len) + continue; + sprintf(buf, " %s", name); + buf += len; + } + } } @@ -228,12 +229,12 @@ void print_dictionary_flags(unsigned int *flags, char *buf, int buf_len) char *DecodeRule(const char *group_chars, int group_length, char *rule, int control) {//================================================================================= -/* Convert compiled match template to ascii */ + /* Convert compiled match template to ascii */ - unsigned char rb; + unsigned char rb; unsigned char c; char *p; - int ix; + int ix; int match_type; int finished=0; int value; @@ -243,18 +244,20 @@ char *DecodeRule(const char *group_chars, int group_length, char *rule, int cont int condition_num=0; int at_start = 0; const char *name; - char buf[60]; - char buf_pre[60]; + char buf[60]; + char buf_pre[60]; char suffix[20]; static char output[60]; - static char symbols[] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', - '&','%','+','#','S','D','Z','A','L','!',' ','@','?','J','N','K','V','?','T','X','?','W'}; + static char symbols[] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', + '&','%','+','#','S','D','Z','A','L','!',' ','@','?','J','N','K','V','?','T','X','?','W' + }; static char symbols_lg[] = {'A','B','C','H','F','G','Y'}; match_type = 0; - buf_pre[0] = 0; + buf_pre[0] = 0; for(ix=0; ixtranslator_name,word,phonetic,decoded_phonemes); -} + } } else { @@ -694,8 +686,7 @@ static char nullstring[] = {0}; ix = utf8_out(wc, word); word[ix] = 0; } - else - if(word[0] != '_') + else if(word[0] != '_') { // convert to lower case, and note if the word is all-capitals int c2; @@ -1082,8 +1073,7 @@ static void copy_rule_string(char *string, int &state) fprintf(f_log,"%5d: Expected 2 digits after 'L'\n",linenum); error_count++; } - else - if((c <= 0) || (c >= N_LETTER_GROUPS) || (letterGroupsDefined[(int)c] == 0)) + else if((c <= 0) || (c >= N_LETTER_GROUPS) || (letterGroupsDefined[(int)c] == 0)) { fprintf(f_log,"%5d: Letter group L%.2d not defined\n",linenum,c); error_count++; @@ -1162,9 +1152,9 @@ static void copy_rule_string(char *string, int &state) case 'a': sxflags |= SUFX_A; break; - case 'm': - sxflags |= SUFX_M; - break; + case 'm': + sxflags |= SUFX_M; + break; default: if(isdigit(c)) value = (value*10) + (c - '0'); @@ -1376,11 +1366,11 @@ int __cdecl string_sorter(char **a, char **b) char *pa, *pb; int ix; - if((ix = strcmp(pa = *a,pb = *b)) != 0) - return(ix); + if((ix = strcmp(pa = *a,pb = *b)) != 0) + return(ix); pa += (strlen(pa)+1); pb += (strlen(pb)+1); - return(strcmp(pa,pb)); + return(strcmp(pa,pb)); } /* end of string_sorter */ @@ -1471,12 +1461,12 @@ static void print_rule_group(FILE *f_out, int n_rules, char **rules, char *name) if(rule_pre[0] != 0) { p = buf; - for(ix=strlen(rule_pre)-1;ix>=0;ix--) + for(ix=strlen(rule_pre)-1; ix>=0; ix--) *p++ = rule_pre[ix]; sprintf(p,") "); spaces -= strlen(buf); for(ix=0; ix 0x20) // not space or zero-byte - { - p += utf8_in(&c,p); - replace1 += (c << ix); - ix += 16; - } - while(isspace2(*p)) p++; - ix = 0; - while((unsigned char)(*p) > 0x20) - { - p += utf8_in(&c,p); - replace2 += (c << ix); - ix += 16; - } - if(replace1 != 0) - { - Write4Bytes(f_out,replace1); // write as little-endian - Write4Bytes(f_out,replace2); // if big-endian, reverse the bytes in LoadDictionary() - } + p = buf; + replace1 = 0; + replace2 = 0; + while(isspace2(*p)) p++; + ix = 0; + while((unsigned char)(*p) > 0x20) // not space or zero-byte + { + p += utf8_in(&c,p); + replace1 += (c << ix); + ix += 16; } - break; + while(isspace2(*p)) p++; + ix = 0; + while((unsigned char)(*p) > 0x20) + { + p += utf8_in(&c,p); + replace2 += (c << ix); + ix += 16; + } + if(replace1 != 0) + { + Write4Bytes(f_out,replace1); // write as little-endian + Write4Bytes(f_out,replace2); // if big-endian, reverse the bytes in LoadDictionary() + } + } + break; } } fclose(f_temp); diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 2f54247f..89e389a4 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -48,50 +48,51 @@ static const unsigned short diereses_list[7] = {0xe4,0xeb,0xef,0xf6,0xfc,0xff,0} // used for checking for vowels (up to 0x259=schwa) #define N_REMOVE_ACCENT 0x25e static unsigned char remove_accent[N_REMOVE_ACCENT] = { -'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i', // 0c0 -'d','n','o','o','o','o','o', 0, 'o','u','u','u','u','y','t','s', // 0d0 -'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i', // 0e0 -'d','n','o','o','o','o','o', 0 ,'o','u','u','u','u','y','t','y', // 0f0 + 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i', // 0c0 + 'd','n','o','o','o','o','o', 0, 'o','u','u','u','u','y','t','s', // 0d0 + 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i', // 0e0 + 'd','n','o','o','o','o','o', 0 ,'o','u','u','u','u','y','t','y', // 0f0 -'a','a','a','a','a','a','c','c','c','c','c','c','c','c','d','d', // 100 -'d','d','e','e','e','e','e','e','e','e','e','e','g','g','g','g', // 110 -'g','g','g','g','h','h','h','h','i','i','i','i','i','i','i','i', // 120 -'i','i','i','i','j','j','k','k','k','l','l','l','l','l','l','l', // 130 -'l','l','l','n','n','n','n','n','n','n','n','n','o','o','o','o', // 140 -'o','o','o','o','r','r','r','r','r','r','s','s','s','s','s','s', // 150 -'s','s','t','t','t','t','t','t','u','u','u','u','u','u','u','u', // 160 -'u','u','u','u','w','w','y','y','y','z','z','z','z','z','z','s', // 170 -'b','b','b','b', 0, 0, 'o','c','c','d','d','d','d','d','e','e', // 180 -'e','f','f','g','g','h','i','i','k','k','l','l','m','n','n','o', // 190 -'o','o','o','o','p','p','y', 0, 0, 's','s','t','t','t','t','u', // 1a0 -'u','u','v','y','y','z','z','z','z','z','z','z', 0, 0, 0, 'w', // 1b0 -'t','t','t','k','d','d','d','l','l','l','n','n','n','a','a','i', // 1c0 -'i','o','o','u','u','u','u','u','u','u','u','u','u','e','a','a', // 1d0 -'a','a','a','a','g','g','g','g','k','k','o','o','o','o','z','z', // 1e0 -'j','d','d','d','g','g','w','w','n','n','a','a','a','a','o','o', // 1f0 + 'a','a','a','a','a','a','c','c','c','c','c','c','c','c','d','d', // 100 + 'd','d','e','e','e','e','e','e','e','e','e','e','g','g','g','g', // 110 + 'g','g','g','g','h','h','h','h','i','i','i','i','i','i','i','i', // 120 + 'i','i','i','i','j','j','k','k','k','l','l','l','l','l','l','l', // 130 + 'l','l','l','n','n','n','n','n','n','n','n','n','o','o','o','o', // 140 + 'o','o','o','o','r','r','r','r','r','r','s','s','s','s','s','s', // 150 + 's','s','t','t','t','t','t','t','u','u','u','u','u','u','u','u', // 160 + 'u','u','u','u','w','w','y','y','y','z','z','z','z','z','z','s', // 170 + 'b','b','b','b', 0, 0, 'o','c','c','d','d','d','d','d','e','e', // 180 + 'e','f','f','g','g','h','i','i','k','k','l','l','m','n','n','o', // 190 + 'o','o','o','o','p','p','y', 0, 0, 's','s','t','t','t','t','u', // 1a0 + 'u','u','v','y','y','z','z','z','z','z','z','z', 0, 0, 0, 'w', // 1b0 + 't','t','t','k','d','d','d','l','l','l','n','n','n','a','a','i', // 1c0 + 'i','o','o','u','u','u','u','u','u','u','u','u','u','e','a','a', // 1d0 + 'a','a','a','a','g','g','g','g','k','k','o','o','o','o','z','z', // 1e0 + 'j','d','d','d','g','g','w','w','n','n','a','a','a','a','o','o', // 1f0 -'a','a','a','a','e','e','e','e','i','i','i','i','o','o','o','o', // 200 -'r','r','r','r','u','u','u','u','s','s','t','t','y','y','h','h', // 210 -'n','d','o','o','z','z','a','a','e','e','o','o','o','o','o','o', // 220 -'o','o','y','y','l','n','t','j','d','q','a','c','c','l','t','s', // 230 -'z', 0, 0, 'b','u','v','e','e','j','j','q','q','r','r','y','y', // 240 -'a','a','a','b','o','c','d','d','e','e','e','e','e','e' }; + 'a','a','a','a','e','e','e','e','i','i','i','i','o','o','o','o', // 200 + 'r','r','r','r','u','u','u','u','s','s','t','t','y','y','h','h', // 210 + 'n','d','o','o','z','z','a','a','e','e','o','o','o','o','o','o', // 220 + 'o','o','y','y','l','n','t','j','d','q','a','c','c','l','t','s', // 230 + 'z', 0, 0, 'b','u','v','e','e','j','j','q','q','r','r','y','y', // 240 + 'a','a','a','b','o','c','d','d','e','e','e','e','e','e' +}; void strncpy0(char *to,const char *from, int size) -{//=============================================== - // strcpy with limit, ensures a zero terminator +{//=================================================== +// strcpy with limit, ensures a zero terminator strncpy(to,from,size); to[size-1] = 0; } int Reverse4Bytes(int word) -{//======================== - // reverse the order of bytes from little-endian to big-endian +{//========================== +// reverse the order of bytes from little-endian to big-endian #ifdef ARCH_BIG int ix; int word2 = 0; @@ -109,7 +110,7 @@ int Reverse4Bytes(int word) int LookupMnem(MNEM_TAB *table, const char *string) -{//================================================ +{//================================================== while(table->mnem != NULL) { if(strcmp(string,table->mnem)==0) @@ -128,9 +129,9 @@ int LookupMnem(MNEM_TAB *table, const char *string) static void InitGroups(Translator *tr) {//=================================== -/* Called after dictionary 1 is loaded, to set up table of entry points for translation rule chains - for single-letters and two-letter combinations -*/ +// Called after dictionary 1 is loaded, to set up table of entry points for translation rule chains +// for single-letters and two-letter combinations + int ix; char *p; @@ -203,13 +204,11 @@ static void InitGroups(Translator *tr) { tr->groups1[c] = p; } - else - if(len == 0) + else if(len == 0) { tr->groups1[0] = p; } - else - if(c == 1) + else if(c == 1) { // index by offset from letter base tr->groups3[c2 - 1] = p; @@ -287,7 +286,7 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) } if((Reverse4Bytes(pw[0]) != N_HASH_DICT) || - (length <= 0) || (length > 0x8000000)) + (length <= 0) || (length > 0x8000000)) { fprintf(stderr,"Bad data: '%s' (%x length=%x)\n",fname,Reverse4Bytes(pw[0]),length); return(2); @@ -312,7 +311,7 @@ int LoadDictionary(Translator *tr, const char *name, int no_error) if((tr->dict_min_size > 0) && (size < (unsigned int)tr->dict_min_size)) { - fprintf(stderr, "Full dictionary is not installed for '%s'\n", name); + fprintf(stderr, "Full dictionary is not installed for '%s'\n", name); } return(0); @@ -325,18 +324,18 @@ int HashDictionary(const char *string) This is used to access the dictionary_2 word-lookup dictionary */ { - int c; + int c; int chars=0; - int hash=0; + int hash=0; - while((c = (*string++ & 0xff)) != 0) - { - hash = hash * 8 + c; - hash = (hash & 0x3ff) ^ (hash >> 8); /* exclusive or */ + while((c = (*string++ & 0xff)) != 0) + { + hash = hash * 8 + c; + hash = (hash & 0x3ff) ^ (hash >> 8); /* exclusive or */ chars++; - } + } - return((hash+chars) & 0x3ff); // a 10 bit hash code + return((hash+chars) & 0x3ff); // a 10 bit hash code } // end of HashDictionary @@ -387,7 +386,7 @@ const char *EncodePhonemes(const char *p, char *outptr, unsigned char *bad_phone if((c = p[1]) == '|') { // treat double || as a word-break symbol, drop through - // to the default case with c = '|' + // to the default case with c = '|' } else { @@ -412,11 +411,11 @@ const char *EncodePhonemes(const char *p, char *outptr, unsigned char *bad_phone mnemonic_word = phoneme_tab[ix]->mnemonic; while(((c = p[count]) > ' ') && (count < 4) && - (c == ((mnemonic_word >> (count*8)) & 0xff))) + (c == ((mnemonic_word >> (count*8)) & 0xff))) count++; if((count > max) && - ((count == 4) || (((mnemonic_word >> (count*8)) & 0xff)==0))) + ((count == 4) || (((mnemonic_word >> (count*8)) & 0xff)==0))) { max = count; max_ph = phoneme_tab[ix]->code; @@ -474,16 +473,15 @@ const char *EncodePhonemes(const char *p, char *outptr, unsigned char *bad_phone void DecodePhonemes(const char *inptr, char *outptr) -//================================================== +{//================================================== // Translate from internal phoneme codes into phoneme mnemonics -{ unsigned char phcode; unsigned char c; unsigned int mnem; PHONEME_TAB *ph; static const char *stress_chars = "==,,'* "; -sprintf(outptr,"* "); + sprintf(outptr,"* "); while((phcode = *inptr++) > 0) { if(phcode == 255) @@ -520,12 +518,12 @@ sprintf(outptr,"* "); // using Kirschenbaum to IPA translation, ascii 0x20 to 0x7f unsigned short ipa1[96] = { -0x20,0x21,0x22,0x2b0,0x24,0x25,0x0e6,0x2c8,0x28,0x27e,0x2a,0x2b,0x2cc,0x2d,0x2e,0x2f, -0x252,0x31,0x32,0x25c,0x34,0x35,0x36,0x37,0x275,0x39,0x2d0,0x2b2,0x3c,0x3d,0x3e,0x294, -0x259,0x251,0x3b2,0xe7,0xf0,0x25b,0x46,0x262,0x127,0x26a,0x25f,0x4b,0x29f,0x271,0x14b,0x254, -0x3a6,0x263,0x280,0x283,0x3b8,0x28a,0x28c,0x153,0x3c7,0xf8,0x292,0x32a,0x5c,0x5d,0x5e,0x5f, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x261,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x303,0x7f + 0x20,0x21,0x22,0x2b0,0x24,0x25,0x0e6,0x2c8,0x28,0x27e,0x2a,0x2b,0x2cc,0x2d,0x2e,0x2f, + 0x252,0x31,0x32,0x25c,0x34,0x35,0x36,0x37,0x275,0x39,0x2d0,0x2b2,0x3c,0x3d,0x3e,0x294, + 0x259,0x251,0x3b2,0xe7,0xf0,0x25b,0x46,0x262,0x127,0x26a,0x25f,0x4b,0x29f,0x271,0x14b,0x254, + 0x3a6,0x263,0x280,0x283,0x3b8,0x28a,0x28c,0x153,0x3c7,0xf8,0x292,0x32a,0x5c,0x5d,0x5e,0x5f, + 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x261,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, + 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x303,0x7f }; @@ -568,28 +566,28 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int InterpretPhoneme(NULL, 0, plist, &phdata, NULL); } - p = phdata.ipa_string; - if(*p == 0x20) - { - // indicates no name for this phoneme - *phon_out = 0; - return(phon_out); - } - if((*p != 0) && ((*p & 0xff) < 0x20)) - { - // name starts with a flags byte - if(flags != NULL) - *flags = *p; - p++; - } + p = phdata.ipa_string; + if(*p == 0x20) + { + // indicates no name for this phoneme + *phon_out = 0; + return(phon_out); + } + if((*p != 0) && ((*p & 0xff) < 0x20)) + { + // name starts with a flags byte + if(flags != NULL) + *flags = *p; + p++; + } len = strlen(p); if(len > 0) { - strcpy(phon_out, p); - phon_out += len; - *phon_out = 0; - return(phon_out); + strcpy(phon_out, p); + phon_out += len; + *phon_out = 0; + return(phon_out); } } @@ -633,9 +631,9 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa) {//========================================================================= -/* Can be called after a clause has been translated into phonemes, in order - to display the clause in phoneme mnemonic form. -*/ + /* Can be called after a clause has been translated into phonemes, in order + to display the clause in phoneme mnemonic form. + */ int ix; unsigned int len; @@ -689,22 +687,22 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa) } } - flags = 0; + flags = 0; WritePhMnemonic(phon_buf2, plist->ph, plist, use_ipa, &flags); count = 0; for(p=phon_buf2; *p != 0;) { - p += utf8_in(&c, p); - if(use_ipa > 1) - { - // look for non-inital alphabetic character, but not diacritic, superscript etc. - if((count>0) && !(flags & (1 << (count-1))) && ((c < 0x2b0) || (c > 0x36f)) && iswalpha(c)) - { - buf += utf8_out(char_tie[use_ipa-2], buf); - } - } - buf += utf8_out(c, buf); - count++; + p += utf8_in(&c, p); + if(use_ipa > 1) + { + // look for non-inital alphabetic character, but not diacritic, superscript etc. + if((count>0) && !(flags & (1 << (count-1))) && ((c < 0x2b0) || (c > 0x36f)) && iswalpha(c)) + { + buf += utf8_out(char_tie[use_ipa-2], buf); + } + } + buf += utf8_out(c, buf); + count++; } if(plist->ph->code != phonSWITCH) @@ -755,7 +753,7 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa) static int IsLetterGroup(Translator *tr, char *word, int group, int pre) {//===================================================================== - // match the word against a list of utf-8 strings +// match the word against a list of utf-8 strings char *p; char *w; int len=0; @@ -810,7 +808,7 @@ static int IsLetter(Translator *tr, int letter, int group) if(tr->letter_bits_offset > 0) { if(((letter2 = (letter - tr->letter_bits_offset)) > 0) && (letter2 < 0x100)) - letter = letter2; + letter = letter2; else return(0); } @@ -854,11 +852,11 @@ static int Unpronouncable2(Translator *tr, char *word) int Unpronouncable(Translator *tr, char *word, int posn) {//===================================================== -/* Determines whether a word in 'unpronouncable', i.e. whether it should - be spoken as individual letters. + /* Determines whether a word in 'unpronouncable', i.e. whether it should + be spoken as individual letters. - This function may be language specific. This is a generic version. -*/ + This function may be language specific. This is a generic version. + */ int c; int c1=0; @@ -916,7 +914,7 @@ int Unpronouncable(Translator *tr, char *word, int posn) if(vowel_posn > (tr->langopts.max_initial_consonants+1)) return(1); // no vowel, or no vowel in first few letters -return(0); + return(0); } /* end of Unpronounceable */ @@ -1008,8 +1006,7 @@ static int GetVowelStress(Translator *tr, unsigned char *phonemes, signed char * count++; stress = -1; } - else - if(phcode == phonSYLLABIC) + else if(phcode == phonSYLLABIC) { // previous consonant phoneme is syllablic vowel_stress[count] = (char)stress; @@ -1063,7 +1060,8 @@ static int GetVowelStress(Translator *tr, unsigned char *phonemes, signed char * static char stress_phonemes[] = {phonSTRESS_D, phonSTRESS_U, phonSTRESS_2, phonSTRESS_3, - phonSTRESS_P, phonSTRESS_P2, phonSTRESS_TONIC}; + phonSTRESS_P, phonSTRESS_P2, phonSTRESS_TONIC + }; void ChangeWordStress(Translator *tr, char *word, int new_stress) @@ -1127,8 +1125,8 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, 'output' is used for input and output 'dictionary_flags' has bits 0-3 position of stressed vowel (if > 0) - or unstressed (if == 7) or syllables 1 and 2 (if == 6) - bits 8... dictionary flags + or unstressed (if == 7) or syllables 1 and 2 (if == 6) + bits 8... dictionary flags If 'tonic' is set (>= 0), replace highest stress by this value. @@ -1151,7 +1149,6 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, int final_ph; int final_ph2; int mnem; - int mnem2; int post_tonic; // currently not used int opt_length; int done; @@ -1242,6 +1239,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, } } + switch(tr->langopts.stress_rule) { case 8: @@ -1285,19 +1283,18 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { stressed_syllable = vowel_count - 2; - if(stressflags & 0x300) + if(stressflags & (S_FINAL_SPANISH | S_FINAL_STRESS_C)) { // LANG=Spanish, stress on last vowel if the word ends in a consonant other than 'n' or 's' if(phoneme_tab[final_ph]->type != phVOWEL) { - if(stressflags & 0x100) + if(stressflags & S_FINAL_STRESS_C) { stressed_syllable = vowel_count - 1; } else { mnem = phoneme_tab[final_ph]->mnemonic; - mnem2 = phoneme_tab[final_ph2]->mnemonic; if(tr->translator_name == L('a','n')) { @@ -1310,8 +1307,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { // -ns stress remains on penultimate syllable } - else - if(((phoneme_tab[final_ph]->type != phNASAL) && (mnem != 's')) || (phoneme_tab[final_ph2]->type != phVOWEL)) + else if(((phoneme_tab[final_ph]->type != phNASAL) && (mnem != 's')) || (phoneme_tab[final_ph2]->type != phVOWEL)) { stressed_syllable = vowel_count - 1; } @@ -1319,7 +1315,8 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, } } } - if(stressflags & 0x80000) + + if(stressflags & S_FINAL_LONG) { // stress on last syllable if it has a long vowel, but previous syllable has a short vowel if(vowel_length[vowel_count - 1] > vowel_length[vowel_count - 2]) @@ -1352,7 +1349,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, } break; - case 3: + case 3: // stress on last vowel if(stressed_syllable == 0) { @@ -1403,8 +1400,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { if(phoneme_tab[final_ph]->type == phVOWEL) stressed_syllable = guess_ru_v[vowel_count]; - else - if(phoneme_tab[final_ph]->type == phSTOP) + else if(phoneme_tab[final_ph]->type == phSTOP) stressed_syllable = guess_ru_t[vowel_count]; else stressed_syllable = guess_ru[vowel_count]; @@ -1440,8 +1436,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, // the only double=heavy syllable is the final syllable, so stress this stressed_syllable = vowel_count-1; } - else - if(max_weight <= 0) + else if(max_weight <= 0) { // all syllables, exclusing the last, are light. Stress the first syllable stressed_syllable = 1; @@ -1482,12 +1477,12 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, for(ix=1; ix < vowel_count; ix++) { if(vowel_stress[ix] == 4) - vowel_stress[ix] = 3; // change marked stress (consonant clusters) to secondary (except the last) + vowel_stress[ix] = 3; // change marked stress (consonant clusters) to secondary (except the last) if(vowel_length[ix] > 0) { - long_vowel = ix; - vowel_stress[ix] = 3; // give secondary stress to all long vowels + long_vowel = ix; + vowel_stress[ix] = 3; // give secondary stress to all long vowels } } @@ -1496,14 +1491,14 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { // no marked stress, choose the last long vowel if(long_vowel > 0) - stressed_syllable = long_vowel; + stressed_syllable = long_vowel; else { - // no long vowels or consonant clusters - if(vowel_count > 4) - stressed_syllable = vowel_count - 3; - else - stressed_syllable = vowel_count - 1; + // no long vowels or consonant clusters + if(vowel_count > 4) + stressed_syllable = vowel_count - 3; + else + stressed_syllable = vowel_count - 1; } } vowel_stress[stressed_syllable] = 4; @@ -1520,7 +1515,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, if(unstressed_word == 0) { - if((stressflags & 0x1000) && (vowel_count == 3)) + if((stressflags & S_2_SYL_2) && (vowel_count == 3)) { // Two syllable word, if one syllable has primary stress, then give the other secondary stress if(vowel_stress[1] == 4) @@ -1529,7 +1524,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, vowel_stress[1] = 3; } - if((stressflags & 0x2000) && (vowel_stress[1] < 0)) + if((stressflags & S_INITIAL_2) && (vowel_stress[1] < 0)) { // If there is only one syllable before the primary stress, give it a secondary stress if((vowel_count > 3) && (vowel_stress[2] >= 4)) @@ -1545,26 +1540,24 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { if(vowel_stress[v] < 0) { - if((stressflags & 0x10) && (stress < 4) && (v == vowel_count-1)) + if((stressflags & S_FINAL_NO_2) && (stress < 4) && (v == vowel_count-1)) { // flag: don't give secondary stress to final vowel } - else - if((stressflags & 0x8000) && (done == 0)) + else if((stressflags & 0x8000) && (done == 0)) { vowel_stress[v] = (char)stress; done =1; stress = 3; /* use secondary stress for remaining syllables */ } - else - if((vowel_stress[v-1] <= 1) && ((vowel_stress[v+1] <= 1) || ((stress == 4) && (vowel_stress[v+1] <= 2)))) + else if((vowel_stress[v-1] <= 1) && ((vowel_stress[v+1] <= 1) || ((stress == 4) && (vowel_stress[v+1] <= 2)))) { /* trochaic: give stress to vowel surrounded by unstressed vowels */ - if((stress == 3) && (stressflags & 0x20)) + if((stress == 3) && (stressflags & S_NO_AUTO_2)) continue; // don't use secondary stress - if((v > 1) && (stressflags & 0x40) && (syllable_weight[v]==0) && (syllable_weight[v+1]>0)) + if((v > 1) && (stressflags & S_2_TO_HEAVY) && (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; @@ -1582,8 +1575,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { if(first_primary == 0) first_primary = v; - else - if(stressflags & S_FIRST_PRIMARY) + else if(stressflags & S_FIRST_PRIMARY) { // reduce primary stresses after the first to secondary vowel_stress[v] = 3; @@ -1640,19 +1632,19 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, } else #endif - if((tr->langopts.vowel_pause & 0x30) && (ph->type == phVOWEL)) - { - // word starts with a vowel + if((tr->langopts.vowel_pause & 0x30) && (ph->type == phVOWEL)) + { + // word starts with a vowel - if((tr->langopts.vowel_pause & 0x20) && (vowel_stress[1] >= 4)) - { + if((tr->langopts.vowel_pause & 0x20) && (vowel_stress[1] >= 4)) + { *output++ = phonPAUSE_NOLINK; // not to be replaced by link + } + else + { + *output++ = phonPAUSE_VSHORT; // break, but no pause + } } - else - { - *output++ = phonPAUSE_VSHORT; // break, but no pause - } - } } p = phonetic; @@ -1669,8 +1661,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, { tr->prev_last_stress = 0; } - else - if(((ph->type == phVOWEL) && !(ph->phflags & phNONSYLLABIC)) || (*p == phonSYLLABIC)) + else if(((ph->type == phVOWEL) && !(ph->phflags & phNONSYLLABIC)) || (*p == phonSYLLABIC)) { // a vowel, or a consonant followed by a syllabic consonant marker @@ -1682,19 +1673,17 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, if(v_stress <= 1) { - if((v > 1) && (max_stress >= 2) && (stressflags & 4) && (v == (vowel_count-1))) + if((v > 1) && (max_stress >= 2) && (stressflags & S_FINAL_DIM) && (v == (vowel_count-1))) { // option: mark unstressed final syllable as diminished v_stress = 0; } - else - if((stressflags & 2) || (v == 1) || (v == (vowel_count-1))) + else if((stressflags & S_NO_DIM) || (v == 1) || (v == (vowel_count-1))) { // first or last syllable, or option 'don't set diminished stress' v_stress = 1; } - else - if((v == (vowel_count-2)) && (vowel_stress[vowel_count-1] <= 1)) + else if((v == (vowel_count-2)) && (vowel_stress[vowel_count-1] <= 1)) { // penultimate syllable, followed by an unstressed final syllable v_stress = 1; @@ -1702,7 +1691,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, else { // unstressed syllable within a word - if((vowel_stress[v-1] < 0) || ((stressflags & 0x10000) == 0)) + if((vowel_stress[v-1] < 0) || ((stressflags & S_MID_DIM) == 0)) { v_stress = 0; /* change to 0 (diminished stress) */ vowel_stress[v] = v_stress; @@ -1730,8 +1719,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, if(v != max_stress_posn) shorten = 1; } - else - if(v_stress < 4) + else if(v_stress < 4) { // only allow lengthen indicator if stress >= 4. shorten = 1; @@ -1807,7 +1795,7 @@ void AppendPhonemes(Translator *tr, char *string, int size, const char *ph) if(phoneme_tab[c]->type == phVOWEL) { if(((phoneme_tab[c]->phflags & phUNSTRESSED) == 0) && - (unstress_mark == 0)) + (unstress_mark == 0)) { tr->word_stressed_count++; } @@ -2075,8 +2063,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ add_points = (20-distance_right); post_ptr += letter_xbytes; } - else - if(tr->langopts.tone_numbers) + else if(tr->langopts.tone_numbers) { // also match if there is no digit add_points = (20-distance_right); @@ -2109,8 +2096,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ { match.end_type = SUFX_UNPRON; // $unpron } - else - if((command & 0xf0) == 0x10) + else if((command & 0xf0) == 0x10) { // $w_alt if(dict_flags & (1 << (BITNUM_FLAG_ALT + (command & 0xf)))) @@ -2118,8 +2104,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ else failed = 1; } - else - if((command & 0xf0) == 0x20) + else if((command & 0xf0) == 0x20) { // $p_alt // make a copy of the word up to the post-match characters @@ -2145,72 +2130,72 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ break; case RULE_SYLLABLE: - { - /* more than specified number of vowel letters to the right */ - char *p = post_ptr + letter_xbytes; - int vowel_count=0; + { + /* more than specified number of vowel letters to the right */ + char *p = post_ptr + letter_xbytes; + int vowel_count=0; - syllable_count = 1; - while(*rule == RULE_SYLLABLE) - { - rule++; - syllable_count+=1; /* number of syllables to match */ - } - vowel = 0; - while(letter_w != RULE_SPACE) - { - if((vowel==0) && IsLetter(tr, letter_w,LETTERGP_VOWEL2)) - { - // this is counting vowels which are separated by non-vowel letters - vowel_count++; - } - vowel = IsLetter(tr, letter_w,LETTERGP_VOWEL2); - p += utf8_in(&letter_w,p); - } - if(syllable_count <= vowel_count) - add_points = (18+syllable_count-distance_right); - else - failed = 1; + syllable_count = 1; + while(*rule == RULE_SYLLABLE) + { + rule++; + syllable_count+=1; /* number of syllables to match */ } - break; + vowel = 0; + while(letter_w != RULE_SPACE) + { + if((vowel==0) && IsLetter(tr, letter_w,LETTERGP_VOWEL2)) + { + // this is counting vowels which are separated by non-vowel letters + vowel_count++; + } + vowel = IsLetter(tr, letter_w,LETTERGP_VOWEL2); + p += utf8_in(&letter_w,p); + } + if(syllable_count <= vowel_count) + add_points = (18+syllable_count-distance_right); + else + failed = 1; + } + break; case RULE_NOVOWELS: + { + char *p = post_ptr + letter_xbytes; + while(letter_w != RULE_SPACE) { - char *p = post_ptr + letter_xbytes; - while(letter_w != RULE_SPACE) + if(IsLetter(tr, letter_w,LETTERGP_VOWEL2)) { - if(IsLetter(tr, letter_w,LETTERGP_VOWEL2)) - { - failed = 1; - break; - } - p += utf8_in(&letter_w,p); + failed = 1; + break; } - if(!failed) - add_points = (19-distance_right); + p += utf8_in(&letter_w,p); } - break; + if(!failed) + add_points = (19-distance_right); + } + break; case RULE_SKIPCHARS: + { + // Used for lang=Tamil, used to match on the next word after an unknown word ending + // only look until the end of the word (including the end-of-word marker) + // Jx means 'skip characters until x', where 'x' may be '_' for 'end of word' + char *p = post_ptr + letter_xbytes; + char *p2 = p; + int rule_w; // skip characters until this + utf8_in(&rule_w,rule); + while((letter_w != rule_w) && (letter_w != RULE_SPACE)) { - // Used for lang=Tamil, used to match on the next word after an unknown word ending - // only look until the end of the word (including the end-of-word marker) - // Jx means 'skip characters until x', where 'x' may be '_' for 'end of word' - char *p = post_ptr + letter_xbytes; - char *p2 = p; - int rule_w; // skip characters until this - utf8_in(&rule_w,rule); - while((letter_w != rule_w) && (letter_w != RULE_SPACE)) - { - p2 = p; - p += utf8_in(&letter_w,p); - } - if(letter_w == rule_w) - { - post_ptr = p2; - } + p2 = p; + p += utf8_in(&letter_w,p); } - break; + if(letter_w == rule_w) + { + post_ptr = p2; + } + } + break; case RULE_INC_SCORE: add_points = 20; // force an increase in points @@ -2229,20 +2214,20 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ break; case RULE_ENDING: - { - int end_type; - // next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length - end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f); + { + int end_type; + // next 3 bytes are a (non-zero) ending type. 2 bytes of flags + suffix length + end_type = (rule[0] << 16) + ((rule[1] & 0x7f) << 8) + (rule[2] & 0x7f); - if((tr->word_vowel_count == 0) && !(end_type & SUFX_P) && (tr->langopts.param[LOPT_SUFFIX] & 1)) - failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr). - else - { - match.end_type = end_type; - rule += 3; - } + if((tr->word_vowel_count == 0) && !(end_type & SUFX_P) && (tr->langopts.param[LOPT_SUFFIX] & 1)) + failed = 1; // don't match a suffix rule if there are no previous syllables (needed for lang=tr). + else + { + match.end_type = end_type; + rule += 3; } - break; + } + break; case RULE_NO_SUFFIX: if(word_flags & FLAG_SUFFIX_REMOVED) @@ -2364,21 +2349,21 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ break; case RULE_NOVOWELS: + { + char *p = pre_ptr - letter_xbytes - 1; + while(letter_w != RULE_SPACE) { - char *p = pre_ptr - letter_xbytes - 1; - while(letter_w != RULE_SPACE) + if(IsLetter(tr, letter_w,LETTERGP_VOWEL2)) { - if(IsLetter(tr, letter_w,LETTERGP_VOWEL2)) - { - failed = 1; - break; - } - p -= utf8_in2(&letter_w,p,1); + failed = 1; + break; } - if(!failed) - add_points = 3; + p -= utf8_in2(&letter_w,p,1); } - break; + if(!failed) + add_points = 3; + } + break; case RULE_IFVERB: if(tr->expect_verb) @@ -2499,8 +2484,8 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, char *end_phonemes, int word_flags, unsigned int *dict_flags) {//===================================================================================================================================== -/* Translate a word bounded by space characters - Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */ + /* Translate a word bounded by space characters + Append the result to 'phonemes' and any standard prefix/suffix in 'end_phonemes' */ unsigned char c, c2; unsigned int c12; @@ -2573,8 +2558,8 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c if(IsDigit(wc) && ((tr->langopts.tone_numbers == 0) || !any_alpha)) { // lookup the number in *_list not *_rules - char string[8]; - char buf[40]; + char string[8]; + char buf[40]; string[0] = '_'; memcpy(&string[1],p,wc_bytes); string[1+wc_bytes] = 0; @@ -2704,30 +2689,20 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c continue; // start again at the beginning of the word } } - else - if((letter >= 0x3200) && (letter < 0xa700) && (end_phonemes != NULL)) - { - // ideograms - // outside the range of the accent table, speak the unknown symbol sound - Lookup(tr, "_??", ph_buf); - match1.phonemes = ph_buf; - match1.points = 1; - p += (wc_bytes-1); - } if(((alphabet = AlphabetFromChar(letter)) != NULL) && (alphabet->offset != tr->letter_bits_offset)) { - if(tr->langopts.alt_alphabet == alphabet->offset) - { - sprintf(phonemes,"%c%s",phonSWITCH, tr->langopts.alt_alphabet_lang); - return(0); - } - if(alphabet->flags & AL_WORDS) - { - // switch to the nominated language for this alphabet - sprintf(phonemes,"%c%s",phonSWITCH, WordToString2(alphabet->language)); - return(0); - } + if(tr->langopts.alt_alphabet == alphabet->offset) + { + sprintf(phonemes,"%c%s",phonSWITCH, tr->langopts.alt_alphabet_lang); + return(0); + } + if(alphabet->flags & AL_WORDS) + { + // switch to the nominated language for this alphabet + sprintf(phonemes,"%c%s",phonSWITCH, WordToString2(alphabet->language)); + return(0); + } } } } @@ -2738,8 +2713,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c { // combining accent inside a word, ignore } - else - if(IsAlpha(wc)) + else if(IsAlpha(wc)) { if((any_alpha > 1) || (p[wc_bytes-1] > ' ')) { @@ -2778,8 +2752,8 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c #ifdef deleted // ?? allow $unpr while translating rules, not just on initial FLAG_UNPRON_TEST - if((match1.end_type & SUFX_UNPRON) && !(word_flags & FLAG_SUFFIX_REMOVED)) - return(match1.end_type); + if((match1.end_type & SUFX_UNPRON) && !(word_flags & FLAG_SUFFIX_REMOVED)) + return(match1.end_type); #endif if((match1.phonemes[0] == phonSWITCH) && ((word_flags & FLAG_DONT_SWITCH_TRANSLATOR)==0)) @@ -2824,7 +2798,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c void ApplySpecialAttribute2(Translator *tr, char *phonemes, int dict_flags) {//======================================================================== - // apply after the translation is complete +// apply after the translation is complete int ix; int len; char *p; @@ -2888,7 +2862,7 @@ int TransposeAlphabet(Translator *tr, char *text) const short *pairs_list; char buf[N_WORD_BYTES]; - p2 = buf; + p2 = buf; offset = tr->transpose_min - 1; min = tr->transpose_min; max = tr->transpose_max; @@ -2972,7 +2946,7 @@ int TransposeAlphabet(Translator *tr, char *text) } else { - return(strlen(text)); + return(strlen(text)); } } // end of TransposeAlphabet @@ -2980,7 +2954,7 @@ int TransposeAlphabet(Translator *tr, char *text) static const char *LookupDict2(Translator *tr, const char *word, const char *word2, - char *phonetic, unsigned int *flags, int end_flags, WORD_TAB *wtab) + char *phonetic, unsigned int *flags, int end_flags, WORD_TAB *wtab) //===================================================================================== /* Find an entry in the word_dict file for a specified word. Returns NULL if no match, else returns 'word_end' @@ -3096,8 +3070,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor condition_failed = 1; } } - else - if(flag > 80) + else if(flag > 80) { // flags 81 to 90 match more than one word // This comes after the other flags @@ -3132,16 +3105,14 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor p = next; word_end = word2 + n_chars; } - else - if(flag > 64) + else if(flag > 64) { // stressed syllable information, put in bits 0-3 dictionary_flags = (dictionary_flags & ~0xf) | (flag & 0xf); if((flag & 0xc) == 0xc) dictionary_flags |= FLAG_STRESS_END; } - else - if(flag >= 32) + else if(flag >= 32) { dictionary_flags2 |= (1L << (flag-32)); } @@ -3234,8 +3205,8 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor // OK, we are expecting a verb if((tr->translator_name == L('e','n')) && (tr->prev_dict_flags[0] & FLAG_ALT6_TRANS) && (end_flags & FLAG_SUFX_S)) { - // lang=en, don't use verb form after 'to' if the word has 's' suffix - continue; + // lang=en, don't use verb form after 'to' if the word has 's' suffix + continue; } } else @@ -3280,7 +3251,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor { if(option_phonemes == 2) { - print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); + print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); fprintf(f_trans,"Flags: %s %s\n", word1, dict_flags_buf); } return(0); // no phoneme translation found here, only flags. So use rules @@ -3316,7 +3287,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor { fprintf(f_trans,"Found: '%s",word1); } - print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); + print_dictionary_flags(flags, dict_flags_buf, sizeof(dict_flags_buf)); fprintf(f_trans,"' [%s] %s\n", ph_decoded,dict_flags_buf); } } @@ -3324,7 +3295,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor ix = utf8_in(&c, word); if((word[ix] == 0) && !IsAlpha(c)) { - flags[0] |= FLAG_MAX3; + flags[0] |= FLAG_MAX3; } return(word_end); @@ -3443,8 +3414,7 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f word[length-1] = 0; found = LookupDict2(tr, word, word1, ph_out, flags, end_flags, wtab); } - else - if((end_flags & SUFX_D) && (word[length-1] == word[length-2])) + else if((end_flags & SUFX_D) && (word[length-1] == word[length-2])) { // try removing a double letter word[length-1] = 0; @@ -3523,7 +3493,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) {//======================================================================== /* Removes a standard suffix from a word, once it has been indicated by the dictionary rules. end_type: bits 0-6 number of letters - bits 8-14 suffix flags + bits 8-14 suffix flags word_copy: make a copy of the original word This routine is language specific. In English it deals with reversing y->i and e-dropping @@ -3540,11 +3510,13 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) // these lists are language specific, but are only relevent if the 'e' suffix flag is used static const char *add_e_exceptions[] = { - "ion", NULL }; + "ion", NULL + }; static const char *add_e_additions[] = { // "c", "rs", "ir", "ur", "ath", "ns", "lu", NULL }; - "c", "rs", "ir", "ur", "ath", "ns", "u", NULL }; + "c", "rs", "ir", "ur", "ath", "ns", "u", NULL + }; for(word_end = word; *word_end != ' '; word_end++) { @@ -3556,12 +3528,12 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) if(word_copy != NULL) { - memcpy(word_copy,word,i); - word_copy[i] = 0; + memcpy(word_copy,word,i); + word_copy[i] = 0; } // look for multibyte characters to increase the number of bytes to remove - for(len_ending = i = (end_type & 0x3f); i>0 ;i--) // num.of characters of the suffix + for(len_ending = i = (end_type & 0x3f); i>0 ; i--) // num.of characters of the suffix { word_end--; while((*word_end & 0xc0) == 0x80) @@ -3604,8 +3576,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) word_end[2] = ' '; } } - else - if(tr->translator_name == L('e','n')) + else if(tr->translator_name == L('e','n')) { // add 'e' to end of stem if(IsLetter(tr, word_end[-1],LETTERGP_VOWEL2) && IsLetter(tr, word_end[0],1)) @@ -3636,8 +3607,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) } } } - else - if(tr->langopts.suffix_add_e != 0) + else if(tr->langopts.suffix_add_e != 0) { end_flags |= FLAG_SUFX_E_ADDED; } @@ -3646,10 +3616,10 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) { utf8_out(tr->langopts.suffix_add_e, &word_end[1]); - if(option_phonemes == 2) - { - fprintf(f_trans,"add e\n"); - } + if(option_phonemes == 2) + { + fprintf(f_trans,"add e\n"); + } } } @@ -3668,3 +3638,4 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) } /* end of RemoveEnding */ + diff --git a/src/numbers.cpp b/src/numbers.cpp index e60be3ad..493e69a7 100644 --- a/src/numbers.cpp +++ b/src/numbers.cpp @@ -72,36 +72,36 @@ static int number_control; typedef struct { -const char *name; -int flags; + const char *name; + int flags; } ACCENTS; // these are tokens to look up in the *_list file. static ACCENTS accents_tab[] = { -{"_lig", 1}, -{"_smc", 1}, // smallcap -{"_tur", 1}, // turned -{"_rev", 1}, // reversed -{"_crl", 0}, // curl + {"_lig", 1}, + {"_smc", 1}, // smallcap + {"_tur", 1}, // turned + {"_rev", 1}, // reversed + {"_crl", 0}, // curl -{"_acu", 0}, // acute -{"_brv", 0}, // breve -{"_hac", 0}, // caron/hacek -{"_ced", 0}, // cedilla -{"_cir", 0}, // circumflex -{"_dia", 0}, // diaeresis -{"_ac2", 0}, // double acute -{"_dot", 0}, // dot -{"_grv", 0}, // grave -{"_mcn", 0}, // macron -{"_ogo", 0}, // ogonek -{"_rng", 0}, // ring -{"_stk", 0}, // stroke -{"_tld", 0}, // tilde + {"_acu", 0}, // acute + {"_brv", 0}, // breve + {"_hac", 0}, // caron/hacek + {"_ced", 0}, // cedilla + {"_cir", 0}, // circumflex + {"_dia", 0}, // diaeresis + {"_ac2", 0}, // double acute + {"_dot", 0}, // dot + {"_grv", 0}, // grave + {"_mcn", 0}, // macron + {"_ogo", 0}, // ogonek + {"_rng", 0}, // ring + {"_stk", 0}, // stroke + {"_tld", 0}, // tilde -{"_bar", 0}, // bar -{"_rfx", 0}, // retroflex -{"_hok", 0}, // hook + {"_bar", 0}, // bar + {"_rfx", 0}, // retroflex + {"_hok", 0}, // hook }; @@ -127,270 +127,271 @@ static ACCENTS accents_tab[] = { static const short non_ascii_tab[] = { - 0, 0x3b1, 0x259, 0x25b, 0x3b3, 0x3b9, 0x153, 0x3c9, -0x3c6, 0x283, 0x3c5, 0x292, 0x294, 0x27e }; + 0, 0x3b1, 0x259, 0x25b, 0x3b3, 0x3b9, 0x153, 0x3c9, + 0x3c6, 0x283, 0x3c5, 0x292, 0x294, 0x27e +}; // characters U+00e0 to U+017f static const unsigned short letter_accents_0e0[] = { -LETTER('a',M_GRAVE,0), // U+00e0 -LETTER('a',M_ACUTE,0), -LETTER('a',M_CIRCUMFLEX,0), -LETTER('a',M_TILDE,0), -LETTER('a',M_DIAERESIS,0), -LETTER('a',M_RING,0), -LIGATURE('a','e',0), -LETTER('c',M_CEDILLA,0), -LETTER('e',M_GRAVE,0), -LETTER('e',M_ACUTE,0), -LETTER('e',M_CIRCUMFLEX,0), -LETTER('e',M_DIAERESIS,0), -LETTER('i',M_GRAVE,0), -LETTER('i',M_ACUTE,0), -LETTER('i',M_CIRCUMFLEX,0), -LETTER('i',M_DIAERESIS,0), -LETTER('d',M_NAME,0), // eth // U+00f0 -LETTER('n',M_TILDE,0), -LETTER('o',M_GRAVE,0), -LETTER('o',M_ACUTE,0), -LETTER('o',M_CIRCUMFLEX,0), -LETTER('o',M_TILDE,0), -LETTER('o',M_DIAERESIS,0), -0, // division sign -LETTER('o',M_STROKE,0), -LETTER('u',M_GRAVE,0), -LETTER('u',M_ACUTE,0), -LETTER('u',M_CIRCUMFLEX,0), -LETTER('u',M_DIAERESIS,0), -LETTER('y',M_ACUTE,0), -LETTER('t',M_NAME,0), // thorn -LETTER('y',M_DIAERESIS,0), -CAPITAL, // U+0100 -LETTER('a',M_MACRON,0), -CAPITAL, -LETTER('a',M_BREVE,0), -CAPITAL, -LETTER('a',M_OGONEK,0), -CAPITAL, -LETTER('c',M_ACUTE,0), -CAPITAL, -LETTER('c',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('c',M_DOT_ABOVE,0), -CAPITAL, -LETTER('c',M_CARON,0), -CAPITAL, -LETTER('d',M_CARON,0), -CAPITAL, // U+0110 -LETTER('d',M_STROKE,0), -CAPITAL, -LETTER('e',M_MACRON,0), -CAPITAL, -LETTER('e',M_BREVE,0), -CAPITAL, -LETTER('e',M_DOT_ABOVE,0), -CAPITAL, -LETTER('e',M_OGONEK,0), -CAPITAL, -LETTER('e',M_CARON,0), -CAPITAL, -LETTER('g',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('g',M_BREVE,0), -CAPITAL, // U+0120 -LETTER('g',M_DOT_ABOVE,0), -CAPITAL, -LETTER('g',M_CEDILLA,0), -CAPITAL, -LETTER('h',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('h',M_STROKE,0), -CAPITAL, -LETTER('i',M_TILDE,0), -CAPITAL, -LETTER('i',M_MACRON,0), -CAPITAL, -LETTER('i',M_BREVE,0), -CAPITAL, -LETTER('i',M_OGONEK,0), -CAPITAL, // U+0130 -LETTER('i',M_NAME,0), // dotless i -CAPITAL, -LIGATURE('i','j',0), -CAPITAL, -LETTER('j',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('k',M_CEDILLA,0), -LETTER('k',M_NAME,0), // kra -CAPITAL, -LETTER('l',M_ACUTE,0), -CAPITAL, -LETTER('l',M_CEDILLA,0), -CAPITAL, -LETTER('l',M_CARON,0), -CAPITAL, -LETTER('l',M_MIDDLE_DOT,0), // U+0140 -CAPITAL, -LETTER('l',M_STROKE,0), -CAPITAL, -LETTER('n',M_ACUTE,0), -CAPITAL, -LETTER('n',M_CEDILLA,0), -CAPITAL, -LETTER('n',M_CARON,0), -LETTER('n',M_NAME,0), // apostrophe n -CAPITAL, -LETTER('n',M_NAME,0), // eng -CAPITAL, -LETTER('o',M_MACRON,0), -CAPITAL, -LETTER('o',M_BREVE,0), -CAPITAL, // U+0150 -LETTER('o',M_DOUBLE_ACUTE,0), -CAPITAL, -LIGATURE('o','e',0), -CAPITAL, -LETTER('r',M_ACUTE,0), -CAPITAL, -LETTER('r',M_CEDILLA,0), -CAPITAL, -LETTER('r',M_CARON,0), -CAPITAL, -LETTER('s',M_ACUTE,0), -CAPITAL, -LETTER('s',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('s',M_CEDILLA,0), -CAPITAL, // U+0160 -LETTER('s',M_CARON,0), -CAPITAL, -LETTER('t',M_CEDILLA,0), -CAPITAL, -LETTER('t',M_CARON,0), -CAPITAL, -LETTER('t',M_STROKE,0), -CAPITAL, -LETTER('u',M_TILDE,0), -CAPITAL, -LETTER('u',M_MACRON,0), -CAPITAL, -LETTER('u',M_BREVE,0), -CAPITAL, -LETTER('u',M_RING,0), -CAPITAL, // U+0170 -LETTER('u',M_DOUBLE_ACUTE,0), -CAPITAL, -LETTER('u',M_OGONEK,0), -CAPITAL, -LETTER('w',M_CIRCUMFLEX,0), -CAPITAL, -LETTER('y',M_CIRCUMFLEX,0), -CAPITAL, // Y-DIAERESIS -CAPITAL, -LETTER('z',M_ACUTE,0), -CAPITAL, -LETTER('z',M_DOT_ABOVE,0), -CAPITAL, -LETTER('z',M_CARON,0), -LETTER('s',M_NAME,0), // long-s // U+17f + LETTER('a',M_GRAVE,0), // U+00e0 + LETTER('a',M_ACUTE,0), + LETTER('a',M_CIRCUMFLEX,0), + LETTER('a',M_TILDE,0), + LETTER('a',M_DIAERESIS,0), + LETTER('a',M_RING,0), + LIGATURE('a','e',0), + LETTER('c',M_CEDILLA,0), + LETTER('e',M_GRAVE,0), + LETTER('e',M_ACUTE,0), + LETTER('e',M_CIRCUMFLEX,0), + LETTER('e',M_DIAERESIS,0), + LETTER('i',M_GRAVE,0), + LETTER('i',M_ACUTE,0), + LETTER('i',M_CIRCUMFLEX,0), + LETTER('i',M_DIAERESIS,0), + LETTER('d',M_NAME,0), // eth // U+00f0 + LETTER('n',M_TILDE,0), + LETTER('o',M_GRAVE,0), + LETTER('o',M_ACUTE,0), + LETTER('o',M_CIRCUMFLEX,0), + LETTER('o',M_TILDE,0), + LETTER('o',M_DIAERESIS,0), + 0, // division sign + LETTER('o',M_STROKE,0), + LETTER('u',M_GRAVE,0), + LETTER('u',M_ACUTE,0), + LETTER('u',M_CIRCUMFLEX,0), + LETTER('u',M_DIAERESIS,0), + LETTER('y',M_ACUTE,0), + LETTER('t',M_NAME,0), // thorn + LETTER('y',M_DIAERESIS,0), + CAPITAL, // U+0100 + LETTER('a',M_MACRON,0), + CAPITAL, + LETTER('a',M_BREVE,0), + CAPITAL, + LETTER('a',M_OGONEK,0), + CAPITAL, + LETTER('c',M_ACUTE,0), + CAPITAL, + LETTER('c',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('c',M_DOT_ABOVE,0), + CAPITAL, + LETTER('c',M_CARON,0), + CAPITAL, + LETTER('d',M_CARON,0), + CAPITAL, // U+0110 + LETTER('d',M_STROKE,0), + CAPITAL, + LETTER('e',M_MACRON,0), + CAPITAL, + LETTER('e',M_BREVE,0), + CAPITAL, + LETTER('e',M_DOT_ABOVE,0), + CAPITAL, + LETTER('e',M_OGONEK,0), + CAPITAL, + LETTER('e',M_CARON,0), + CAPITAL, + LETTER('g',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('g',M_BREVE,0), + CAPITAL, // U+0120 + LETTER('g',M_DOT_ABOVE,0), + CAPITAL, + LETTER('g',M_CEDILLA,0), + CAPITAL, + LETTER('h',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('h',M_STROKE,0), + CAPITAL, + LETTER('i',M_TILDE,0), + CAPITAL, + LETTER('i',M_MACRON,0), + CAPITAL, + LETTER('i',M_BREVE,0), + CAPITAL, + LETTER('i',M_OGONEK,0), + CAPITAL, // U+0130 + LETTER('i',M_NAME,0), // dotless i + CAPITAL, + LIGATURE('i','j',0), + CAPITAL, + LETTER('j',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('k',M_CEDILLA,0), + LETTER('k',M_NAME,0), // kra + CAPITAL, + LETTER('l',M_ACUTE,0), + CAPITAL, + LETTER('l',M_CEDILLA,0), + CAPITAL, + LETTER('l',M_CARON,0), + CAPITAL, + LETTER('l',M_MIDDLE_DOT,0), // U+0140 + CAPITAL, + LETTER('l',M_STROKE,0), + CAPITAL, + LETTER('n',M_ACUTE,0), + CAPITAL, + LETTER('n',M_CEDILLA,0), + CAPITAL, + LETTER('n',M_CARON,0), + LETTER('n',M_NAME,0), // apostrophe n + CAPITAL, + LETTER('n',M_NAME,0), // eng + CAPITAL, + LETTER('o',M_MACRON,0), + CAPITAL, + LETTER('o',M_BREVE,0), + CAPITAL, // U+0150 + LETTER('o',M_DOUBLE_ACUTE,0), + CAPITAL, + LIGATURE('o','e',0), + CAPITAL, + LETTER('r',M_ACUTE,0), + CAPITAL, + LETTER('r',M_CEDILLA,0), + CAPITAL, + LETTER('r',M_CARON,0), + CAPITAL, + LETTER('s',M_ACUTE,0), + CAPITAL, + LETTER('s',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('s',M_CEDILLA,0), + CAPITAL, // U+0160 + LETTER('s',M_CARON,0), + CAPITAL, + LETTER('t',M_CEDILLA,0), + CAPITAL, + LETTER('t',M_CARON,0), + CAPITAL, + LETTER('t',M_STROKE,0), + CAPITAL, + LETTER('u',M_TILDE,0), + CAPITAL, + LETTER('u',M_MACRON,0), + CAPITAL, + LETTER('u',M_BREVE,0), + CAPITAL, + LETTER('u',M_RING,0), + CAPITAL, // U+0170 + LETTER('u',M_DOUBLE_ACUTE,0), + CAPITAL, + LETTER('u',M_OGONEK,0), + CAPITAL, + LETTER('w',M_CIRCUMFLEX,0), + CAPITAL, + LETTER('y',M_CIRCUMFLEX,0), + CAPITAL, // Y-DIAERESIS + CAPITAL, + LETTER('z',M_ACUTE,0), + CAPITAL, + LETTER('z',M_DOT_ABOVE,0), + CAPITAL, + LETTER('z',M_CARON,0), + LETTER('s',M_NAME,0), // long-s // U+17f }; // characters U+0250 to U+029F static const unsigned short letter_accents_250[] = { -LETTER('a',M_TURNED,0), // U+250 -LETTER(L_ALPHA,0,0), -LETTER(L_ALPHA,M_TURNED,0), -LETTER('b',M_IMPLOSIVE,0), -0, // open-o -LETTER('c',M_CURL,0), -LETTER('d',M_RETROFLEX,0), -LETTER('d',M_IMPLOSIVE,0), -LETTER('e',M_REVERSED,0), // U+258 -0, // schwa -LETTER(L_SCHWA,M_HOOK,0), -0, // open-e -LETTER(L_OPEN_E,M_REVERSED,0), -LETTER(L_OPEN_E,M_HOOK,M_REVERSED), -0,//LETTER(L_OPEN_E,M_CLOSED,M_REVERSED), -LETTER('j',M_BAR,0), -LETTER('g',M_IMPLOSIVE,0), // U+260 -LETTER('g',0,0), -LETTER('g',M_SMALLCAP,0), -LETTER(L_GAMMA,0,0), -0, // ramshorn -LETTER('h',M_TURNED,0), -LETTER('h',M_HOOK,0), -0,//LETTER(L_HENG,M_HOOK,0), -LETTER('i',M_BAR,0), // U+268 -LETTER(L_IOTA,0,0), -LETTER('i',M_SMALLCAP,0), -LETTER('l',M_TILDE,0), -LETTER('l',M_BAR,0), -LETTER('l',M_RETROFLEX,0), -LIGATURE('l','z',0), -LETTER('m',M_TURNED,0), -0,//LETTER('m',M_TURNED,M_LEG), // U+270 -LETTER('m',M_HOOK,0), -0,//LETTER('n',M_LEFTHOOK,0), -LETTER('n',M_RETROFLEX,0), -LETTER('n',M_SMALLCAP,0), -LETTER('o',M_BAR,0), -LIGATURE('o','e',M_SMALLCAP), -0,//LETTER(L_OMEGA,M_CLOSED,0), -LETTER(L_PHI,0,0), // U+278 -LETTER('r',M_TURNED,0), -0,//LETTER('r',M_TURNED,M_LEG), -LETTER('r',M_RETROFLEX,M_TURNED), -0,//LETTER('r',M_LEG,0), -LETTER('r',M_RETROFLEX,0), -0, // r-tap -LETTER(L_RTAP,M_REVERSED,0), -LETTER('r',M_SMALLCAP,0), // U+280 -LETTER('r',M_TURNED,M_SMALLCAP), -LETTER('s',M_RETROFLEX,0), -0, // esh -0,//LETTER('j',M_BAR,L_IMPLOSIVE), -LETTER(L_ESH,M_REVERSED,0), -LETTER(L_ESH,M_CURL,0), -LETTER('t',M_TURNED,0), -LETTER('t',M_RETROFLEX,0), // U+288 -LETTER('u',M_BAR,0), -LETTER(L_UPSILON,0,0), -LETTER('v',M_HOOK,0), -LETTER('v',M_TURNED,0), -LETTER('w',M_TURNED,0), -LETTER('y',M_TURNED,0), -LETTER('y',M_SMALLCAP,0), -LETTER('z',M_RETROFLEX,0), // U+290 -LETTER('z',M_CURL,0), -0, // ezh -LETTER(L_EZH,M_CURL,0), -0, // glottal stop -LETTER(L_GLOTTAL,M_REVERSED,0), -LETTER(L_GLOTTAL,M_TURNED,0), -0,//LETTER('c',M_LONG,0), -0, // bilabial click // U+298 -LETTER('b',M_SMALLCAP,0), -0,//LETTER(L_OPEN_E,M_CLOSED,0), -LETTER('g',M_IMPLOSIVE,M_SMALLCAP), -LETTER('h',M_SMALLCAP,0), -LETTER('j',M_CURL,0), -LETTER('k',M_TURNED,0), -LETTER('l',M_SMALLCAP,0), -LETTER('q',M_HOOK,0), // U+2a0 -LETTER(L_GLOTTAL,M_STROKE,0), -LETTER(L_GLOTTAL,M_STROKE,M_REVERSED), -LIGATURE('d','z',0), -0, // dezh -LIGATURE('d','z',M_CURL), -LIGATURE('t','s',0), -0, // tesh -LIGATURE('t','s',M_CURL), + LETTER('a',M_TURNED,0), // U+250 + LETTER(L_ALPHA,0,0), + LETTER(L_ALPHA,M_TURNED,0), + LETTER('b',M_IMPLOSIVE,0), + 0, // open-o + LETTER('c',M_CURL,0), + LETTER('d',M_RETROFLEX,0), + LETTER('d',M_IMPLOSIVE,0), + LETTER('e',M_REVERSED,0), // U+258 + 0, // schwa + LETTER(L_SCHWA,M_HOOK,0), + 0, // open-e + LETTER(L_OPEN_E,M_REVERSED,0), + LETTER(L_OPEN_E,M_HOOK,M_REVERSED), + 0,//LETTER(L_OPEN_E,M_CLOSED,M_REVERSED), + LETTER('j',M_BAR,0), + LETTER('g',M_IMPLOSIVE,0), // U+260 + LETTER('g',0,0), + LETTER('g',M_SMALLCAP,0), + LETTER(L_GAMMA,0,0), + 0, // ramshorn + LETTER('h',M_TURNED,0), + LETTER('h',M_HOOK,0), + 0,//LETTER(L_HENG,M_HOOK,0), + LETTER('i',M_BAR,0), // U+268 + LETTER(L_IOTA,0,0), + LETTER('i',M_SMALLCAP,0), + LETTER('l',M_TILDE,0), + LETTER('l',M_BAR,0), + LETTER('l',M_RETROFLEX,0), + LIGATURE('l','z',0), + LETTER('m',M_TURNED,0), + 0,//LETTER('m',M_TURNED,M_LEG), // U+270 + LETTER('m',M_HOOK,0), + 0,//LETTER('n',M_LEFTHOOK,0), + LETTER('n',M_RETROFLEX,0), + LETTER('n',M_SMALLCAP,0), + LETTER('o',M_BAR,0), + LIGATURE('o','e',M_SMALLCAP), + 0,//LETTER(L_OMEGA,M_CLOSED,0), + LETTER(L_PHI,0,0), // U+278 + LETTER('r',M_TURNED,0), + 0,//LETTER('r',M_TURNED,M_LEG), + LETTER('r',M_RETROFLEX,M_TURNED), + 0,//LETTER('r',M_LEG,0), + LETTER('r',M_RETROFLEX,0), + 0, // r-tap + LETTER(L_RTAP,M_REVERSED,0), + LETTER('r',M_SMALLCAP,0), // U+280 + LETTER('r',M_TURNED,M_SMALLCAP), + LETTER('s',M_RETROFLEX,0), + 0, // esh + 0,//LETTER('j',M_BAR,L_IMPLOSIVE), + LETTER(L_ESH,M_REVERSED,0), + LETTER(L_ESH,M_CURL,0), + LETTER('t',M_TURNED,0), + LETTER('t',M_RETROFLEX,0), // U+288 + LETTER('u',M_BAR,0), + LETTER(L_UPSILON,0,0), + LETTER('v',M_HOOK,0), + LETTER('v',M_TURNED,0), + LETTER('w',M_TURNED,0), + LETTER('y',M_TURNED,0), + LETTER('y',M_SMALLCAP,0), + LETTER('z',M_RETROFLEX,0), // U+290 + LETTER('z',M_CURL,0), + 0, // ezh + LETTER(L_EZH,M_CURL,0), + 0, // glottal stop + LETTER(L_GLOTTAL,M_REVERSED,0), + LETTER(L_GLOTTAL,M_TURNED,0), + 0,//LETTER('c',M_LONG,0), + 0, // bilabial click // U+298 + LETTER('b',M_SMALLCAP,0), + 0,//LETTER(L_OPEN_E,M_CLOSED,0), + LETTER('g',M_IMPLOSIVE,M_SMALLCAP), + LETTER('h',M_SMALLCAP,0), + LETTER('j',M_CURL,0), + LETTER('k',M_TURNED,0), + LETTER('l',M_SMALLCAP,0), + LETTER('q',M_HOOK,0), // U+2a0 + LETTER(L_GLOTTAL,M_STROKE,0), + LETTER(L_GLOTTAL,M_STROKE,M_REVERSED), + LIGATURE('d','z',0), + 0, // dezh + LIGATURE('d','z',M_CURL), + LIGATURE('t','s',0), + 0, // tesh + LIGATURE('t','s',M_CURL), }; static int LookupLetter2(Translator *tr, unsigned int letter, char *ph_buf) -{//======================================================================== +{ //======================================================================== int len; char single_letter[10]; @@ -431,8 +432,7 @@ void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf) { accent_data = letter_accents_0e0[letter - 0xe0]; } - else - if((letter >= 0x250) && (letter <= 0x2a8)) + else if((letter >= 0x250) && (letter <= 0x2a8)) { accent_data = letter_accents_250[letter - 0x250]; } @@ -485,8 +485,7 @@ void LookupAccentedLetter(Translator *tr, unsigned int letter, char *ph_buf) { if(accent1 == 0) strcpy(ph_buf, ph_letter1); - else - if((tr->langopts.accents & 1) || (accents_tab[accent1].flags & 1)) + else if((tr->langopts.accents & 1) || (accents_tab[accent1].flags & 1)) sprintf(ph_buf,"%s%c%c%s", ph_accent1, phonPAUSE_VSHORT, phonSTRESS_P, ph_letter1); else sprintf(ph_buf,"%c%s%c%s%c", phonSTRESS_2, ph_letter1, phonPAUSE_VSHORT, ph_accent1, phonPAUSE_VSHORT); @@ -595,18 +594,19 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) char *pbuf; ALPHABET *alphabet; int language; - int phontab_1; - int alphabet_name_switch; - char *ph_alphabet_end; + int phontab_1; + int speak_letter_number; char capital[20]; char ph_buf[80]; char ph_buf2[80]; char ph_alphabet[80]; char hexbuf[6]; + static char pause_string[] = {phonPAUSE, 0}; ph_buf[0] = 0; ph_alphabet[0] = 0; capital[0] = 0; + phontab_1 = translator->phoneme_tab_ix; n_bytes = utf8_in(&letter,word); @@ -633,94 +633,83 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) return(0); } - alphabet_name_switch = 0; - alphabet = AlphabetFromChar(letter); - if(alphabet != current_alphabet) - { - // speak the name of the alphabet - current_alphabet = alphabet; - if((alphabet != NULL) && !(alphabet->flags & AL_DONT_NAME) && (alphabet->offset != translator->letter_bits_offset)) - { - if((alphabet->flags & AL_DONT_NAME) || (alphabet->offset == translator->langopts.alt_alphabet)) - { - // don't say the alphabet name - } - else - { - phontab_1 = tr->phoneme_tab_ix; - ph_buf2[0] = 0; - if(Lookup(translator, alphabet->name, ph_alphabet) == 0) // the original language for the current voice - { - // Can't find the local name for this alphabet, use the English name - ph_alphabet[2] = SetTranslator2("en"); // overwrites previous contents of translator2 - Lookup(translator2, alphabet->name, ph_buf2); - } - else - if(translator != tr) - { - phontab_1 = tr->phoneme_tab_ix; - strcpy(ph_buf2, ph_alphabet); - ph_alphabet[2] = translator->phoneme_tab_ix; - } + alphabet = AlphabetFromChar(letter); + if(alphabet != current_alphabet) + { + // speak the name of the alphabet + current_alphabet = alphabet; + if((alphabet != NULL) && !(alphabet->flags & AL_DONT_NAME) && (alphabet->offset != translator->letter_bits_offset)) + { + if((alphabet->flags & AL_DONT_NAME) || (alphabet->offset == translator->langopts.alt_alphabet)) + { + // don't say the alphabet name + } + else + { + ph_buf2[0] = 0; + if(Lookup(translator, alphabet->name, ph_alphabet) == 0) // the original language for the current voice + { + // Can't find the local name for this alphabet, use the English name + ph_alphabet[2] = SetTranslator2("en"); // overwrites previous contents of translator2 + Lookup(translator2, alphabet->name, ph_buf2); + } + else if(translator != tr) + { + phontab_1 = tr->phoneme_tab_ix; + strcpy(ph_buf2, ph_alphabet); + ph_alphabet[2] = translator->phoneme_tab_ix; + } - if(ph_buf2[0] != 0) - { - // we used a different language for the alphabet name (now in ph_buf2) - ph_alphabet[0] = phonPAUSE; - ph_alphabet[1] = phonSWITCH; - strcpy(&ph_alphabet[3], ph_buf2); - len = strlen(ph_buf2) + 3; - ph_alphabet[len] = phonSWITCH; - ph_alphabet[len+1] = phontab_1; - ph_alphabet[len+2] = 0; - - ph_alphabet_end = &ph_alphabet[len]; - alphabet_name_switch = ph_alphabet[2]; - } - } - } - } + if(ph_buf2[0] != 0) + { + // we used a different language for the alphabet name (now in ph_buf2) + ph_alphabet[0] = phonPAUSE; + ph_alphabet[1] = phonSWITCH; + strcpy(&ph_alphabet[3], ph_buf2); + len = strlen(ph_buf2) + 3; + ph_alphabet[len] = phonSWITCH; + ph_alphabet[len+1] = phontab_1; + ph_alphabet[len+2] = 0; + } + } + } + } // caution: SetWordStress() etc don't expect phonSWITCH + phoneme table number if(ph_buf[0] == 0) { - if((alphabet != NULL) && (alphabet->language != 0) && !(alphabet->flags & AL_NOT_LETTERS)) - language = alphabet->language; - else - language = L('e','n'); + if((alphabet != NULL) && (alphabet->language != 0) && !(alphabet->flags & AL_NOT_LETTERS)) + language = alphabet->language; + else + language = L('e','n'); - if(language != tr->translator_name) - { - // speak in the language for this alphabet (or English) - ph_buf[2] = SetTranslator2(WordToString2(language)); - LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1); + if(language != tr->translator_name) + { + // speak in the language for this alphabet (or English) + ph_buf[2] = SetTranslator2(WordToString2(language)); + LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1); - if(ph_buf[3] == phonSWITCH) - { - // another level of language change - ph_buf[2] = SetTranslator2(&ph_buf[4]); - LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1); - } + if(ph_buf[3] == phonSWITCH) + { + // another level of language change + ph_buf[2] = SetTranslator2(&ph_buf[4]); + LookupLetter(translator2, letter, word[n_bytes], &ph_buf[3], control & 1); + } - SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table + SelectPhonemeTable(voice->phoneme_tab_ix); // revert to original phoneme table - if(ph_buf[3] != 0) - { - ph_buf[0] = phonPAUSE; - ph_buf[1] = phonSWITCH; - len = strlen(&ph_buf[3]) + 3; - ph_buf[len] = phonSWITCH; // switch back - ph_buf[len+1] = tr->phoneme_tab_ix; - ph_buf[len+2] = 0; - } - } - - if((ph_buf[2] == alphabet_name_switch) && (capital[0] == 0)) - { - ph_alphabet_end[0]= 0; - } + if(ph_buf[3] != 0) + { + ph_buf[0] = phonPAUSE; + ph_buf[1] = phonSWITCH; + len = strlen(&ph_buf[3]) + 3; + ph_buf[len] = phonSWITCH; // switch back + ph_buf[len+1] = tr->phoneme_tab_ix; + ph_buf[len+2] = 0; + } + } } if(ph_buf[0] == 0) @@ -729,7 +718,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) if((letter >= 0x2800) && (letter <= 0x28ff)) { // braille dots symbol - Lookup(tr, "_braille", ph_buf); + Lookup(translator, "_braille", ph_buf); if(ph_buf[0] == 0) { EncodePhonemes("br'e:l", ph_buf, NULL); @@ -743,7 +732,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) if(letter & (1 << ix)) { *pbuf++ = phonPAUSE_VSHORT; - LookupLetter(tr, '1'+ix, 0, pbuf, 1); + LookupLetter(translator, '1'+ix, 0, pbuf, 1); pbuf += strlen(pbuf); } } @@ -753,12 +742,29 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) if(ph_buf[0]== 0) { if(iswalpha(letter)) - Lookup(tr, "_?A", ph_buf); + Lookup(translator, "_?A", ph_buf); if((ph_buf[0]==0) && !iswspace(letter)) - Lookup(tr, "_??", ph_buf); + Lookup(translator, "_??", ph_buf); - if(ph_buf[0] != 0) + speak_letter_number = 1; + if(ph_buf[0] == 0) + { + EncodePhonemes("l'et@", ph_buf, NULL); + if(translator->letter_bits_offset != 0) + speak_letter_number = 0; // non-latin alphabet, no _?? entry, may not be able to speak hexadecimal + } + + if(!(control & 2) && (alphabet != NULL) && (alphabet->flags & AL_NOT_CODE)) + { + // don't speak the character code number + speak_letter_number = 0; + } + + if((ph_alphabet[0] != 0) && speak_letter_number) + ph_buf[0] = 0; // don't speak "letter" if we speak alphabet name + + if(speak_letter_number) { // speak the hexadecimal number of the character code sprintf(hexbuf,"%x",letter); @@ -767,8 +773,9 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) { pbuf += strlen(pbuf); *pbuf++ = phonPAUSE_VSHORT; - LookupLetter(tr, *p2, 0, pbuf, 1); + LookupLetter(translator, *p2, 0, pbuf, 1); } + strcat(pbuf, pause_string); } } } @@ -831,8 +838,7 @@ void SetSpellingStress(Translator *tr, char *phonemes, int control, int n_chars) } } } - else - if(c == 0xff) + else if(c == 0xff) { if((control < 2) || (ix==0)) continue; // don't insert pauses @@ -878,7 +884,7 @@ static int CheckDotOrdinal(Translator *tr, char *word, char *word_end, WORD_TAB { // ordinal number is indicated by dot after the number // but not if the next word starts with an upper-case letter - // (c2 == 0) is for cases such as, "2.," + // (c2 == 0) is for cases such as, "2.," ordinal = 2; if(word_end[0] == '.') word_end[0] = ' '; @@ -892,8 +898,8 @@ static int CheckDotOrdinal(Translator *tr, char *word, char *word_end, WORD_TAB nextflags = TranslateWord(tr, &word_end[2], 0, NULL, NULL); } -if((tr->prev_dict_flags[0] & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG_COMMA_AFTER) || iswdigit(c2))) - ordinal = 0; // TEST 09.02.10 + if((tr->prev_dict_flags[0] & FLAG_ALT_TRANS) && ((c2 == 0) || (wtab[0].flags & FLAG_COMMA_AFTER) || iswdigit(c2))) + ordinal = 0; // TEST 09.02.10 if(nextflags & FLAG_ALT_TRANS) ordinal = 0; @@ -991,8 +997,7 @@ int TranslateRoman(Translator *tr, char *word, char *ph_out, WORD_TAB *wtab) subtract = prev; value -= subtract; } - else - if(value >= subtract) + else if(value >= subtract) return(0); else acc += prev; @@ -1276,8 +1281,7 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out sprintf(string,"_%df",value); found = Lookup(tr, string, ph_digits); } - else - if(is_ordinal) + else if(is_ordinal) { strcpy(ph_ordinal, ph_ordinal2); @@ -1345,7 +1349,7 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out { if((is_ordinal) && - ((units == 0) || (tr->langopts.numbers & NUM_SWAP_TENS) || (tr->langopts.numbers2 & NUM2_MULTIPLE_ORDINAL))) + ((units == 0) || (tr->langopts.numbers & NUM_SWAP_TENS) || (tr->langopts.numbers2 & NUM2_MULTIPLE_ORDINAL))) { sprintf(string,"_%dX%c", tens, ord_type); if(Lookup(tr, string, ph_tens) != 0) @@ -1410,8 +1414,7 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out sprintf(string,"_%de",units); found = Lookup(tr, string, ph_digits); } - else - if(((control & 2) == 0) || ((tr->langopts.numbers & NUM_SWAP_TENS) != 0)) + else if(((control & 2) == 0) || ((tr->langopts.numbers & NUM_SWAP_TENS) != 0)) { // followed by hundreds or thousands (or tens) sprintf(string,"_%da",units); @@ -1482,8 +1485,7 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out } } } - else - if(tr->langopts.numbers & NUM_SINGLE_STRESS) + else if(tr->langopts.numbers & NUM_SINGLE_STRESS) { // only one primary stress found = 0; @@ -1567,8 +1569,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null // speak numbers such as 1984 as years: nineteen-eighty-four // ph_100[0] = 0; // don't say "hundred", we also need to surpess "and" } - else - if(hundreds >= 10) + else if(hundreds >= 10) { ph_digits[0] = 0; @@ -1614,7 +1615,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null found = 0; if((ordinal) - && ((tensunits == 0) || (tr->langopts.numbers2 & NUM2_MULTIPLE_ORDINAL))) + && ((tensunits == 0) || (tr->langopts.numbers2 & NUM2_MULTIPLE_ORDINAL))) { // ordinal number sprintf(string, "_%dCo", hundreds); @@ -1636,7 +1637,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null { if((!found) && (tensunits == 0)) { - // is there a special pronunciation for exactly n00 ? + // is there a special pronunciation for exactly n00 ? sprintf(string,"_%dC0",hundreds); found = Lookup(tr, string, ph_digits); } @@ -1767,7 +1768,6 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned int thousands_inc = 0; int prev_thousands = 0; int ordinal = 0; - int dot_ordinal; int this_value; int decimal_count; int max_decimal_count; @@ -1806,8 +1806,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned { prev_thousands = 1; } - else - if((tr->langopts.thousands_sep == ' ') || (tr->langopts.numbers & NUM_ALLOW_SPACE)) + else if((tr->langopts.thousands_sep == ' ') || (tr->langopts.numbers & NUM_ALLOW_SPACE)) { // thousands groups can be separated by spaces if((n_digits == 3) && !(wtab->flags & FLAG_MULTIPLE_SPACES) && isdigit(word[-2])) @@ -1827,7 +1826,9 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned { // don't check for ordinal if the number has a leading zero if((ordinal = CheckDotOrdinal(tr, word, &word[ix], wtab, 0)) != 0) - dot_ordinal = 1; + { +// dot_ordinal = 1; + } } if((word[ix] == '.') && !isdigit(word[ix+1]) && !isdigit(word[ix+2]) && !(wtab[1].flags & FLAG_NOSPACE)) @@ -1859,8 +1860,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned { ordinal = 2; } - else - if(!isdigit(suffix[0])) // not _#9 (tab) + else if(!isdigit(suffix[0])) // not _#9 (tab) { sprintf(string,"_#%s",suffix); if(Lookup(tr, string, ph_ordinal2)) @@ -1905,8 +1905,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned if((tr->langopts.numbers & NUM_ALLOW_SPACE) && (word[n_digits] == ' ')) thousands_inc = 1; - else - if(word[n_digits] == tr->langopts.thousands_sep) + else if(word[n_digits] == tr->langopts.thousands_sep) thousands_inc = 2; suffix_ix = n_digits+2; @@ -1959,8 +1958,7 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned Lookup(tr, "_dpt", ph_append); decimal_point = 0x100; } - else - if(suppress_null == 0) + else if(suppress_null == 0) { if(thousands_inc > 0) { @@ -1978,16 +1976,16 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned } else - if(speak_missing_thousands == 1) - { - // speak this thousandplex if there was no word for the previous thousandplex - sprintf(string,"_0M%d",thousandplex+1); - if(Lookup(tr, string, buf1)==0) + if(speak_missing_thousands == 1) { - sprintf(string,"_0M%d",thousandplex); - Lookup(tr, string, ph_append); + // speak this thousandplex if there was no word for the previous thousandplex + sprintf(string,"_0M%d",thousandplex+1); + if(Lookup(tr, string, buf1)==0) + { + sprintf(string,"_0M%d",thousandplex); + Lookup(tr, string, ph_append); + } } - } if((ph_append[0] == 0) && (word[n_digits] == '.') && (thousandplex == 0)) { @@ -2114,9 +2112,9 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned // Romanian decimal fractions if((decimal_count <= 4) && (word[n_digits] != '0')) { - LookupNum3(tr, atoi(&word[n_digits]), buf1, 0,0,0); - strcat(ph_out,buf1); - n_digits += decimal_count; + LookupNum3(tr, atoi(&word[n_digits]), buf1, 0,0,0); + strcat(ph_out,buf1); + n_digits += decimal_count; } break; diff --git a/src/phonemelist.cpp b/src/phonemelist.cpp index 8c33fdd5..42a90bfd 100644 --- a/src/phonemelist.cpp +++ b/src/phonemelist.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 to 2011 by Jonathan Duddington * + * Copyright (C) 2005 to 2013 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * * * * This program is free software; you can redistribute it and/or modify * @@ -133,7 +133,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) PHONEME_LIST2 *plist2; WORD_PH_DATA worddata; - memset(&worddata, 0, sizeof(worddata)); + memset(&worddata, 0, sizeof(worddata)); plist2 = ph_list2; phlist = phoneme_list; end_sourceix = plist2[n_ph_list2-1].sourceix; @@ -142,7 +142,7 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) max_stress = 0; for(j = n_ph_list2-3; j>=0; j--) { - // start with the last phoneme (before the terminating pauses) and move forwards + // start with the last phoneme (before the terminating pauses) and move backwards if((plist2[j].stresslevel & 0x7f) > max_stress) max_stress = plist2[j].stresslevel & 0x7f; if(plist2[j].sourceix != 0) @@ -204,21 +204,18 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) { voicing = 1; } - else - if((voicing==2) && (ph->end_type != 0)) // use end_type field for voicing_switch for consonants + else if((voicing==2) && (ph->end_type != 0)) // use end_type field for voicing_switch for consonants { plist2[j].phcode = ph->end_type; // change to voiced equivalent } } - else - if((type==phVSTOP) || type==(phVFRICATIVE)) + else if((type==phVSTOP) || type==(phVFRICATIVE)) { if((voicing==0) && (regression & 0xf)) { voicing = 2; } - else - if((voicing==1) && (ph->end_type != 0)) + else if((voicing==1) && (ph->end_type != 0)) { plist2[j].phcode = ph->end_type; // change to unvoiced equivalent } @@ -331,6 +328,9 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) if(plist3->phcode == phonSWITCH) { + if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH))) + continue; // next phoneme is also a phonSWITCH, so ignore + // change phoneme table SelectPhonemeTable(plist3->tone_ph); switched_language ^= SFLAG_SWITCHED_LANG; @@ -580,18 +580,18 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) phlist[ix].newword = 2; // end of clause phlist[ix].phcode = phonPAUSE; - phlist[ix].type = phPAUSE; // terminate with 2 Pause phonemes + phlist[ix].type = phPAUSE; // terminate with 2 Pause phonemes phlist[ix].length = post_pause; // length of the pause, depends on the punctuation phlist[ix].sourceix = end_sourceix; phlist[ix].synthflags = 0; - phlist[ix++].ph = phoneme_tab[phonPAUSE]; + phlist[ix++].ph = phoneme_tab[phonPAUSE]; phlist[ix].phcode = phonPAUSE; - phlist[ix].type = phPAUSE; + phlist[ix].type = phPAUSE; phlist[ix].length = 0; phlist[ix].sourceix=0; phlist[ix].synthflags = 0; - phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT]; + phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT]; n_phoneme_list = ix; } // end of MakePhonemeList diff --git a/src/readclause.cpp b/src/readclause.cpp index c6bc34e2..785356ed 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -842,14 +842,13 @@ static int LoadSoundFile2(const char *fname) 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 int punct_count; - const char *punctname; - int found = 0; + const char *punctname = NULL; int soundicon; int attributes; int short_pause; @@ -858,6 +857,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output int bufix1; char buf[200]; char buf2[80]; + char ph_buf[30]; c2 = *c2_ptr; buf[0] = 0; @@ -867,12 +867,24 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output // add an embedded command to play the soundicon sprintf(buf,"\001%dI ",soundicon); UngetC(c2); - found = 1; } else - if((punctname = LookupCharName(tr, c1, 0)) != NULL) { - found = 1; + if((c1 == '.') && (end_clause) && (c2 != '.')) + { + if(LookupSpecial(tr, "_.p", ph_buf)) + { + punctname = ph_buf; // use word for 'period' instead of 'dot' + } + } + if(punctname == NULL) + { + punctname = LookupCharName(tr, c1, 0); + } + + if(punctname == NULL) + return(-1); + if((*bufix==0) || (end_clause ==0) || (tr->langopts.param[LOPT_ANNOUNCE_PUNCT] & 2)) { punct_count=1; @@ -932,9 +944,6 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output } } - if(found == 0) - return(-1); - bufix1 = *bufix; len = strlen(buf); strcpy(&output[*bufix],buf); diff --git a/src/synthdata.cpp b/src/synthdata.cpp index d9747299..eccb1e06 100644 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.46.44 08.Mar.13"; +const char *version_string = "1.46.45 10.Mar.13"; const int version_phdata = 0x014640; int option_device_number = -1; diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 2819e5d1..c3bbcada 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -79,7 +79,7 @@ ALPHABET alphabets [] = { {"_dv", OFFSET_THAANA, 0x780, 0x7bf, 0, 0}, {"_hi", OFFSET_DEVANAGARI, 0x900, 0x97f,L('h','i'), AL_WORDS}, {"_bn", OFFSET_BENGALI, 0x0980, 0x9ff, 0, 0}, - {"_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, 0, 0}, + {"_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, L('p','a'), AL_WORDS}, {"_gu", OFFSET_GUJARATI, 0xa80, 0xaff, 0, 0}, {"_or", OFFSET_ORIYA, 0xb00, 0xb7f, 0, 0}, {"_ta", OFFSET_TAMIL, 0xb80, 0xbff, L('t','a'), AL_WORDS}, @@ -94,24 +94,26 @@ ALPHABET alphabets [] = { {"_ka", OFFSET_GEORGIAN, 0x10a0,0x10ff, L('k','a'), AL_WORDS}, {"_ko", OFFSET_KOREAN, 0x1100,0x11ff, 0, 0}, {"_eth", OFFSET_ETHIOPIC, 0x1200,0x139f, 0, 0}, + {"_ja", 0x3040, 0x3040,0x30ff, 0, AL_NOT_CODE}, + {"_zh", 0x3100, 0x3100,0x9fff, 0, AL_NOT_CODE}, {NULL, 0, 0, 0, 0, 0} }; ALPHABET *AlphabetFromChar(int c) {//=============================== - // Find the alphabet from a character. - ALPHABET *alphabet = alphabets; + // Find the alphabet from a character. + ALPHABET *alphabet = alphabets; - while(alphabet->name != NULL) - { - if((c >= alphabet->range_min) && (c <= alphabet->range_max)) - { - return(alphabet); - } - alphabet++; - } - return(NULL); + while(alphabet->name != NULL) + { + if((c >= alphabet->range_min) && (c <= alphabet->range_max)) + { + return(alphabet); + } + alphabet++; + } + return(NULL); } @@ -514,7 +516,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable + tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM; // use 'diminished' for unstressed final syllable tr->letter_bits_offset = OFFSET_BENGALI; SetIndicLetters(tr); // call this after setting OFFSET_BENGALI SetLetterBitsRange(tr,LETTERGP_F,0x3e,0x4c); // vowel signs, but not virama @@ -601,7 +603,7 @@ Translator *SelectTranslator(const char *name) tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->letter_bits_offset = OFFSET_THAANA; tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable + tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM; // use 'diminished' for unstressed final syllable SetLetterBitsRange(tr,LETTERGP_B,0x26,0x30); // vowel signs, and virama tr->langopts.break_numbers = 0x14a8; // 1000, 100,000 10,000,000 tr->langopts.numbers = 1; @@ -705,7 +707,7 @@ Translator *SelectTranslator(const char *name) // stress last syllable if it doesn't end in vowel or "s" or "n" // 'diminished' is an unstressed final syllable - tr->langopts.stress_flags = 0x200 | 0x6 | 0x10; + tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2; tr->langopts.unstressed_wd1 = 0; tr->langopts.unstressed_wd2 = 2; tr->langopts.param[LOPT_SONORANT_MIN] = 120; // limit the shortening of sonorants before short vowels @@ -715,18 +717,20 @@ Translator *SelectTranslator(const char *name) if(name2 == L('c','a')) { + // stress last syllable unless word ends with a vowel tr->punct_within_word = ca_punct_within_word; - tr->langopts.stress_flags = 0x200 | 0x6 | 0x30; // stress last syllable unless word ends with a vowel + tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2; } else if(name2 == L('a','n')) { - tr->langopts.stress_flags = 0x200 | 0x6 | 0x10; + tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2; } else if(name2 == L_pap) { - tr->langopts.stress_flags = 0x100 | 0x6 | 0x30; // stress last syllable unless word ends with a vowel + // stress last syllable unless word ends with a vowel + tr->langopts.stress_flags = S_FINAL_STRESS_C | S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2; } else { @@ -786,7 +790,7 @@ Translator *SelectTranslator(const char *name) SetupTranslator(tr,stress_lengths_fi,stress_amps_fi); tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x56; // move secondary stress from light to a following heavy syllable + tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_2_TO_HEAVY; // move secondary stress from light to a following heavy syllable tr->langopts.param[LOPT_IT_DOUBLING] = 1; tr->langopts.long_stop = 130; @@ -802,7 +806,7 @@ Translator *SelectTranslator(const char *name) { SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable - tr->langopts.stress_flags = 0x0024; // don't use secondary stress + tr->langopts.stress_flags = S_NO_AUTO_2 | S_FINAL_DIM; // don't use secondary stress tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->langopts.accents = 2; // Say "Capital" after the letter. @@ -812,12 +816,12 @@ Translator *SelectTranslator(const char *name) } break; - case L('g','a'): // irish - { - tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.numbers = 1; - } - break; + case L('g','a'): // irish + { + tr->langopts.stress_rule = STRESSPOSN_1L; + tr->langopts.numbers = 1; + } + break; case L('h','i'): // Hindi case L('n','e'): // Nepali @@ -831,7 +835,7 @@ Translator *SelectTranslator(const char *name) 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.stress_flags = S_MID_DIM | S_FINAL_DIM; // use 'diminished' for unstressed final syllable tr->langopts.numbers = NUM_SWAP_TENS; tr->langopts.break_numbers = 0x14aa8; // for languages which have numbers for 100,000 and 100,00,000, eg Hindi tr->letter_bits_offset = OFFSET_DEVANAGARI; @@ -875,7 +879,7 @@ SetupTranslator(tr,stress_lengths_equal,stress_amps_equal); tr->charset_a0 = charsets[2]; // ISO-8859-2 tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x10; + tr->langopts.stress_flags = S_FINAL_NO_2; tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3; tr->langopts.max_initial_consonants = 5; tr->langopts.spelling_stress = 1; @@ -894,7 +898,7 @@ SetupTranslator(tr,stress_lengths_equal,stress_amps_equal); case L('h','t'): // Haitian Creole // memcpy(tr->stress_lengths,stress_lengths_fr,sizeof(tr->stress_lengths)); tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable - tr->langopts.stress_flags = 0x0024; // don't use secondary stress + tr->langopts.stress_flags = S_NO_AUTO_2 | S_FINAL_DIM; // don't use secondary stress tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL | NUM_DFRACTION_4; break; @@ -909,7 +913,7 @@ SetupTranslator(tr,stress_lengths_equal,stress_amps_equal); tr->langopts.vowel_pause = 0x20; tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x8036 | S_HYPEN_UNSTRESS; + tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2 | 0x8000 | S_HYPEN_UNSTRESS; tr->langopts.unstressed_wd1 = 2; tr->langopts.param[LOPT_IT_DOUBLING] = 1; tr->langopts.param[LOPT_ANNOUNCE_PUNCT] = 2; // don't break clause before announcing . ? ! @@ -942,7 +946,7 @@ SetLengthMods(tr,3); // all equal SetLetterBits(tr,LETTERGP_C,hy_consonants); tr->langopts.max_initial_consonants = 6; tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED; -// tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words + // tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words } break; @@ -954,7 +958,7 @@ SetLengthMods(tr,3); // all equal SetupTranslator(tr,stress_lengths_id,stress_amps_id); tr->langopts.stress_rule = STRESSPOSN_2R; tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_ROMAN; - tr->langopts.stress_flags = 0x6 | 0x10; + tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; tr->langopts.accents = 2; // "capital" after letter name } break; @@ -966,7 +970,7 @@ SetLengthMods(tr,3); // all equal SetupTranslator(tr,stress_lengths_is,NULL); tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = 0x10; + tr->langopts.stress_flags = S_FINAL_NO_2; tr->langopts.param[LOPT_IT_LENGTHEN] = 0x11; // remove lengthen indicator from unstressed vowels tr->langopts.param[LOPT_REDUCE] = 2; @@ -989,7 +993,7 @@ SetLengthMods(tr,3); // all equal tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable tr->langopts.stress_rule = STRESSPOSN_2R; - tr->langopts.stress_flags = 0x10 | S_PRIORITY_STRESS; + tr->langopts.stress_flags = S_FINAL_NO_2 | S_PRIORITY_STRESS; tr->langopts.vowel_pause = 1; tr->langopts.unstressed_wd1 = 2; tr->langopts.unstressed_wd2 = 2; @@ -1024,8 +1028,9 @@ SetLengthMods(tr,3); // all equal { // character codes offset by 0x1080 static const char ka_vowels[] = {0x30,0x34,0x38,0x3d,0x43,0x55,0x57,0}; - static const char ka_consonants[] = {0x31,0x32,0x33,0x35,0x36,0x37,0x39,0x3a,0x3b,0x3c,0x3e,0x3f, - 0x40,0x41,0x42,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0}; + static const char ka_consonants[] = + {0x31,0x32,0x33,0x35,0x36,0x37,0x39,0x3a,0x3b,0x3c,0x3e,0x3f,0x40,0x41,0x42,0x44, + 0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0}; SetupTranslator(tr,stress_lengths_ta,stress_amps_ta); memset(tr->letter_bits,0,sizeof(tr->letter_bits)); SetLetterBits(tr,LETTERGP_A,ka_vowels); @@ -1149,7 +1154,7 @@ SetLengthMods(tr,3); // all equal tr->langopts.spelling_stress = 1; tr->charset_a0 = charsets[4]; // ISO-8859-4 tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT; - tr->langopts.stress_flags = 0x16 + 0x40000; + tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_EO_CLAUSE1; } break; @@ -1496,14 +1501,14 @@ SetLengthMods(tr,3); // all equal break; case L('t','t'): // Tatar - { + { SetCyrillicLetters(tr); SetupTranslator(tr,stress_lengths_fr,stress_amps_fr); tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable tr->langopts.stress_flags = S_NO_AUTO_2; //no automatic secondary stress tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_4; - } - break; + } + break; case L('u','k'): // Ukrainian { @@ -1513,10 +1518,12 @@ SetLengthMods(tr,3); // all equal break; case L('u','r'): // Urdu + { tr->letter_bits_offset = OFFSET_ARABIC; tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words tr->langopts.numbers = NUM_SWAP_TENS; tr->langopts.break_numbers = 0x52a8; // for languages which have numbers for 100,000 and 100,00,000, eg Hindi + } break; case L('v','i'): // Vietnamese diff --git a/src/translate.cpp b/src/translate.cpp index 9feb592d..e071efb9 100644 --- a/src/translate.cpp +++ b/src/translate.cpp @@ -91,7 +91,7 @@ PHONEME_LIST2 ph_list2[N_PHONEME_LIST]; // first stage of text->phonemes -wchar_t option_punctlist[N_PUNCTLIST]={0}; +wchar_t option_punctlist[N_PUNCTLIST]= {0}; char ctrl_embedded = '\001'; // to allow an alternative CTRL for embedded commands int option_multibyte=espeakCHARS_AUTO; // 0=auto, 1=utf8, 2=8bit, 3=wchar, 4=16bit @@ -113,11 +113,12 @@ REPLACE_PHONEMES replace_phonemes[N_REPLACE_PHONEMES]; // brackets, also 0x2014 to 0x021f which don't need to be in this list static const unsigned short brackets[] = { -'(',')','[',']','{','}','<','>','"','\'','`', -0xab,0xbb, // double angle brackets -0x300a,0x300b, // double angle brackets (ideograph) -0xe000+'<', // private usage area -0}; + '(',')','[',']','{','}','<','>','"','\'','`', + 0xab,0xbb, // double angle brackets + 0x300a,0x300b, // double angle brackets (ideograph) + 0xe000+'<', // private usage area + 0 +}; // other characters which break a word, but don't produce a pause static const unsigned short breaks[] = {'_', 0}; @@ -129,153 +130,153 @@ static const unsigned short breaks[] = {'_', 0}; // Translate character codes 0xA0 to 0xFF into their unicode values // ISO_8859_1 is set as default static const unsigned short ISO_8859_1[0x60] = { - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, // a0 - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, // a8 - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, // b0 - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, // b8 - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 - 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, // d8 - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 - 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, // f8 + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, // a0 + 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, // a8 + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, // b0 + 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, // b8 + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 + 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, // d8 + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, // f8 }; static const unsigned short ISO_8859_2[0x60] = { - 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, // a0 - 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, // a8 - 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, // b0 - 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, // b8 - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, // c0 - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, // c8 - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, // d0 - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, // d8 - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, // e0 - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, // e8 - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, // f0 - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, // f8 + 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, // a0 + 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, // a8 + 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, // b0 + 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, // b8 + 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, // c0 + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, // c8 + 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, // d0 + 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, // d8 + 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, // e0 + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, // e8 + 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, // f0 + 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, // f8 }; static const unsigned short ISO_8859_3[0x60] = { - 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, // a0 - 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, // a8 - 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, // b0 - 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, // b8 - 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, // c0 - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 - 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, // d0 - 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, // d8 - 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, // e0 - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 - 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, // f0 - 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9, // f8 + 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, // a0 + 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, // a8 + 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, // b0 + 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, // b8 + 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, // c0 + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 + 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, // d0 + 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, // d8 + 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, // e0 + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 + 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, // f0 + 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9, // f8 }; static const unsigned short ISO_8859_4[0x60] = { - 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, // a0 - 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, // a8 - 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, // b0 - 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, // b8 - 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, // c0 - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, // c8 - 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 - 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, // d8 - 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, // e0 - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, // e8 - 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 - 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9, // f8 + 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, // a0 + 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, // a8 + 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, // b0 + 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, // b8 + 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, // c0 + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, // c8 + 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 + 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, // d8 + 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, // e0 + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, // e8 + 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 + 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9, // f8 }; static const unsigned short ISO_8859_5[0x60] = { - 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, // a0 Cyrillic - 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, // a8 - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, // b0 - 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, // b8 - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, // c0 - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, // c8 - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, // d0 - 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, // d8 - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, // e0 - 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, // e8 - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, // f0 - 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f, // f8 + 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, // a0 Cyrillic + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, // a8 + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, // b0 + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, // b8 + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, // c0 + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, // c8 + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, // d0 + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, // d8 + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, // e0 + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, // e8 + 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, // f0 + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f, // f8 }; static const unsigned short ISO_8859_7[0x60] = { - 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, // a0 Greek - 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, // a8 - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, // b0 - 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, // b8 - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, // c0 - 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, // c8 - 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, // d0 - 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, // d8 - 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, // e0 - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, // e8 - 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, // f0 - 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000, // f8 + 0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7, // a0 Greek + 0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, // a8 + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, // b0 + 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, // b8 + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, // c0 + 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, // c8 + 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, // d0 + 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, // d8 + 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, // e0 + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, // e8 + 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, // f0 + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000, // f8 }; static const unsigned short ISO_8859_9[0x60] = { - 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, // a0 - 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, // a8 - 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, // b0 - 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, // b8 - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 - 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, // d8 - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 - 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, // f8 + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, // a0 + 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, // a8 + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, // b0 + 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, // b8 + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 + 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, // d0 + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, // d8 + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 + 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, // f0 + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, // f8 }; static const unsigned short ISO_8859_14[0x60] = { - 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, // a0 Welsh - 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, // a8 - 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, // b0 - 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, // b8 - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 - 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 - 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, // d0 - 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, // d8 - 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 - 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 - 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, // f0 - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, // f8 + 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, // a0 Welsh + 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, // a8 + 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, // b0 + 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, // b8 + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, // c0 + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, // c8 + 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, // d0 + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, // d8 + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, // e0 + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, // e8 + 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, // f0 + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, // f8 }; static const unsigned short KOI8_R[0x60] = { - 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, // a0 Russian - 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, // a8 - 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, // b0 - 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, // b8 - 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, // c0 - 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, // c8 - 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, // d0 - 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, // d8 - 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, // e0 - 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, // e8 - 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, // f0 - 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a, // f8 + 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, // a0 Russian + 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, // a8 + 0x255f, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, // b0 + 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x00a9, // b8 + 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, // c0 + 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, // c8 + 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, // d0 + 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a, // d8 + 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, // e0 + 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, // e8 + 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, // f0 + 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a, // f8 }; static const unsigned short ISCII[0x60] = { - 0x0020, 0x0901, 0x0902, 0x0903, 0x0905, 0x0906, 0x0907, 0x0908, // a0 - 0x0909, 0x090a, 0x090b, 0x090e, 0x090f, 0x0910, 0x090d, 0x0912, // a8 - 0x0913, 0x0914, 0x0911, 0x0915, 0x0916, 0x0917, 0x0918, 0x0919, // b0 - 0x091a, 0x091b, 0x091c, 0x091d, 0x091e, 0x091f, 0x0920, 0x0921, // b8 - 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927, 0x0928, 0x0929, // c0 - 0x092a, 0x092b, 0x092c, 0x092d, 0x092e, 0x092f, 0x095f, 0x0930, // c8 - 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937, 0x0938, // d0 - 0x0939, 0x0020, 0x093e, 0x093f, 0x0940, 0x0941, 0x0942, 0x0943, // d8 - 0x0946, 0x0947, 0x0948, 0x0945, 0x094a, 0x094b, 0x094c, 0x0949, // e0 - 0x094d, 0x093c, 0x0964, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, // e8 - 0x0020, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, // f0 - 0x0037, 0x0038, 0x0039, 0x20, 0x20, 0x20, 0x20, 0x20, // f8 + 0x0020, 0x0901, 0x0902, 0x0903, 0x0905, 0x0906, 0x0907, 0x0908, // a0 + 0x0909, 0x090a, 0x090b, 0x090e, 0x090f, 0x0910, 0x090d, 0x0912, // a8 + 0x0913, 0x0914, 0x0911, 0x0915, 0x0916, 0x0917, 0x0918, 0x0919, // b0 + 0x091a, 0x091b, 0x091c, 0x091d, 0x091e, 0x091f, 0x0920, 0x0921, // b8 + 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927, 0x0928, 0x0929, // c0 + 0x092a, 0x092b, 0x092c, 0x092d, 0x092e, 0x092f, 0x095f, 0x0930, // c8 + 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937, 0x0938, // d0 + 0x0939, 0x0020, 0x093e, 0x093f, 0x0940, 0x0941, 0x0942, 0x0943, // d8 + 0x0946, 0x0947, 0x0948, 0x0945, 0x094a, 0x094b, 0x094c, 0x0949, // e0 + 0x094d, 0x093c, 0x0964, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, // e8 + 0x0020, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, // f0 + 0x0037, 0x0038, 0x0039, 0x20, 0x20, 0x20, 0x20, 0x20, // f8 }; const unsigned short *charsets[N_CHARSETS] = { @@ -298,7 +299,8 @@ const unsigned short *charsets[N_CHARSETS] = { ISO_8859_1, ISO_8859_1, KOI8_R, // 18 - ISCII }; + ISCII +}; // Tables of the relative lengths of vowels, depending on the // type of the two phonemes that follow @@ -306,7 +308,7 @@ const unsigned short *charsets[N_CHARSETS] = { // use this table if vowel is not the last in the word static unsigned char length_mods_en[100] = { -/* a , t s n d z r N <- next */ + /* a , t s n d z r N <- next */ 100,120,100,105,100,110,110,100, 95, 100, /* a <- next2 */ 105,120,105,110,125,130,135,115,125, 100, /* , */ 105,120, 75,100, 75,105,120, 85, 75, 100, /* t */ @@ -316,11 +318,12 @@ static unsigned char length_mods_en[100] = { 105,120,100,105,105,122,125,110,105, 100, /* z */ 105,120,100,105,105,122,125,110,105, 100, /* r */ 105,120, 95,105,100,115,120,110,100, 100, /* N */ - 100,120,100,100,100,100,100,100,100, 100 }; // SPARE + 100,120,100,100,100,100,100,100,100, 100 +}; // SPARE // as above, but for the last syllable in a word static unsigned char length_mods_en0[100] = { -/* a , t s n d z r N <- next */ + /* a , t s n d z r N <- next */ 100,150,100,105,110,115,110,110,110, 100, /* a <- next2 */ 105,150,105,110,125,135,140,115,135, 100, /* , */ 105,150, 90,105, 90,122,135,100, 90, 100, /* t */ @@ -330,11 +333,12 @@ static unsigned char length_mods_en0[100] = { 105,150,100,105,110,122,125,115,110, 100, /* z */ 105,150,100,105,105,122,135,120,105, 100, /* r */ 105,150,100,105,105,115,135,110,105, 100, /* N */ - 100,100,100,100,100,100,100,100,100, 100 }; // SPARE + 100,100,100,100,100,100,100,100,100, 100 +}; // SPARE static unsigned char length_mods_equal[100] = { -/* a , t s n d z r N <- next */ + /* a , t s n d z r N <- next */ 110,120,100,110,110,110,110,110,110, 110, /* a <- next2 */ 110,120,100,110,110,110,110,110,110, 110, /* , */ 110,120,100,110,100,110,110,110,100, 110, /* t */ @@ -344,17 +348,18 @@ static unsigned char length_mods_equal[100] = { 110,120,100,110,110,110,110,110,110, 110, /* z */ 110,120,100,110,110,110,110,110,110, 110, /* r */ 110,120,100,110,110,110,110,110,110, 110, /* N */ - 110,120,100,110,110,110,110,110,110, 110 }; // SPARE + 110,120,100,110,110,110,110,110,110, 110 +}; // SPARE static unsigned char *length_mod_tabs[6] = { - length_mods_en, - length_mods_en, // 1 - length_mods_en0, // 2 - length_mods_equal, // 3 - length_mods_equal, // 4 - length_mods_equal // 5 - }; + length_mods_en, + length_mods_en, // 1 + length_mods_en0, // 2 + length_mods_equal, // 3 + length_mods_equal, // 4 + length_mods_equal // 5 +}; void SetLengthMods(Translator *tr, int value) @@ -374,8 +379,9 @@ int IsAlpha(unsigned int c) // Replacement for iswalph() which also checks for some in-word symbols static const unsigned short extra_indic_alphas[] = { - 0xa70,0xa71, // Gurmukhi: tippi, addak - 0 }; + 0xa70,0xa71, // Gurmukhi: tippi, addak + 0 + }; if(iswalpha(c)) return(1); @@ -393,6 +399,9 @@ int IsAlpha(unsigned int c) return(0); } + if((c >= 0x5b0) && (c <= 0x5c2)) + return(1); // Hebrew vowel marks + if(c == 0x0605) return(1); @@ -516,8 +525,7 @@ int utf8_out(unsigned int c, char *buf) } if(c < 0x0800) n_bytes = 1; - else - if(c < 0x10000) + else if(c < 0x10000) n_bytes = 2; else n_bytes = 3; @@ -573,11 +581,9 @@ int utf8_in2(int *c, const char *buf, int backwards) { if((c1 & 0xe0) == 0xc0) n_bytes = 1; - else - if((c1 & 0xf0) == 0xe0) + else if((c1 & 0xf0) == 0xe0) n_bytes = 2; - else - if((c1 & 0xf8) == 0xf0) + else if((c1 & 0xf8) == 0xf0) n_bytes = 3; c1 &= mask[n_bytes]; @@ -669,19 +675,17 @@ static int CheckDottedAbbrev(char *word1, WORD_TAB *wtab) nbytes = utf8_in(&wc, word); if((word[nbytes] == ' ') && IsAlpha(wc)) { - if(word[nbytes+1] == '.') + if(word[nbytes+1] == '.') { if(word[nbytes+2] == ' ') ok = 1; - else - if(word[nbytes+2] =='\'') + else if(word[nbytes+2] =='\'') { nbytes += 2; // delete the final dot (eg. u.s.a.'s) ok = 2; } } - else - if((count > 0) && (word[nbytes] == ' ')) + else if((count > 0) && (word[nbytes] == ' ')) ok = 2; } @@ -825,7 +829,7 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt int prefix_stress; char *wordx; char phonemes[N_WORD_PHONEMES]; - char phonemes2[N_WORD_PHONEMES]; + char phonemes2[N_WORD_PHONEMES]; char prefix_phonemes[N_WORD_PHONEMES]; char unpron_phonemes[N_WORD_PHONEMES]; char end_phonemes[N_WORD_PHONEMES]; @@ -835,7 +839,7 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt int word_copy_length; char prefix_chars[0x3f + 2]; int found=0; - int end_flags; + int end_flags; char c_temp; // save a character byte while we temporarily replace it with space int first_char; int last_char = 0; @@ -875,7 +879,6 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt unpron_phonemes[0] = 0; prefix_phonemes[0] = 0; end_phonemes[0] = 0; - current_alphabet = NULL; if(tr->data_dictlist == NULL) { @@ -906,8 +909,8 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt if((word_length == 1) && (wflags & FLAG_TRANSLATOR2)) { - // retranslating a 1-character word using a different language, say its name - spell_word = 1; + // retranslating a 1-character word using a different language, say its name + spell_word = 1; } if(option_sayas == SAYAS_KEY) @@ -943,8 +946,8 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt if(dictionary_flags[0] & FLAG_TEXTMODE) { - if(word_out != NULL) - strcpy(word_out, word1); + if(word_out != NULL) + strcpy(word_out, word1); first_char = word1[0]; stress_bits = dictionary_flags[0] & 0x7f; @@ -960,8 +963,7 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt } } } - else - if((found==0) && (dictionary_flags[0] & FLAG_SKIPWORDS)) + else if((found==0) && (dictionary_flags[0] & FLAG_SKIPWORDS)) { // grouped words, but no translation. Join the words with hyphens. wordx = word1; @@ -1000,11 +1002,11 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt return(0); } -if((wmark > 0) && (wmark < 8)) -{ - // the stressed syllable has been specified in the text (TESTING) - dictionary_flags[0] = (dictionary_flags[0] & ~0xf) | wmark; -} + if((wmark > 0) && (wmark < 8)) + { + // the stressed syllable has been specified in the text (TESTING) + dictionary_flags[0] = (dictionary_flags[0] & ~0xf) | wmark; + } if(!found && (dictionary_flags[0] & FLAG_ABBREV)) { @@ -1050,9 +1052,8 @@ if((wmark > 0) && (wmark < 8)) // emphasize words which are in capitals emphasize_allcaps = FLAG_EMPHASIZED; } - else - if(!found && !(dictionary_flags[0] & FLAG_SKIPWORDS) && (word_length<4) && (tr->clause_lower_count > 3) - && (tr->clause_upper_count <= tr->clause_lower_count)) + else if(!found && !(dictionary_flags[0] & FLAG_SKIPWORDS) && (word_length<4) && (tr->clause_lower_count > 3) + && (tr->clause_upper_count <= tr->clause_lower_count)) { // An upper case word in a lower case clause. This could be an abbreviation. spell_word = 1; @@ -1073,10 +1074,9 @@ if((wmark > 0) && (wmark < 8)) return(0); } strcpy(word_phonemes, phonemes); - return(0); // ?? + return(dictionary_flags[0] & FLAG_SKIPWORDS); // ?? } - else - if(found == 0) + else if(found == 0) { int posn; int non_initial; @@ -1111,7 +1111,7 @@ if((wmark > 0) && (wmark < 8)) if(strcmp(&unpron_phonemes[1],"en")==0) return(FLAG_SPELLWORD); // _^_en must have been set in TranslateLetter(), not *_rules return(0); - } + } #ifdef deleted p = &wordx[word_length-3]; // this looks wrong. Doesn't consider multi-byte chars. @@ -1152,10 +1152,10 @@ if((wmark > 0) && (wmark < 8)) // ?? allow $unpr while translating rules, not just on initial FLAG_UNPRON_TEST if(end_type & SUFX_UNPRON) { - phonemes[0] = 0; // discard and retranslate as individual letters - SpeakIndividualLetters(tr, wordx, phonemes, 0); - strcpy(word_phonemes, phonemes); - return(0); + phonemes[0] = 0; // discard and retranslate as individual letters + SpeakIndividualLetters(tr, wordx, phonemes, 0); + strcpy(word_phonemes, phonemes); + return(0); } #endif @@ -1310,110 +1310,110 @@ if(end_type & SUFX_UNPRON) if((end_type != 0) && !(end_type & SUFX_P)) { - end_type1 = end_type; - strcpy(phonemes2,phonemes); + end_type1 = end_type; + strcpy(phonemes2,phonemes); // The word has a standard ending, re-translate without this ending end_flags = RemoveEnding(tr, wordx, end_type, word_copy); - more_suffixes = 1; + more_suffixes = 1; - while(more_suffixes) - { - more_suffixes = 0; - phonemes[0] = 0; + while(more_suffixes) + { + more_suffixes = 0; + phonemes[0] = 0; - if(prefix_phonemes[0] != 0) - { - // lookup the stem without the prefix removed - wordx[-1] = c_temp; - found = LookupDictList(tr, &word1, phonemes, dictionary_flags2, end_flags, wtab); // include prefix, but not suffix - wordx[-1] = ' '; - if(phonemes[0] == phonSWITCH) - { - // change to another language in order to translate this word - memcpy(wordx,word_copy,strlen(word_copy)); - strcpy(word_phonemes,phonemes); - return(0); - } - if(dictionary_flags[0]==0) - { - dictionary_flags[0] = dictionary_flags2[0]; - dictionary_flags[1] = dictionary_flags2[1]; - } - if(found) - prefix_phonemes[0] = 0; // matched whole word, don't need prefix now + if(prefix_phonemes[0] != 0) + { + // lookup the stem without the prefix removed + wordx[-1] = c_temp; + found = LookupDictList(tr, &word1, phonemes, dictionary_flags2, end_flags, wtab); // include prefix, but not suffix + wordx[-1] = ' '; + if(phonemes[0] == phonSWITCH) + { + // change to another language in order to translate this word + memcpy(wordx,word_copy,strlen(word_copy)); + strcpy(word_phonemes,phonemes); + return(0); + } + if(dictionary_flags[0]==0) + { + dictionary_flags[0] = dictionary_flags2[0]; + dictionary_flags[1] = dictionary_flags2[1]; + } + if(found) + prefix_phonemes[0] = 0; // matched whole word, don't need prefix now - if((found==0) && (dictionary_flags2[0] != 0)) - prefix_flags = 1; - } - if(found == 0) - { - found = LookupDictList(tr, &wordx, phonemes, dictionary_flags2, end_flags, wtab); // without prefix and suffix - if(phonemes[0] == phonSWITCH) - { - // change to another language in order to translate this word - memcpy(wordx,word_copy,strlen(word_copy)); - strcpy(word_phonemes,phonemes); - return(0); - } + if((found==0) && (dictionary_flags2[0] != 0)) + prefix_flags = 1; + } + if(found == 0) + { + found = LookupDictList(tr, &wordx, phonemes, dictionary_flags2, end_flags, wtab); // without prefix and suffix + if(phonemes[0] == phonSWITCH) + { + // change to another language in order to translate this word + memcpy(wordx,word_copy,strlen(word_copy)); + strcpy(word_phonemes,phonemes); + return(0); + } - if(dictionary_flags2[0] & FLAG_ABBREV) - { - // Removing the suffix leaves a word which should be spoken as individual letters - // Not yet implemented - } - if(dictionary_flags[0]==0) - { - dictionary_flags[0] = dictionary_flags2[0]; - dictionary_flags[1] = dictionary_flags2[1]; - } - } - if(found == 0) - { - if(end_type & SUFX_Q) - { - // don't retranslate, use the original lookup result - strcpy(phonemes,phonemes2); - } - else - { - if(end_flags & FLAG_SUFX) - wflags |= FLAG_SUFFIX_REMOVED; - if(end_type & SUFX_A) - wflags |= FLAG_SUFFIX_VOWEL; + if(dictionary_flags2[0] & FLAG_ABBREV) + { + // Removing the suffix leaves a word which should be spoken as individual letters + // Not yet implemented + } + if(dictionary_flags[0]==0) + { + dictionary_flags[0] = dictionary_flags2[0]; + dictionary_flags[1] = dictionary_flags2[1]; + } + } + if(found == 0) + { + if(end_type & SUFX_Q) + { + // don't retranslate, use the original lookup result + strcpy(phonemes,phonemes2); + } + else + { + if(end_flags & FLAG_SUFX) + wflags |= FLAG_SUFFIX_REMOVED; + if(end_type & SUFX_A) + wflags |= FLAG_SUFFIX_VOWEL; - if(end_type & SUFX_M) - { - // allow more suffixes before this suffix - strcpy(end_phonemes2, end_phonemes); - end_type = TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, end_phonemes, wflags, dictionary_flags); - strcat(end_phonemes, end_phonemes2); // add the phonemes for the previous suffixes after this one + if(end_type & SUFX_M) + { + // allow more suffixes before this suffix + strcpy(end_phonemes2, end_phonemes); + end_type = TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, end_phonemes, wflags, dictionary_flags); + strcat(end_phonemes, end_phonemes2); // add the phonemes for the previous suffixes after this one - if((end_type != 0) && !(end_type & SUFX_P)) - { - // there is another suffix - end_flags = RemoveEnding(tr, wordx, end_type, NULL); - more_suffixes = 1; - } - } - else - { - // don't remove any previous suffix - TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, NULL, wflags, dictionary_flags); - end_type = 0; - } + if((end_type != 0) && !(end_type & SUFX_P)) + { + // there is another suffix + end_flags = RemoveEnding(tr, wordx, end_type, NULL); + more_suffixes = 1; + } + } + else + { + // don't remove any previous suffix + TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, NULL, wflags, dictionary_flags); + end_type = 0; + } - if(phonemes[0] == phonSWITCH) - { - // change to another language in order to translate this word - strcpy(word_phonemes,phonemes); - memcpy(wordx,word_copy,strlen(word_copy)); - wordx[-1] = c_temp; - return(0); - } - } - } - } + if(phonemes[0] == phonSWITCH) + { + // change to another language in order to translate this word + strcpy(word_phonemes,phonemes); + memcpy(wordx,word_copy,strlen(word_copy)); + wordx[-1] = c_temp; + return(0); + } + } + } + } if((end_type1 & SUFX_T) == 0) @@ -1437,8 +1437,7 @@ if(end_type & SUFX_UNPRON) // s or 's suffix, append [s], [z] or [Iz] depending on previous letter if(last_char == 'f') TranslateRules(tr, &word_ss[1], phonemes, N_WORD_PHONEMES, NULL, 0, NULL); - else - if((last_char==0) || (strchr_w("hsx",last_char)==NULL)) + else if((last_char==0) || (strchr_w("hsx",last_char)==NULL)) TranslateRules(tr, &word_zz[1], phonemes, N_WORD_PHONEMES, NULL, 0, NULL); else TranslateRules(tr, &word_iz[1], phonemes, N_WORD_PHONEMES, NULL, 0, NULL); @@ -1545,8 +1544,7 @@ if(end_type & SUFX_UNPRON) { ChangeWordStress(tr,word_phonemes,3); } - else - if(wflags & FLAG_EMPHASIZED2) + else if(wflags & FLAG_EMPHASIZED2) { // A word is indicated in the source text as stressed // Give it stress level 6 (for the intonation module) @@ -1555,14 +1553,12 @@ if(end_type & SUFX_UNPRON) if(wflags & FLAG_EMPHASIZED) dictionary_flags[0] |= FLAG_PAUSE1; // precede by short pause } - else - if(wtab[dictionary_skipwords].flags & FLAG_LAST_WORD) + else if(wtab[dictionary_skipwords].flags & FLAG_LAST_WORD) { // the word has attribute to stress or unstress when at end of clause if(dictionary_flags[0] & (FLAG_STRESS_END | FLAG_STRESS_END2)) ChangeWordStress(tr,word_phonemes,4); - else - if((dictionary_flags[0] & FLAG_UNSTRESS_END) && (any_stressed_words)) + else if((dictionary_flags[0] & FLAG_UNSTRESS_END) && (any_stressed_words)) ChangeWordStress(tr,word_phonemes,3); } @@ -1583,16 +1579,14 @@ if(end_type & SUFX_UNPRON) tr->expect_verb = 0; tr->expect_noun = 0; } - else - if(dictionary_flags[1] & FLAG_VERBF) + else if(dictionary_flags[1] & FLAG_VERBF) { /* expect a verb in the next word */ tr->expect_verb = 2; tr->expect_verb_s = 0; /* verb won't have -s suffix */ tr->expect_noun = 0; } - else - if(dictionary_flags[1] & FLAG_VERBSF) + else if(dictionary_flags[1] & FLAG_VERBSF) { // expect a verb, must have a -s suffix tr->expect_verb = 0; @@ -1600,8 +1594,7 @@ if(end_type & SUFX_UNPRON) tr->expect_past = 0; tr->expect_noun = 0; } - else - if(dictionary_flags[1] & FLAG_NOUNF) + else if(dictionary_flags[1] & FLAG_NOUNF) { /* not expecting a verb next */ tr->expect_noun = 2; @@ -1872,7 +1865,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa while(((c2 = word_copy[ix] = word[ix]) != ' ') && (c2 != 0) && (ix < N_WORD_BYTES)) ix++; word_copy_len = ix; - word_replaced[2] = 0; + word_replaced[2] = 0; flags = TranslateWord(translator, word, next_pause, wtab, &word_replaced[2]); if(flags & FLAG_SPELLWORD) @@ -1953,38 +1946,44 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa } } - if(p[0] == phonSWITCH) + if(p[0]==phonSWITCH) { - // this word uses a different language - memcpy(word, word_copy, word_copy_len); - - new_language = (char *)(&p[1]); - if(new_language[0]==0) - new_language = "en"; - + int switch_attempt; strcpy(old_dictionary_name, dictionary_name); - switch_phonemes = SetTranslator2(new_language); - - if(switch_phonemes >= 0) + for(switch_attempt=0; switch_attempt < 2; switch_attempt++) { - // re-translate the word using the new translator - wtab[0].flags |= FLAG_TRANSLATOR2; - if(word_replaced[2] != 0) + // this word uses a different language + memcpy(word, word_copy, word_copy_len); + + new_language = (char *)(&p[1]); + if(new_language[0]==0) + new_language = "en"; + + switch_phonemes = SetTranslator2(new_language); + + if(switch_phonemes >= 0) { - word_replaced[0] = 0; // byte before the start of the word - word_replaced[1] = ' '; - flags = TranslateWord(translator2, &word_replaced[1], next_pause, wtab, NULL); - } - else - flags = TranslateWord(translator2, word, next_pause, wtab, NULL); -// strcpy((char *)p,translator2->word_phonemes); - if(p[0] == phonSWITCH) - { - // the second translator doesn't want to process this word -// switch_phonemes = -1; -return(FLAG_SPELLWORD); + // re-translate the word using the new translator + wtab[0].flags |= FLAG_TRANSLATOR2; + if(word_replaced[2] != 0) + { + word_replaced[0] = 0; // byte before the start of the word + word_replaced[1] = ' '; + flags = TranslateWord(translator2, &word_replaced[1], next_pause, wtab, NULL); + } + else + flags = TranslateWord(translator2, word, next_pause, wtab, &word_replaced[2]); } + + if(p[0] != phonSWITCH) + break; } + + // strcpy((char *)p,translator2->word_phonemes); + + if(p[0] == phonSWITCH) + return(FLAG_SPELLWORD); + if(switch_phonemes < 0) { // language code is not recognised or 2nd translator won't translate it @@ -2074,29 +2073,29 @@ return(FLAG_SPELLWORD); if(switch_phonemes >= 0) { - if((p[0] == phonPAUSE) && (p[1] == phonSWITCH)) - { - // the new word starts with a phoneme table switch, so there's no need to switch before it. - if(ph_list2[n_ph_list2-1].phcode == phonSWITCH) - { - //previous phoneme is also a phonSWITCH, delete it - n_ph_list2--; - } - } - else - { - // this word uses a different phoneme table - if(ph_list2[n_ph_list2-1].phcode == phonSWITCH) - { - //previous phoneme is also a phonSWITCH, just change its phoneme table number - n_ph_list2--; - } - else - { - SetPlist2(&ph_list2[n_ph_list2],phonSWITCH); - } - ph_list2[n_ph_list2++].tone_ph = switch_phonemes; // temporary phoneme table number - } + if((p[0] == phonPAUSE) && (p[1] == phonSWITCH)) + { + // the new word starts with a phoneme table switch, so there's no need to switch before it. + if(ph_list2[n_ph_list2-1].phcode == phonSWITCH) + { + //previous phoneme is also a phonSWITCH, delete it + n_ph_list2--; + } + } + else + { + // this word uses a different phoneme table + if(ph_list2[n_ph_list2-1].phcode == phonSWITCH) + { + //previous phoneme is also a phonSWITCH, just change its phoneme table number + n_ph_list2--; + } + else + { + SetPlist2(&ph_list2[n_ph_list2],phonSWITCH); + } + ph_list2[n_ph_list2++].tone_ph = switch_phonemes; // temporary phoneme table number + } } // remove initial pause from a word if it follows a hyphen @@ -2124,11 +2123,10 @@ return(FLAG_SPELLWORD); ph_list2[n_ph_list2].sourceix = 0; ph_list2[n_ph_list2].synthflags = embedded_flag; ph_list2[n_ph_list2++].tone_ph = *p; - SelectPhonemeTable(*p); - p++; + SelectPhonemeTable(*p); + p++; } - else - if(ph->type == phSTRESS) + else if(ph->type == phSTRESS) { // don't add stress phonemes codes to the list, but give their stress // value to the next vowel phoneme @@ -2148,29 +2146,25 @@ return(FLAG_SPELLWORD); } } } - else - if(ph_code == phonSYLLABIC) + else if(ph_code == phonSYLLABIC) { // mark the previous phoneme as a syllabic consonant prev_vowel = n_ph_list2-1; ph_list2[prev_vowel].synthflags |= SFLAG_SYLLABLE; ph_list2[prev_vowel].stresslevel = next_stress; } - else - if(ph_code == phonLENGTHEN) + else if(ph_code == phonLENGTHEN) { ph_list2[n_ph_list2-1].synthflags |= SFLAG_LENGTHEN; } - else - if(ph_code == phonEND_WORD) + else if(ph_code == phonEND_WORD) { // a || symbol in a phoneme string was used to indicate a word boundary // Don't add this phoneme to the list, but make sure the next phoneme has // a newword indication srcix = source_ix+1; } - else - if(ph_code == phonX1) + else if(ph_code == phonX1) { // a language specific action if(tr->langopts.param[LOPT_IT_DOUBLING]) @@ -2219,7 +2213,7 @@ return(FLAG_SPELLWORD); if(first_phoneme && tr->langopts.param[LOPT_IT_DOUBLING]) { if(((tr->prev_dict_flags[0] & FLAG_DOUBLING) && (tr->langopts.param[LOPT_IT_DOUBLING] & 1)) || - (tr->end_stressed_vowel && (tr->langopts.param[LOPT_IT_DOUBLING] & 2))) + (tr->end_stressed_vowel && (tr->langopts.param[LOPT_IT_DOUBLING] & 2))) { // italian, double the initial consonant if the previous word ends with a // stressed vowel, or is marked with a flag @@ -2299,8 +2293,7 @@ static int EmbeddedCommand(unsigned int &source_index) sign = 0x40; source_index++; } - else - if(c == '-') + else if(c == '-') { sign = 0x60; source_index++; @@ -2425,19 +2418,20 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c, int next2; static const unsigned char hangul_compatibility[0x34] = { - 0, 0x00,0x01,0xaa,0x02,0xac,0xad,0x03, - 0x04,0x05,0xb0,0xb1,0xb2,0xb3,0xb4,0xb4, - 0xb6,0x06,0x07,0x08,0xb9,0x09,0x0a,0xbc, - 0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x61, - 0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69, - 0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71, - 0x72,0x73,0x74,0x75 }; + 0, 0x00,0x01,0xaa,0x02,0xac,0xad,0x03, + 0x04,0x05,0xb0,0xb1,0xb2,0xb3,0xb4,0xb4, + 0xb6,0x06,0x07,0x08,0xb9,0x09,0x0a,0xbc, + 0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x61, + 0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69, + 0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71, + 0x72,0x73,0x74,0x75 + }; switch(tr->translator_name) { case L('a','f'): case L('n','l'): - // look for 'n and replace by a special character (unicode: schwa) + // look for 'n and replace by a special character (unicode: schwa) if(!iswalpha(prev_in)) @@ -2484,8 +2478,7 @@ static int TranslateChar(Translator *tr, char *ptr, int prev_in, unsigned int c, } return(c); } - else - if(((code = c - 0x3130) >= 0) && (code < 0x34)) + else if(((code = c - 0x3130) >= 0) && (code < 0x34)) { // Hangul compatibility jamo return(hangul_compatibility[code] + 0x1100); @@ -2500,27 +2493,27 @@ static const char *UCase_ga[] = {"bp","bhf","dt","gc","hA","mb","ng","ts","tA"," int UpperCaseInWord(Translator *tr, char *word, int c) {//===================================================== - int ix; - int len; - const char *p; + int ix; + int len; + const char *p; - if(tr->translator_name == L('g','a')) - { - // Irish - for(ix=0; ; ix++) - { - if((p = UCase_ga[ix]) == NULL) - break; + if(tr->translator_name == L('g','a')) + { + // Irish + for(ix=0; ; ix++) + { + if((p = UCase_ga[ix]) == NULL) + break; - len = strlen(p); - if((word[-len]==' ') && (memcmp(&word[-len+1], p, len-1) == 0)) - { - if((c == p[len-1]) || ((p[len-1]=='A') && IsVowel(tr, c))) - return(1); - } - } - } - return(0); + len = strlen(p); + if((word[-len]==' ') && (memcmp(&word[-len+1], p, len-1) == 0)) + { + if((c == p[len-1]) || ((p[len-1]=='A') && IsVowel(tr, c))) + return(1); + } + } + } + return(0); } @@ -2600,7 +2593,7 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t fprintf(f_logespeak,"ENDCLAUSE\n"); fflush(f_logespeak); } -p = source; + p = source; charix[charix_top+1] = 0; charix[charix_top+2] = 0x7fff; @@ -2706,8 +2699,7 @@ p = source; prev_in = prev_in_save; prev_in_save = 0; } - else - if(source_index > 0) + else if(source_index > 0) { utf8_in2(&prev_in,&source[source_index-1],1); // prev_in = source[source_index-1]; } @@ -2773,8 +2765,7 @@ p = source; c = ' '; } } - else - if((option_sayas2 & 0xf0) == SAYAS_DIGITS) + else if((option_sayas2 & 0xf0) == SAYAS_DIGITS) { if(iswdigit(c)) { @@ -2797,8 +2788,7 @@ p = source; } } } - else - if((option_sayas2 & 0x10) == 0) + else if((option_sayas2 & 0x10) == 0) { // speak as words @@ -2922,7 +2912,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre if(tr->letter_bits_offset > 0) { if(((c < 0x250) && (prev_out >= tr->letter_bits_offset)) || - ((c >= tr->letter_bits_offset) && (letter_count > 1) && (prev_out < 0x250))) + ((c >= tr->letter_bits_offset) && (letter_count > 1) && (prev_out < 0x250))) { // Don't mix native and Latin characters in the same word // Break into separate words @@ -2950,22 +2940,21 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre { if(iswlower(prev_in)) { - // lower case followed by upper case in a word - if(UpperCaseInWord(tr, &sbuf[ix], c) == 1) - { - // convert to lower case and continue - c = towlower(c); - } - else - { - c = ' '; // lower case followed by upper case, treat as new word - space_inserted = 1; - prev_in_save = c; - // next_word_flags |= FLAG_NOSPACE; // problem: prevents FLAG_HAS_DOT being set - } + // lower case followed by upper case in a word + if(UpperCaseInWord(tr, &sbuf[ix], c) == 1) + { + // convert to lower case and continue + c = towlower(c); + } + else + { + c = ' '; // lower case followed by upper case, treat as new word + space_inserted = 1; + prev_in_save = c; + // next_word_flags |= FLAG_NOSPACE; // problem: prevents FLAG_HAS_DOT being set + } } - else - if((c != ' ') && iswupper(prev_in) && iswlower(next_in)) + else if((c != ' ') && iswupper(prev_in) && iswlower(next_in)) { int next2_in; utf8_in(&next2_in,&source[source_index + next_in_nbytes]); @@ -2999,8 +2988,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre all_upper_case = 0; } } - else - if(c=='-') + else if(c=='-') { if(!IsSpace(prev_in) && IsAlpha(next_in)) { @@ -3019,31 +3007,27 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre c = ' '; } } - else - if((prev_in==' ') && (next_in==' ')) + else if((prev_in==' ') && (next_in==' ')) { // ' - ' dash between two spaces, treat as pause c = ' '; pre_pause_add = 4; } - else - if(next_in=='-') + else if(next_in=='-') { // double hyphen, treat as pause source_index++; c = ' '; pre_pause_add = 4; } - else - if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) + else if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) { // insert extra space between a word + space + hyphen, to distinguish 'a -2' from 'a-2' sbuf[ix++] = ' '; words[word_count].start++; } } - else - if(c == '.') + else if(c == '.') { if(prev_out == '.') { @@ -3051,8 +3035,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre c = ' '; space_inserted = 1; } - else - if((word_count > 0) && !(words[word_count-1].flags & FLAG_NOSPACE) && IsAlpha(prev_in)) + else if((word_count > 0) && !(words[word_count-1].flags & FLAG_NOSPACE) && IsAlpha(prev_in)) { // dot after a word, with space following, probably an abbreviation words[word_count-1].flags |= FLAG_HAS_DOT; @@ -3061,26 +3044,22 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre c = ' '; // remove the dot if it's followed by a space or hyphen, so that it's not pronounced } } - else - if(c == '\'') + else if(c == '\'') { if(((prev_in == '.') || iswalnum(prev_in)) && IsAlpha(next_in)) { // between two letters, or in an abbreviation (eg. u.s.a.'s). Consider the apostrophe as part of the word single_quoted = 0; } - else - if((tr->langopts.param[LOPT_APOSTROPHE] & 1) && IsAlpha(next_in)) + else if((tr->langopts.param[LOPT_APOSTROPHE] & 1) && IsAlpha(next_in)) { single_quoted = 0; // apostrophe at start of word is part of the word } - else - if((tr->langopts.param[LOPT_APOSTROPHE] & 2) && IsAlpha(prev_in)) + else if((tr->langopts.param[LOPT_APOSTROPHE] & 2) && IsAlpha(prev_in)) { single_quoted = 0; // apostrophe at end of word is part of the word } - else - if((wcschr(tr->char_plus_apostrophe,prev_in) != 0) && (prev_out2 == ' ')) + else if((wcschr(tr->char_plus_apostrophe,prev_in) != 0) && (prev_out2 == ' ')) { // consider single character plus apostrophe as a word single_quoted = 0; @@ -3111,44 +3090,41 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre else #ifdef deleted // Brackets are now recognised in TranslateRules() - if(IsBracket(c)) - { - pre_pause_add = 4; - c = ' '; - } - else + if(IsBracket(c)) + { + pre_pause_add = 4; + c = ' '; + } + else #endif - if(lookupwchar(breaks,c) != 0) - { - c = ' '; // various characters to treat as space - } - else - if(iswdigit(c)) - { - if(tr->langopts.tone_numbers && IsAlpha(prev_out) && !IsDigit(next_in)) - { - } - else - if((prev_out != ' ') && !iswdigit(prev_out)) - { - if((prev_out != tr->langopts.decimal_sep) || ((decimal_sep_count > 0) && (tr->langopts.decimal_sep == ','))) + if(lookupwchar(breaks,c) != 0) { - c = ' '; - space_inserted = 1; + c = ' '; // various characters to treat as space } - else + else if(iswdigit(c)) { - decimal_sep_count = 1; + if(tr->langopts.tone_numbers && IsAlpha(prev_out) && !IsDigit(next_in)) + { + } + else if((prev_out != ' ') && !iswdigit(prev_out)) + { + if((prev_out != tr->langopts.decimal_sep) || ((decimal_sep_count > 0) && (tr->langopts.decimal_sep == ','))) + { + c = ' '; + space_inserted = 1; + } + else + { + decimal_sep_count = 1; + } + } + else if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) + { + // insert extra space between a word and a number, to distinguish 'a 2' from 'a2' + sbuf[ix++] = ' '; + words[word_count].start++; + } } - } - else - if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in)) - { - // insert extra space between a word and a number, to distinguish 'a 2' from 'a2' - sbuf[ix++] = ' '; - words[word_count].start++; - } - } } if(IsSpace(c)) @@ -3295,6 +3271,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre if(skipping_text) continue; + current_alphabet = NULL; // digits should have been converted to Latin alphabet ('0' to '9') word = pw = &sbuf[words[ix].start]; @@ -3309,9 +3286,8 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre { *pn++ = *pw++; } - else - if((*pw == tr->langopts.thousands_sep) && (pw[1] == ' ') - && iswdigit(pw[2]) && (pw[3] != ' ') && (pw[4] != ' ')) // don't allow only 1 or 2 digits in the final part + else if((*pw == tr->langopts.thousands_sep) && (pw[1] == ' ') + && iswdigit(pw[2]) && (pw[3] != ' ') && (pw[4] != ' ')) // don't allow only 1 or 2 digits in the final part { pw += 2; ix++; // skip "word" @@ -3358,20 +3334,20 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre } *pn++ = ' '; - if((words[ix].flags & FLAG_INDIVIDUAL_DIGITS) == 0) - { - if(tr->langopts.break_numbers & (1 << (nx-1))) - { - // the next group only has 1 digits, make it three - *pn++ = '0'; - *pn++ = '0'; - } - if(tr->langopts.break_numbers & (1 << (nx-2))) - { - // the next group only has 2 digits (eg. Indian languages), make it three - *pn++ = '0'; - } - } + if((words[ix].flags & FLAG_INDIVIDUAL_DIGITS) == 0) + { + if(tr->langopts.break_numbers & (1 << (nx-1))) + { + // the next group only has 1 digits, make it three + *pn++ = '0'; + *pn++ = '0'; + } + if(tr->langopts.break_numbers & (1 << (nx-2))) + { + // the next group only has 2 digits (eg. Indian languages), make it three + *pn++ = '0'; + } + } } } pw--; @@ -3379,7 +3355,7 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre for(j=1; j<=nw; j++) { - num_wtab[j].flags &= ~(FLAG_MULTIPLE_SPACES | FLAG_EMBEDDED); // don't use these flags for subsequent parts when splitting a number + num_wtab[j].flags &= ~(FLAG_MULTIPLE_SPACES | FLAG_EMBEDDED); // don't use these flags for subsequent parts when splitting a number } // include the next few characters, in case there are an ordinal indicator or other suffix diff --git a/src/translate.h b/src/translate.h index 89c9e58e..a34667e3 100644 --- a/src/translate.h +++ b/src/translate.h @@ -275,7 +275,8 @@ extern ALPHABET *current_alphabet; // alphabet flags #define AL_DONT_NAME 0x01 // don't speak the alphabet name #define AL_NOT_LETTERS 0x02 // don't use the language for speaking letters -#define AL_WORDS 0x04 // use the language to speak words +#define AL_WORDS 0x04 // use the language to speak words +#define AL_NOT_CODE 0x08 // don't speak the character code #define N_LOPTS 21 @@ -402,12 +403,18 @@ typedef struct { #define S_INITIAL_2 0x2000 // bit13= If there is only one syllable before the primary stress, give it a secondary stress +#define S_MID_DIM 0x10000 +// bit 16= Set (not first or last) syllables to diminished stress + #define S_PRIORITY_STRESS 0x20000 // bit17= "priority" stress reduces other primary stress to "unstressed" not "secondary" #define S_EO_CLAUSE1 0x40000 // bit18= don't lengthen short vowels more than long vowels at end-of-clause +#define S_FINAL_LONG 0x80000 +// bit19=stress on final syllable if it has a long vowel, but previous syllable has a short vowel + #define S_HYPEN_UNSTRESS 0x100000 // bit20= hyphenated words, 2nd part is unstressed @@ -416,7 +423,6 @@ typedef struct { // bit21= don't lengthen vowels at end-of-clause // bit15= Give stress to the first unstressed syllable -// bit19=stress on final syllable if it has a long vowel, but previous syllable has a short vowel int stress_flags; @@ -566,7 +572,7 @@ typedef struct const char *transpose_map; char dictionary_name[40]; - char phon_out[400]; + char phon_out[500]; char phonemes_repeat[20]; int phonemes_repeat_count; int phoneme_tab_ix; diff --git a/src/voices.cpp b/src/voices.cpp index 5c5ad948..606dc6a0 100644 --- a/src/voices.cpp +++ b/src/voices.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 to 2010 by Jonathan Duddington * + * Copyright (C) 2005 to 2013 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * * * * This program is free software; you can redistribute it and/or modify * @@ -47,7 +47,8 @@ MNEM_TAB genders [] = { {"unknown", 0}, {"male", 1}, {"female", 2}, - {NULL, 0 }}; + {NULL, 0 } +}; int tone_points[12] = {600,170, 1200,135, 2000,110, 3000,110, -1,0}; //int tone_points[12] = {250,200, 400,170, 600,170, 1200,135, 2000,110, -1,0}; @@ -98,6 +99,7 @@ enum { V_STRESSADD, V_DICTRULES, V_STRESSRULE, + V_STRESSOPT, V_CHARSET, V_NUMBERS, V_OPTION, @@ -118,7 +120,8 @@ enum { static MNEM_TAB options_tab[] = { {"reduce_t", LOPT_REDUCE_T}, {"bracket", LOPT_BRACKET_PAUSE}, - {NULL, -1} }; + {NULL, -1} +}; static MNEM_TAB keyword_tab[] = { {"name", V_NAME}, @@ -128,7 +131,7 @@ static MNEM_TAB keyword_tab[] = { {"formant", V_FORMANT}, {"pitch", V_PITCH}, {"phonemes", V_PHONEMES}, - {"translator", V_TRANSLATOR}, + {"translator", V_TRANSLATOR}, {"dictionary", V_DICTIONARY}, {"stressLength", V_STRESSLENGTH}, {"stressAmp", V_STRESSAMP}, @@ -137,6 +140,7 @@ static MNEM_TAB keyword_tab[] = { {"tunes", V_TUNES}, {"dictrules", V_DICTRULES}, {"stressrule", V_STRESSRULE}, + {"stressopt", V_STRESSOPT}, {"charset", V_CHARSET}, {"replace", V_REPLACE}, {"words", V_WORDGAP}, @@ -166,7 +170,8 @@ static MNEM_TAB keyword_tab[] = { {"l_sonorant_min", 0x100+LOPT_SONORANT_MIN}, {"l_length_mods", 0x100+LOPT_LENGTH_MODS}, {"apostrophe", 0x100+LOPT_APOSTROPHE}, - {NULL, 0} }; + {NULL, 0} +}; #define N_VOICE_VARIANTS 12 const char variants_either[N_VOICE_VARIANTS] = {1,2,12,3,13,4,14,5,11,0}; @@ -260,9 +265,9 @@ void ReadTonePoints(char *string, int *tone_pts) tone_pts[ix] = -1; sscanf(string,"%d %d %d %d %d %d %d %d %d %d", - &tone_pts[0],&tone_pts[1],&tone_pts[2],&tone_pts[3], - &tone_pts[4],&tone_pts[5],&tone_pts[6],&tone_pts[7], - &tone_pts[8],&tone_pts[9]); + &tone_pts[0],&tone_pts[1],&tone_pts[2],&tone_pts[3], + &tone_pts[4],&tone_pts[5],&tone_pts[6],&tone_pts[7], + &tone_pts[8],&tone_pts[9]); } @@ -316,8 +321,7 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char*lea while(isspace(*p)) p++; strncpy0(vname,p,sizeof(vname)); } - else - if(memcmp(linebuf,"language",8)==0) + else if(memcmp(linebuf,"language",8)==0) { priority = DEFAULT_LANGUAGE_PRIORITY; vlanguage[0] = 0; @@ -334,13 +338,11 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, const char*lea n_languages++; } } - else - if(memcmp(linebuf,"gender",6)==0) + else if(memcmp(linebuf,"gender",6)==0) { sscanf(&linebuf[6],"%s %d",vgender,&age); } - else - if(memcmp(linebuf,"variants",8)==0) + else if(memcmp(linebuf,"variants",8)==0) { sscanf(&linebuf[8],"%d",&n_variants); } @@ -443,7 +445,7 @@ void VoiceReset(int tone_only) // Adjustment of harmonic amplitudes, steps of 8Hz // value of 128 means no change // memset(voice->tone_adjust,128,sizeof(voice->tone_adjust)); -SetToneAdjust(voice,tone_points); + SetToneAdjust(voice,tone_points); // default values of speed factors voice->speedf1 = 256; @@ -517,7 +519,7 @@ static int Read8Numbers(char *data_in,int *data) // Read 8 integer numbers memset(data, 0, 8+sizeof(int)); return(sscanf(data_in,"%d %d %d %d %d %d %d %d", - &data[0],&data[1],&data[2],&data[3],&data[4],&data[5],&data[6],&data[7])); + &data[0],&data[1],&data[2],&data[3],&data[4],&data[5],&data[6],&data[7])); } @@ -557,7 +559,7 @@ voice_t *LoadVoice(const char *vname, int control) char buf[sizeof(path_home)+30]; char path_voices[sizeof(path_home)+12]; - int dict_min = 0; + int dict_min = 0; int stress_amps[8]; int stress_lengths[8]; int stress_add[8]; @@ -572,11 +574,11 @@ voice_t *LoadVoice(const char *vname, int control) static char voice_name[40]; // voice name for current_voice_selected static char voice_languages[100]; // list of languages and priorities for current_voice_selected - // which directory to look for a named voice - static const char *voices_asia = - "fa fa-pin hi hy hy-west id ka kn ku ml ne pa ta tr vi vi-hue zh zh-yue "; - static const char *voices_europe = - "bg bs ca cs cy da el es et fi fr-be hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv "; + // which directory to look for a named voice + static const char *voices_asia = + "fa fa-pin hi hy hy-west id ka kn ku ml ne pa ta tr vi vi-hue zh zh-yue "; + static const char *voices_europe = + "bg bs ca cs cy da el es et fi fr-be hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv "; strncpy0(voicename, vname, sizeof(voicename)); @@ -588,38 +590,37 @@ voice_t *LoadVoice(const char *vname, int control) } else { - if(voicename[0]==0) - strcpy(voicename,"default"); + if(voicename[0]==0) + strcpy(voicename,"default"); sprintf(path_voices,"%s%cvoices%c",path_home,PATHSEP,PATHSEP); sprintf(buf,"%s%s",path_voices,voicename); // first, look in the main voices directory if(GetFileLength(buf) <= 0) { - // then look in the appropriate subdirectory - if((voicename[0]=='m') && (voicename[1]=='b')) - { - voice_dir = "mb"; // mbrola voices - } - else - { - sprintf(name2, "%s ", voicename); - if(strstr(voices_europe, voicename) != NULL) - voice_dir = "europe"; - else - if(strstr(voices_asia, voicename) != NULL) - voice_dir = "asia"; - else - voice_dir = "other"; + // then look in the appropriate subdirectory + if((voicename[0]=='m') && (voicename[1]=='b')) + { + voice_dir = "mb"; // mbrola voices + } + else + { + sprintf(name2, "%s ", voicename); + if(strstr(voices_europe, voicename) != NULL) + voice_dir = "europe"; + else if(strstr(voices_asia, voicename) != NULL) + voice_dir = "asia"; + else + voice_dir = "other"; - sprintf(buf,"%s%s%c%s", path_voices,voice_dir,PATHSEP,voicename); + sprintf(buf,"%s%s%c%s", path_voices,voice_dir,PATHSEP,voicename); - if(GetFileLength(buf) <= 0) - { - // if not found, look in "test" sub-directory - sprintf(buf,"%stest%c%s",path_voices,PATHSEP,voicename); - } - } + if(GetFileLength(buf) <= 0) + { + // if not found, look in "test" sub-directory + sprintf(buf,"%stest%c%s",path_voices,PATHSEP,voicename); + } + } } } @@ -685,48 +686,48 @@ voice_t *LoadVoice(const char *vname, int control) switch(key) { case V_LANGUAGE: + { + unsigned int len; + int priority; + + if(tone_only) + break; + + priority = DEFAULT_LANGUAGE_PRIORITY; + language_name[0] = 0; + + sscanf(p,"%s %d",language_name,&priority); + if(strcmp(language_name,"variant") == 0) + break; + + len = strlen(language_name) + 2; + // check for space in languages[] + if(len < (sizeof(voice_languages)-langix-1)) { - unsigned int len; - int priority; + voice_languages[langix] = priority; - if(tone_only) - break; - - priority = DEFAULT_LANGUAGE_PRIORITY; - language_name[0] = 0; - - sscanf(p,"%s %d",language_name,&priority); - if(strcmp(language_name,"variant") == 0) - break; - - len = strlen(language_name) + 2; - // check for space in languages[] - if(len < (sizeof(voice_languages)-langix-1)) - { - voice_languages[langix] = priority; - - strcpy(&voice_languages[langix+1],language_name); - langix += len; - } - - // only act on the first language line - if(language_set == 0) - { - language_type = strtok(language_name,"-"); - language_set = 1; - strcpy(translator_name,language_type); - strcpy(new_dictionary,language_type); - strcpy(phonemes_name,language_type); - SelectPhonemeTableName(phonemes_name); - - if(new_translator != NULL) - DeleteTranslator(new_translator); - - new_translator = SelectTranslator(translator_name); - langopts = &new_translator->langopts; - } + strcpy(&voice_languages[langix+1],language_name); + langix += len; } - break; + + // only act on the first language line + if(language_set == 0) + { + language_type = strtok(language_name,"-"); + language_set = 1; + strcpy(translator_name,language_type); + strcpy(new_dictionary,language_type); + strcpy(phonemes_name,language_type); + SelectPhonemeTableName(phonemes_name); + + if(new_translator != NULL) + DeleteTranslator(new_translator); + + new_translator = SelectTranslator(translator_name); + langopts = &new_translator->langopts; + } + } + break; case V_NAME: if(tone_only == 0) @@ -737,14 +738,14 @@ voice_t *LoadVoice(const char *vname, int control) break; case V_GENDER: - { - int age = 0; - char vgender[80]; - sscanf(p,"%s %d",vgender,&age); - current_voice_selected.gender = LookupMnem(genders,vgender); - current_voice_selected.age = age; - } - break; + { + int age = 0; + char vgender[80]; + sscanf(p,"%s %d",vgender,&age); + current_voice_selected.gender = LookupMnem(genders,vgender); + current_voice_selected.age = age; + } + break; case V_TRANSLATOR: if(tone_only) break; @@ -752,7 +753,7 @@ voice_t *LoadVoice(const char *vname, int control) sscanf(p,"%s",translator_name); if(new_translator != NULL) - DeleteTranslator(new_translator); + DeleteTranslator(new_translator); new_translator = SelectTranslator(translator_name); langopts = &new_translator->langopts; @@ -771,16 +772,16 @@ voice_t *LoadVoice(const char *vname, int control) break; case V_PITCH: - { - double factor; - // default is pitch 82 118 - n = sscanf(p,"%d %d",&pitch1,&pitch2); - voice->pitch_base = (pitch1 - 9) << 12; - voice->pitch_range = (pitch2 - pitch1) * 108; - factor = double(pitch1 - 82)/82; - voice->formant_factor = (int)((1+factor/4) * 256); // nominal formant shift for a different voice pitch - } - break; + { + double factor; + // default is pitch 82 118 + n = sscanf(p,"%d %d",&pitch1,&pitch2); + voice->pitch_base = (pitch1 - 9) << 12; + voice->pitch_range = (pitch2 - pitch1) * 108; + factor = double(pitch1 - 82)/82; + voice->formant_factor = (int)((1+factor/4) * 256); // nominal formant shift for a different voice pitch + } + break; case V_STRESSLENGTH: // stressLength stress_lengths_set = Read8Numbers(p,stress_lengths); @@ -817,7 +818,8 @@ voice_t *LoadVoice(const char *vname, int control) case V_DICTRULES: // conditional dictionary rules and list entries case V_NUMBERS: - // expect a list of numbers + case V_STRESSOPT: + // expect a list of numbers while(*p != 0) { while(isspace(*p)) p++; @@ -825,16 +827,22 @@ voice_t *LoadVoice(const char *vname, int control) if((n = atoi(p)) > 0) { p++; - if((key==V_DICTRULES) && (n < 32)) - conditional_rules |= (1 << n); + if(n < 32) + { + if(key==V_DICTRULES) + conditional_rules |= (1 << n); + else if(key==V_NUMBERS) + langopts->numbers |= (1 << n); + else if(key==V_STRESSOPT) + langopts->stress_flags |= (1 << n); + } else - if((key==V_NUMBERS) && (n < 32)) - langopts->numbers |= (1 << n); - else - if((key==V_NUMBERS) && (n < 64)) - langopts->numbers |= (1 << (n-32)); - else - fprintf(stderr,"Bad option number %d\n", n); + { + if((key==V_NUMBERS) && (n < 64)) + langopts->numbers |= (1 << (n-32)); + else + fprintf(stderr,"Bad option number %d\n", n); + } } while(isalnum(*p)) p++; } @@ -856,9 +864,9 @@ voice_t *LoadVoice(const char *vname, int control) case V_STRESSRULE: sscanf(p,"%d %d %d %d",&langopts->stress_rule, - &langopts->stress_flags, - &langopts->unstressed_wd1, - &langopts->unstressed_wd2); + &langopts->stress_flags, + &langopts->unstressed_wd1, + &langopts->unstressed_wd2); break; case V_CHARSET: @@ -909,12 +917,12 @@ voice_t *LoadVoice(const char *vname, int control) break; case V_TONE: - { - int tone_data[12]; - ReadTonePoints(p,tone_data); - SetToneAdjust(voice,tone_data); - } - break; + { + int tone_data[12]; + ReadTonePoints(p,tone_data); + SetToneAdjust(voice,tone_data); + } + break; case V_VOICING: if(sscanf(p,"%d",&value)==1) @@ -922,16 +930,16 @@ voice_t *LoadVoice(const char *vname, int control) break; case V_BREATH: - voice->breath[0] = Read8Numbers(p,&voice->breath[1]); - for(ix=1; ix<8; ix++) - { - if(ix % 2) - voice->breath[ix] = -voice->breath[ix]; - } + voice->breath[0] = Read8Numbers(p,&voice->breath[1]); + for(ix=1; ix<8; ix++) + { + if(ix % 2) + voice->breath[ix] = -voice->breath[ix]; + } break; case V_BREATHW: - voice->breathw[0] = Read8Numbers(p,&voice->breathw[1]); + voice->breathw[0] = Read8Numbers(p,&voice->breathw[1]); break; case V_CONSONANTS: @@ -943,20 +951,20 @@ voice_t *LoadVoice(const char *vname, int control) break; case V_MBROLA: - { - int srate = 16000; - char name[40]; - char phtrans[40]; + { + int srate = 16000; + char name[40]; + char phtrans[40]; - phtrans[0] = 0; - sscanf(p,"%s %s %d",name,phtrans,&srate); - if(LoadMbrolaTable(name,phtrans,srate) != EE_OK) - { - fprintf(stderr,"mbrola voice not found\n"); - } - voice->samplerate = srate; + phtrans[0] = 0; + sscanf(p,"%s %s %d",name,phtrans,&srate); + if(LoadMbrolaTable(name,phtrans,srate) != EE_OK) + { + fprintf(stderr,"mbrola voice not found\n"); } - break; + voice->samplerate = srate; + } + break; case V_KLATT: voice->klattv[0] = 1; // default source: IMPULSIVE @@ -969,9 +977,9 @@ voice_t *LoadVoice(const char *vname, int control) SetSpeed(3); break; - case V_DICTMIN: + case V_DICTMIN: sscanf(p,"%d",&dict_min); - break; + break; default: if((key & 0xff00) == 0x100) @@ -1015,7 +1023,7 @@ voice_t *LoadVoice(const char *vname, int control) } voice->phoneme_tab_ix = ix; new_translator->phoneme_tab_ix = ix; - new_translator->dict_min_size = dict_min; + new_translator->dict_min_size = dict_min; LoadDictionary(new_translator, new_dictionary, control & 4); if(dictionary_name[0]==0) return(NULL); // no dictionary loaded @@ -1255,15 +1263,14 @@ static int ScoreVoice(espeak_VOICE *voice_spec, const char *spec_language, int s // match on voice name score += 500; } - else - if(strcmp(voice_spec->name,voice->identifier)==0) + else if(strcmp(voice_spec->name,voice->identifier)==0) { score += 400; } } if(((voice_spec->gender == 1) || (voice_spec->gender == 2)) && - ((voice->gender == 1) || (voice->gender == 2))) + ((voice->gender == 1) || (voice->gender == 2))) { if(voice_spec->gender == voice->gender) score += 50; @@ -1395,8 +1402,7 @@ espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name2) { match_fname = ix; // matching identifier, use this if no matching name } - else - if(strcmp(last_part,&id[strlen(id)-last_part_len])==0) + else if(strcmp(last_part,&id[strlen(id)-last_part_len])==0) { match_fname2 = ix; } @@ -1493,8 +1499,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found) gender = 0; if((voice_select2.gender == 2) || ((voice_select2.age > 0) && (voice_select2.age < 13))) gender = 2; - else - if(voice_select2.gender == 1) + else if(voice_select2.gender == 1) gender = 1; #define AGE_OLD 60 @@ -1625,8 +1630,8 @@ static void GetVoices(const char *path) } #else #ifdef PLATFORM_WINDOWS - WIN32_FIND_DATAA FindFileData; - HANDLE hFind = INVALID_HANDLE_VALUE; + WIN32_FIND_DATAA FindFileData; + HANDLE hFind = INVALID_HANDLE_VALUE; #undef UNICODE // we need FindFirstFileA() which takes an 8-bit c-string sprintf(fname,"%s\\*",path); @@ -1640,30 +1645,29 @@ static void GetVoices(const char *path) if(FindFileData.cFileName[0] != '.') { - sprintf(fname,"%s%c%s",path,PATHSEP,FindFileData.cFileName); - ftype = GetFileLength(fname); + sprintf(fname,"%s%c%s",path,PATHSEP,FindFileData.cFileName); + ftype = GetFileLength(fname); - if(ftype == -2) - { - // a sub-sirectory - GetVoices(fname); - } - else - if(ftype > 0) - { - // a regular line, add it to the voices list - if((f_voice = fopen(fname,"r")) == NULL) - continue; + if(ftype == -2) + { + // a sub-sirectory + GetVoices(fname); + } + else if(ftype > 0) + { + // a regular line, add it to the voices list + if((f_voice = fopen(fname,"r")) == NULL) + continue; - // pass voice file name within the voices directory - voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, FindFileData.cFileName); - fclose(f_voice); + // pass voice file name within the voices directory + voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, FindFileData.cFileName); + fclose(f_voice); - if(voice_data != NULL) - { - voices_list[n_voices_list++] = voice_data; - } - } + if(voice_data != NULL) + { + voices_list[n_voices_list++] = voice_data; + } + } } } while(FindNextFileA(hFind, &FindFileData) != 0); FindClose(hFind); @@ -1680,8 +1684,8 @@ static void GetVoices(const char *path) if(n_voices_list >= (N_VOICES_LIST-2)) break; // voices list is full - if(ent->d_name[0] == '.') - continue; + if(ent->d_name[0] == '.') + continue; sprintf(fname,"%s%c%s",path,PATHSEP,ent->d_name); @@ -1692,8 +1696,7 @@ static void GetVoices(const char *path) // a sub-sirectory GetVoices(fname); } - else - if(ftype > 0) + else if(ftype > 0) { // a regular line, add it to the voices list if((f_voice = fopen(fname,"r")) == NULL) @@ -1728,7 +1731,7 @@ espeak_ERROR SetVoiceByName(const char *name) variant_name = ExtractVoiceVariantName(buf, 0, 1); - for(ix=0; ;ix++) + for(ix=0; ; ix++) { // convert voice name to lower case (ascii) if((buf[ix] = tolower(buf[ix])) == 0) @@ -1833,7 +1836,7 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec) // sort the voices list qsort(voices_list,n_voices_list,sizeof(espeak_VOICE *), - (int (__cdecl *)(const void *,const void *))VoiceNameSorter); + (int (__cdecl *)(const void *,const void *))VoiceNameSorter); if(voice_spec)