From 7758b77459923d1252ee10cb3001a102176cea31 Mon Sep 17 00:00:00 2001 From: jonsd Date: Wed, 17 Dec 2008 12:17:53 +0000 Subject: [PATCH] [1.39.42] Languages which use non-Latin alphabets will automatically speak a word of Latin characters as English (or another specified language) without the need for entries in its *_rules file. synthesize.cpp, SynthOnTimer(): Ensure the sound channel is open if there items still to be spoken, to prevent sound output lock-up. Reduce warning messages from compilers. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@211 d46cf337-b52f-0410-862d-fd96e6ae7743 --- dictsource/dict_phonemes | 76 +++++++++++----------- dictsource/el_rules | 54 ---------------- dictsource/en_list | 13 +++- dictsource/en_rules | 8 ++- dictsource/hi_rules | 52 +-------------- dictsource/it_list | 136 +++++++++++++++++++++++++-------------- dictsource/it_rules | 35 +++++----- dictsource/ru_rules | 53 +-------------- dictsource/ta_rules | 26 -------- phsource/compile_report | 100 ++++++++++++++++------------ phsource/d/xd | Bin 2914 -> 2914 bytes phsource/l^/j2u | Bin 26050 -> 26051 bytes phsource/ph_english | 3 +- phsource/ph_french | 3 + phsource/ph_hindi | 60 +++++++---------- phsource/ph_italian | 4 +- phsource/ph_latvian | 12 ++-- phsource/phonemes | 2 +- phsource/vdiph2/uaa | Bin 7275 -> 7275 bytes phsource/voc/z | Bin 5805 -> 5805 bytes phsource/vowel/i_7 | Bin 1861 -> 1863 bytes phsource/vowel/oo_en | Bin 8093 -> 8093 bytes phsource/vowel/u_bck2 | Bin 8314 -> 8314 bytes phsource/vwl_en/u_L | Bin 0 -> 6773 bytes src/compiledata.cpp | 45 +++++++------ src/dictionary.cpp | 20 +++++- src/espeakedit.cpp | 2 +- src/extras.cpp | 7 +- src/readclause.cpp | 7 +- src/speak_lib.cpp | 28 ++++++-- src/synthdata.cpp | 26 ++++---- src/synthesize.cpp | 13 ++-- src/synthesize.h | 4 ++ src/tr_languages.cpp | 6 +- src/translate.h | 2 +- 35 files changed, 359 insertions(+), 438 deletions(-) create mode 100644 phsource/vwl_en/u_L diff --git a/dictsource/dict_phonemes b/dictsource/dict_phonemes index e20a436d..8e8582f7 100644 --- a/dictsource/dict_phonemes +++ b/dictsource/dict_phonemes @@ -11,8 +11,8 @@ Yy - : ; ? b c d dZ f g h j k l L m -n N p r s S t tS -v w x2 z Z +n N p r s S t T +tS v w x x2 z Z Dictionary bn_dict @@ -22,10 +22,10 @@ I i: i:~ i~ l- o O o: O~ o~ r- U u u: u:~ u~ * b B bh c C ch d -d. dh g gh h j J k -kh l m n N n. n^ p -ph Q r r. s S s. t -t. t.h th tS x z +d. d.h dh g gh h j J +Jh k kh l m n N n. +n^ p ph Q r r. s S +s. t t. t.h th tS x z Dictionary ca_dict @@ -194,11 +194,11 @@ l- o O o: O: O~ o~ r- U u: u~ V - : b bh c ch d d. -dh f g gh h H j J -k kh l l. m n N n. -n^ p ph Q q r r. s -S s. t T t. t.h th v -w x z +d.h 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 t. t.h +th v w x z Dictionary hu_dict @@ -217,9 +217,10 @@ Dictionary hy_dict @ a aI e eI i i@ o u W y -** b d dZ f g h j -k l m n p R R3 s -S t tS ts v x z Z +** b c d dZ dz f g +h j k k# l m n p +p# r R r" s S t t# +tS ts ts# v X z Z Dictionary id_dict @@ -274,11 +275,12 @@ a a: aI aU e E e: i I i: o o: r- u u: V y -: b bh c ch d d. dh -dZ f g gh h j J k -kh l l. m n N n. n^ -p ph R R2 s S s. S; -t t. t.h th tS v w z +: b bh c ch d d. d.h +dh dZ f g gh h j J +Jh k kh l l. m n N +n. n^ p ph R R2 s S +s. S; t t. t.h th tS v +w z Dictionary ko_dict @@ -344,11 +346,12 @@ a a: aI aU e E e: i I i: o o: r- u u: V y -: b bh c ch d d. dh -dZ f g gh h j J k -kh l l. m n N n. n^ -p ph R R2 s s. S; t -t. t.h th tS v w z z. +: b bh c ch d d. d.h +dh dZ f g gh h j J +Jh k kh l l. m n N +n. n^ p ph R R2 s s. +S; t t. t.h th tS v w +z z. Dictionary ne_dict @@ -360,11 +363,11 @@ o~ r- u uI u~ V VI VU V~ - : b bh c ch d d. -dh f g gh h H j J -k kh l l. m n N n. -n^ p ph Q q r r. s -S s. t T t. t.h th v -w x z z. +d.h 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 t. t.h +th v w x z z. Dictionary nl_dict @@ -481,14 +484,15 @@ t t; tS ts v x z Z Dictionary sq_dict -@ @- @/ a A aI E e -eI i I I# O OI u V -y yE +@ @/ a A aI E e eI +i I I# O OI u V y +yE -** b c d D dZ dZ; f -g h j k l L ll m -n n^ p r R R2 s S -t T tS ts v w z Z +** : ; b c d D dZ +dz dZ; f g h j k l +L ll m n n^ p r R +R2 s S t T tS ts v +w z Z Dictionary sv_dict diff --git a/dictsource/el_rules b/dictsource/el_rules index 774681bf..77c19bae 100644 --- a/dictsource/el_rules +++ b/dictsource/el_rules @@ -226,60 +226,6 @@ -// If we find a Latin letter a-z, then translate as English -.group a - a _^_EN -.group b - b _^_EN -.group c - c _^_EN -.group d - d _^_EN -.group e - e _^_EN -.group f - f _^_EN -.group g - g _^_EN -.group h - h _^_EN -.group i - i _^_EN -.group j - j _^_EN -.group k - k _^_EN -.group l - l _^_EN -.group m - m _^_EN -.group n - n _^_EN -.group o - o _^_EN -.group p - p _^_EN -.group q - q _^_EN -.group r - r _^_EN -.group s - s _^_EN -.group t - t _^_EN -.group u - u _^_EN -.group v - v _^_EN -.group w - w _^_EN -.group x - x _^_EN -.group y - y _^_EN -.group z - z _^_EN - .group ά 'a άη 'aI diff --git a/dictsource/en_list b/dictsource/en_list index dca72b7e..0357c3c8 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -339,6 +339,7 @@ lbs paUndz LBS $abbrev ltd lImI2tI2d mc m@k $alt2 // combine with the following word +ny $abbrev oem $abbrev ok $abbrev omg $abbrev @@ -357,6 +358,7 @@ url $abbrev usa $abbrev utc $abbrev u.s ju:'Es +VI $abbrev wwii dVb@Lju:dVb@Lju:t'u: xxx $abbrev // not roman 30 xy $abbrev @@ -370,7 +372,7 @@ st $only mr mIst3 $dot mrs mIsI2z $dot //ms mIz $dot -dr $dot +dr d0kt3 $dot lt $dot prof $dot rev $dot @@ -789,6 +791,7 @@ commence k@mEns commend k@mEnd comment k0mEnt commentary k0m@ntrI +commie k0mI committee k@mItI communique k@mju:nI2keI community k@mju:nI2tI @@ -1478,6 +1481,7 @@ neglect nI2glEkt neon ni:0n nepenthe nI2pEnTI nescience nEsI@ns +nicety naIs@tI niche ni:S noah noUV nobly noUblI $verbf @@ -1894,6 +1898,7 @@ shrilly SrIllI $verbf sibelius sI2beIli@s sierra sI'e@r@ signage saInI2dZ +signer saIn3 sikh si:k silhouette sI2lUw'Et silo saIloU @@ -1938,6 +1943,7 @@ squirrel skwIr@L standby standbaI stagnate $2 stampede $2 +stiletto stI2lEtoU strychnine str'Ikni:n sterile stEraIl stomata stoUm@t@ @@ -2788,10 +2794,9 @@ might ,maIt $verbf $strend2 $only (might have) maItha2v $pastf $u1+ (might have to) ,maIth'avt@5 $verbf $atend -have %hav $pastf $only +have %hav $pastf $only $strend2 haves havz (have been) %hav%bIn $pastf -(have to) havtU $atend has %ha2z $pastf $only has haz $only $atend (has been) %haz%bIn $pastf @@ -2968,6 +2973,7 @@ that %Dat $nounf $strend2 $verbsf these %Di:z $nounf $strend2 $only those %DoUz $nounf $strend2 $only there %De@ $strend2 $only +(there be) De@b'i: than %Dan $only (than a) ,Dan@ $nounf @@ -3036,6 +3042,7 @@ like laIk $strend2 ?3 commentary k0m@ntErI ?3 current k'3@nt ?3 depot di:poU +?3 detail $2 ?3 dialog daI@lO:g ?3 envelope A:nv@loUp ?3 err e@ diff --git a/dictsource/en_rules b/dictsource/en_rules index 8eb0bce6..3fc18a30 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -836,7 +836,7 @@ h) ar (ass @r &m) aran @ran sep) ar (at 3r - w) ar (e e@ + w) are e@ k) ar (y ar c) arbo (h ,A@boU _) arch (@P4 ,A@tS // prefix @@ -925,6 +925,7 @@ _) ash aS _) ash (a a2S _) ash (o a2S + _) as (in as _) asia eIS@ ?3 _) asia eIZ@ as (k aas @@ -1101,7 +1102,7 @@ al) av (er 'A:v sc) av (en av aver (s av'3: - _) avi (a eIvI + _) avi (A eIvI l) av (i av sl) av (i A:v r) av (el av @@ -2828,6 +2829,7 @@ d) ig (nA Ig _) ig (ni %Ig ig (no %Ig + s) ign (o %Inj ig (nom Ig ig (noran Ig ig (na Ig @@ -3554,7 +3556,7 @@ _) o (per 0 _) ope (n oUp@ un) ope (n oUp@ - @) opol '0p@L + @) opol (i '0p@L opolitan @p'0lIt@n oppor (tu %0p3 opp (res @p diff --git a/dictsource/hi_rules b/dictsource/hi_rules index 0e685e8c..906a2a61 100755 --- a/dictsource/hi_rules +++ b/dictsource/hi_rules @@ -486,61 +486,11 @@ // If we find a Latin letter a-z, then translate as English +// (This is now done automatically by the eSpeak program) -.group a - a _^_EN -.group b - b _^_EN -.group c - c _^_EN -.group d - d _^_EN -.group e - e _^_EN -.group f - f _^_EN -.group g - g _^_EN -.group h - h _^_EN -.group i - i _^_EN -.group j - j _^_EN -.group k - k _^_EN -.group l - l _^_EN -.group m - m _^_EN -.group n - n _^_EN .group o - o _^_EN D__) of (__D    me -.group p - p _^_EN -.group q - q _^_EN -.group r - r _^_EN -.group s - s _^_EN -.group t - t _^_EN -.group u - u _^_EN -.group v - v _^_EN -.group w - w _^_EN -.group x - x _^_EN -.group y - y _^_EN -.group z - z _^_EN diff --git a/dictsource/it_list b/dictsource/it_list index 74451317..48b6e31a 100644 --- a/dictsource/it_list +++ b/dictsource/it_list @@ -56,7 +56,6 @@ _cir tSi;@-*konfl'esso _dia djeR'e:zI _dot p'unto||s,ov@-*ask@-*'it:o _grv g@-*'a:ve -//_grv atS:'entog@-*'a:ve _hac h'atSek _mcn m'ak@-*on _ogo og'o:nek @@ -65,38 +64,41 @@ _stk b'aR*a _tld t'ilde -_! p'untoesklamat'ivo -_" viRgolet:e -_# kantSellet:o -_$ dolla:Ro -_% peRtS'ento -_& _!e: -_' ap'OstRofo -_( ap'eRtapaR'entezi -_) kj,uzapaR'entezi -_* asteRisko -_+ pju -_, v'iRgola -_- t@-*at:ino -_. punto -_/ slaS -_: d,uep'unte -_; p'untoev'iRgola -_< ap'eRta'angolo -_= ugwale -_> kj,uza'angolo -_? p'untointeRogat'ivo -_@ ki'otS:ola -_[ ap'eRtakw2'ad@-*a -_\ bakslaS -_] kj,uzakw2'ad@-*a -_^ kap:utS:o -__ 'undeRskoRe -_` bakp@-*aIm -_{ ap'eRtag@-*'af:a -_| b'aRa -_} kj,uzag@-*'af:a -_~ tilde +* asteRisko $max3 +% pe@-*tS'ento $max3 +. punto $max3 += ugwale $max3 ++ pju $max3 +/ slaS $max3 +\ bakslaS $max3 +₤ lira +£ sterl'ina +& _e +@ ki'otS:ola +© k'opiraIt +# kantSellet:o +@ ki'otS:ola +~ tilde +: d,uep'unti + +_! p,untoesklamat'ivo +_" viRgolet:e +_' ap'OstRofo +_( ap,eRtapaR'entezi +_) kj,uzapaR'entezi +_, v'iRgola +_- t@-*at:ino +_; p,untoev'iRgola +_< ap,eRta'angolo +_> kj,uza'angolo +_? p,untointeRogat'ivo +_[ ap'eRtakw2'ad@-*a +_] kj,uzakw2'ad@-*a +_^ kap:utS:o +__ 'undeRskoRe +_` bakp@-*aIm +_{ ap,eRtag@-*'af:a +_} kj,uzag@-*'af:a @@ -412,26 +414,66 @@ o O: $atend // foreign words -chat tSat +chat _^_EN cliché kli:Se -internet 'internet +internet _^_EN jeans dZi:nz web wEb +accelerator _^_EN +ace _^_EN +aces _^_EN // exceptions -aereo $2 -difficile $2 -pneumatici $3 +aereo $2 +difficile $2 +pneumatici $3 -nott nOt: $stem -tavol $1 $stem -vent vEnt $stem +nott nOt: $stem +tavol $1 $stem +vent vEnt $stem -celsius tsElsj'us -conoscerla $2 -no nO -posta pOsta +celsius tsElsj'us +conoscerla $2 +no nO +posta pOsta principi $1 -tesser tess'ER -uomini $1 +tesser tess'ER +uomini $1 + + +// $alt = use ò or è in the stressed syllable +// If the final vowel is omitted, then the rule applies to 'a' 'e' 'i' 'o' +$textmode + +abbandonatel $4 +abbazie abbazìe +abbinano $2 +abbinini $2 +abbisognino $3 +abituarcisi $2 +accalcano $2 +accalchino $2 +accantonal $3 +accatastano $3 +accatastino $3 +accavallio $4 +accenditi $2 +accertano $2 $alt +accertino $2 $alt +acclamano $2 +acclamino $2 +accolit $2 $alt +accomunano $3 +accomunino $3 +accorpano $2 $alt +accorpino $2 $alt +accostarcisi $3 +accovacciano $3 +accovaccino $3 +acefala $2 +acer accer // acer/i/o +acid accid // acida/e +acidul $1 + + diff --git a/dictsource/it_rules b/dictsource/it_rules index 62978055..30e618ae 100644 --- a/dictsource/it_rules +++ b/dictsource/it_rules @@ -3,6 +3,8 @@ // letter groups // A any vowel +// C any consonant +// K not a vowel (i.e. consonant or end-of-word) // Y front vowels: e i (& accents) .L01 a à o ò ó u ù @@ -51,8 +53,14 @@ .group e e e: e (CK e + e (T E: // The word has $alt in it_list + e (CKT E // $alt ei ej (K + e (r E: // ?? [E] before 'r' + e (rK E + e (rsi_N e + &) e (_S1q e // lookup it_list without suffix // @) e (ce_ =e @) e (ci_ =e @@ -167,8 +175,14 @@ .group o o o: o (CK o + o (T O: // $alt + o (CKT O // $alt oi oI (K + o (r O: // ?? [O] before 'r' + o (rK O + o (re_ o + &) o (_S1q o // lookup it_list without suffix @) o (ista_ o @@ -223,7 +237,8 @@ sch (Y sk sh (K S // foreign words K) sh S // foreign words - @) sia s'ia + @) sia s'ia + @) s (_S1 s .group t t t @@ -275,32 +290,14 @@ ù 'u: ù (CK 'u - % pertS'ento $ dolla:ro - ₤ lira - £ sterl'ina - & _!e - @ ki'otS:ola - © k'opiraIt - + pju - . punto , (D v'irgola - : d,uep'unti - ; p'untoev'irgola ! _p'untoesklamat'ivo_ !) ! ? _p'untointeRogat'ivo_ ?) ? - \\ kont@-*ob'aR*a - / b'aR*a __) - (_D meno A_) - (_D _ C_) - (_D _ - --) - - − meno - * asterisko - *) * (* - ** - **) * (_ _:: diff --git a/dictsource/ru_rules b/dictsource/ru_rules index 2842d65b..54b2f3e0 100755 --- a/dictsource/ru_rules +++ b/dictsource/ru_rules @@ -642,58 +642,7 @@ ё 8 // If we find a Latin letter a-z, then translate as English -.group a - a _^_EN -.group b - b _^_EN -.group c - c _^_EN -.group d - d _^_EN -.group e - e _^_EN -.group f - f _^_EN -.group g - g _^_EN -.group h - h _^_EN -.group i - i _^_EN -.group j - j _^_EN -.group k - k _^_EN -.group l - l _^_EN -.group m - m _^_EN -.group n - n _^_EN -.group o - o _^_EN -.group p - p _^_EN -.group q - q _^_EN -.group r - r _^_EN -.group s - s _^_EN -.group t - t _^_EN -.group u - u _^_EN -.group v - v _^_EN -.group w - w _^_EN -.group x - x _^_EN -.group y - y _^_EN -.group z - z _^_EN +// (This is now done automatically by the eSpeak program) .group $ dolar diff --git a/dictsource/ta_rules b/dictsource/ta_rules index 5c8c27e3..54134f7f 100644 --- a/dictsource/ta_rules +++ b/dictsource/ta_rules @@ -183,29 +183,3 @@ .group ் // virama $ dolV -a _^_EN -b _^_EN -c _^_EN -d _^_EN -e _^_EN -f _^_EN -g _^_EN -h _^_EN -i _^_EN -j _^_EN -k _^_EN -l _^_EN -m _^_EN -n _^_EN -o _^_EN -p _^_EN -q _^_EN -r _^_EN -s _^_EN -t _^_EN -u _^_EN -v _^_EN -w _^_EN -x _^_EN -y _^_EN -z _^_EN diff --git a/phsource/compile_report b/phsource/compile_report index 6df9afc7..956972d7 100644 --- a/phsource/compile_report +++ b/phsource/compile_report @@ -17,8 +17,8 @@ fi 40 134 fr 54 140 fr_ca 11 140 - hi 59 148 - ta 17 151 + hi 60 149 + ta 17 152 hu 23 119 lv 29 126 nl 28 126 @@ -50,18 +50,18 @@ ku 18 127 id 15 124 rw 15 129 - ko 18 158 + ko 18 159 da 15 133 - sq 35 130 - ml 13 150 - kn 15 150 - bn 59 153 - ne 18 156 - hy 16 116 + sq 35 127 + ml 13 151 + kn 15 151 + bn 59 155 + ne 18 157 + hy 24 119 om 25 125 en_klatt 77 149 ga 18 117 - mr 1 148 + mr 1 149 Data file Used by b/b [b] base @@ -181,6 +181,7 @@ d/xd [d] base [d] hi [d.] hi [dh] hi + [d.h] hi [d] hu [d] pl [d] hr @@ -190,8 +191,10 @@ d/xd [d] base [d] sw [d] id [d] sq + [dz] sq [d] bn [d.] bn + [dz] hy [d[] ga d/xd2 [d`] om d/xd3 [dh] hi @@ -206,6 +209,7 @@ dzh/dzh [dZ] base [dZ] sr [dZ;] sr [dZ;] ru + [dZ;] sq [J] bn dzh/dzh_ [dZ] base [dZ;] base @@ -215,16 +219,15 @@ dzh/dzh_ [dZ] base [dZ;] hr [dZ;] mk [dZ;] ru + [dZ;] sq [J] bn dzh/dzh2 [dZ] hr [dZ;] hr dzh/dz_pzd [J] base - [J2] hi [J] tr [J] ku [J2] bn dzh/dz_pzd_ [J] base - [J2] hi [J2] bn dzh/xdzh [dZ] base [dZ;] base @@ -234,9 +237,10 @@ dzh/xdzh [dZ] base [dZ;] hr [dZ;] mk [dZ;] ru + [dZ;] sq [J] bn dzh/xdz_pzd [J] base - [J2] hi + [Jh] hi [J2] bn envelope/i_risefall [11] zh envelope/i_risefall2 [+2] rw @@ -652,7 +656,6 @@ l/l_long [l] base [l] fr [l] la [l;] ro - [L] sq l/lo [(o)] base [O] fr [o] fr @@ -691,7 +694,6 @@ l/tl [l] base [l] ca [l] pt [l;] ro - [L] sq l/xl [(@)] base [(a)] base [(e)] base @@ -944,6 +946,7 @@ ufric/s [s] base [s] es [s#] pt [s`] ko + [z] sq [s] en_klatt ufric/s_ [s] base [z] base @@ -958,6 +961,7 @@ ufric/s_ [s] base [s#] pt [z;] ro [s2] is + [z] sq [s2] om [s] en_klatt [z] en_klatt @@ -1102,6 +1106,7 @@ ustop/k_unasp [k] base [k`] ko [k] sq [k] bn + [k] hy ustop/k_unasp_ [k] zh ustop/null [?] base ustop/p [p] base @@ -1115,10 +1120,10 @@ ustop/p_ [p] base [ph] hi [ph] zh [ph] bn - [ph] hy + [p#] hy ustop/p_asp [bh] hi [ph] hi - [ph] hy + [p#] hy ustop/p_ejc [p`] om ustop/percus10 [(X1] base ustop/pl [p] base @@ -1135,7 +1140,8 @@ ustop/pl [p] base [p] sq [p] bn [ph] bn - [ph] hy + [p] hy + [p#] hy ustop/pr [p] base [p] base2 [p] fi @@ -1147,7 +1153,8 @@ ustop/pr [p] base [p;] ro [p] bn [ph] bn - [ph] hy + [p] hy + [p#] hy ustop/p_unasp [p] base [p] base2 [p] fi @@ -1162,6 +1169,7 @@ ustop/p_unasp [p] base [p`] ko [p] sq [p] bn + [p] hy ustop/p_unasp_ [p] base2 [p] fi [p] hi @@ -1172,10 +1180,12 @@ ustop/p_unasp_ [p] base2 [p;] ro [p] sq [p] bn + [p] hy ustop/q [q] base ustop/q_u [q] base ustop/t [t] base [t2] en + [d.h] hi [t.h] hi [t] zhy [t.h] bn @@ -1185,12 +1195,10 @@ ustop/t_ [t] base [t2] fr [t3] fr [t.] hi - [t.h] hi [t] lv [t] sk [t] el [th] zh - [t3] sq [t.] bn [t.h] bn ustop/t_dnt [t] base @@ -1209,23 +1217,22 @@ ustop/t_dnt [t] base [t[] vi [t] sw [t`] ko - [t5] sq + [t] sq [t] bn + [t] hy [t[] ga ustop/t_dnt2 [t[] vi ustop/t_ejc [t`] om -ustop/t_hard [t2] sq -ustop/t_hard_ [t2] sq ustop/t_hi [t] hi - [t5] sq + [t] sq [t] bn [th] bn + [t] hy ustop/t_pzd [t;] pl [t;] ru ustop/tr [t] base [t[] base [t2] en - [t.h] hi [t] ru [t.h] bn ustop/ts [ts] base2 @@ -1238,7 +1245,9 @@ ustop/ts [ts] base2 [z] zhy [tsh] zh [ts] sq - [ts] hy + [dz] sq + [dz] hy + [ts#] hy ustop/ts_ [ts] base2 [ts] de [ts] eo @@ -1248,8 +1257,11 @@ ustop/ts_ [ts] base2 [ts] ru [ts;] ro [ts] sq - [ts] hy + [dz] sq + [dz] hy + [ts#] hy ustop/ts2 [ts] lv + [ts] hy ustop/tsh [tS] base [c] zhy ustop/tsh_ [tS] base @@ -1263,29 +1275,31 @@ ustop/t_short [t] fr [t] lv [t] sk [t] el - [t3] sq [t.] bn ustop/tsh_pzd [tS;] zh ustop/tsh_pzd_unasp [tS;] zh ustop/tsh_sr [tS] sr ustop/ts_pzd [tS;] base [ts;] base + [Jh] hi [ch] hi [tS;] ru [c] sq + [dZ;] sq [ch] bn ustop/ts_pzd_ [c] hi [c] hu [c] bn + [c] hy ustop/ts_pzd2 [c] hi [c] hu [c`] ko [c] bn + [c] hy ustop/ts_pzd3 [tS;] hr [dZ;] hr ustop/t_sr [d] sr [t] sr - [t4] sq ustop/ts_rfx [ts.] zh ustop/ts_rfx_unasp [ts.] zh ustop/ts_sr [tS;] sr @@ -1659,11 +1673,13 @@ voc/z [z] base [z2] fr [z3] fr [z;] ro + [z] sq voc/z_ [z] base [z] fr [z2] fr [z3] fr [z;] ro + [z] sq voc/zh [Z] base [z.] base [R^] sk @@ -1744,6 +1760,7 @@ vowel/8_2 [U] en_us [8] sv vowel/8_3 [eo] zhy vowel/8_5 [8] ku +vowel/8_6 [V] sq vowel/8_7 [@] lv vowel/a [a] en [aa] en @@ -1797,6 +1814,8 @@ vowel/a_3 [a] en_sc [a/] en_sc [A:] en_sc [aa] en_sc + [a] lv + [a:] lv [a:] cs [a:] la [a] is @@ -1837,8 +1856,6 @@ vowel/a_6 [a] fr [a:] vi vowel/aa [a] fi [A] fr_ca - [a] lv - [a:] lv [A] no [A:] no [aa] zhy @@ -1958,6 +1975,8 @@ vowel/e_mid [E] en_rp [E] fr_ca [E] hi [E] hu + [e] lv + [e:] lv [E] pl [e:] sk [e] cs @@ -1981,8 +2000,6 @@ vowel/e_mid2 [E] af [E:] de [e] jbo [e] fi - [e] lv - [e:] lv [E] nl [e] sk [e] es @@ -2273,6 +2290,8 @@ vowel/u [u:] en_wi [U] fr [u] ta [u:] ta + [u] lv + [u:] lv [u:] cs [U] la [u] id @@ -2297,9 +2316,7 @@ vowel/u#_3 [U] ta [U:] ta vowel/u#_4 [U] en_sc [u:] en_sc -vowel/u_5 [u] lv - [u:] lv - [u] sw +vowel/u_5 [u] sw vowel/u#_5 [y] vi vowel/u_6 [U] pt_pt [u] pt_pt @@ -2334,8 +2351,7 @@ vowel/u_bck [u] base2 [u:] ga vowel/u_bck2 [u:] la [u] sq -vowel/u_fnt [u:] en - [u:] en_rp +vowel/u_fnt [u:] en_rp vowel/uu [U] en [U] en_n [U] en_wm @@ -2446,6 +2462,7 @@ vwl_en_rp/aa [A:] en_rp [aa] en_rp vwl_en_rp/aU@ [aU@] en_rp vwl_en_rp/i@ [i@] en_rp +vwl_en/u_L [u:] en vwl_en_us/3_us [3] en_us vwl_en_us/3_us2 [3:] en_us vwl_en_us/a [a] en_us @@ -2590,6 +2607,7 @@ x/d [d] base [t#] en_us [d] fr [d.] hi + [d.h] hi [d] hr [d] el [d] is @@ -2635,7 +2653,6 @@ x/d_pzd [d;] pl [d;] ru x/dzh [J] base [dZ] base - [J2] hi [J2] bn [dZ] en_klatt x/dzh_ [dZ] base @@ -2652,8 +2669,7 @@ x/dz_pzd [dZ;] base [dZ;] mk [dZ;] ru [J] bn -x/dz_pzd_ [J2] hi - [J2] bn +x/dz_pzd_ [J2] bn x/g_ [g] base [g] cy [g] fr diff --git a/phsource/d/xd b/phsource/d/xd index 6d9f36f5b39a254a2542e16dc676ef84e2095391..f0df7bcdf76766778db47b8c475daf702355e424 100644 GIT binary patch delta 49 zcmaDP_DD=HIKb68B-k~OiGhKkB88bDWul-VW9CNZ!_17Cn@_V(XP!KdT?fhp0BVvC A8~^|S delta 49 zcmaDP_DD=HIKb68B-k~OiGhKkB88bDYNDVaW9>%g!_17en@_V(XP!KdT?fhp0BsTv AP5=M^ diff --git a/phsource/l^/j2u b/phsource/l^/j2u index 6d03ad5cb5189d79383f414ea2aba4b1963a14de..4efec05b3a5fca6809929bbac827d641951ab904 100644 GIT binary patch delta 457 zcmY+Aze@sP9EU&O_qBRG&lAdi87Kxh2oVTf&>$CKZDQGQIW;sy|3nlx1T}=UHMKO? zO_5V>3KEUA1Qj%i($dh-`#sU}riX*~^Ssad(4bm_tYRUzx>d|=NC5kpoA6nzP|^sT z0MaI#Mkx&tB6*P)$La?=L5#S<6_-YioDd}Qbod;PCWe^5tQvMB(BukWQMof-EB0Xs z(XMpl*k%Ch1M}lFhi`P}kAf?t=L39nEmR%W^FCjj+tizHTCe}+Z9QLU#p0fu%E|*r zw)IWlRX=DUk`aGFQEdcOMODYy%1J;I zb5zx362hBGm*iewi0%u{vJfo1RUH*8 MR`sO!JpZ}$3sMtRX8-^I delta 396 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 X{Vul5&DL|&&HBHZGPr&XWrqI&3YjI7 literal 0 HcmV?d00001 diff --git a/src/compiledata.cpp b/src/compiledata.cpp index 11b2ca11..099679a8 100755 --- a/src/compiledata.cpp +++ b/src/compiledata.cpp @@ -85,13 +85,10 @@ static const int flags_alternative[] = {phBEFOREVOWEL,phBEFOREVOWELPAUSE,phBEFORENOTVOWEL,phBEFORENOTVOWEL2,phSWITCHVOICING}; -extern void Write4Bytes(FILE *f, int value); -extern int Read4Bytes(FILE *f); extern void MakeVowelLists(void); extern void FindPhonemesUsed(void); extern void DrawEnvelopes(); extern int LoadEnvelope2(FILE *f, const char *fname); -extern int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *fname, int flags); static int markers_used[8]; @@ -109,7 +106,7 @@ typedef struct { int n_envelopes = 0; char envelope_paths[N_ENVELOPES][80]; unsigned char envelope_dat[N_ENVELOPES][ENV_LEN]; -FILE *f_phdata; +static FILE *f_phdata; @@ -343,8 +340,8 @@ static FILE *fopen_log(FILE *f_log, const char *fname,const char *access) } -int Hash8(const char *string) -//=========================== +static int Hash8(const char *string) +//================================== /* Generate a hash code from the specified string */ { int c; @@ -807,8 +804,6 @@ int Compile::LoadWavefile(FILE *f, const char *fname) int resample_wav = 0; char fname_temp[100]; int scale_factor=0; - int fd_temp; - char command[sizeof(path_source)+200]; fseek(f,24,SEEK_SET); sr1 = Read4Bytes(f); @@ -828,26 +823,30 @@ int Compile::LoadWavefile(FILE *f, const char *fname) Error("Not mono: ",fname); } #else - strcpy(fname_temp,"/tmp/espeakXXXXXX"); - if((fd_temp = mkstemp(fname_temp)) >= 0) { - close(fd_temp); - sprintf(command,"sox \"%s%s.wav\" -r %d -c 1 -w %s polyphase\n",path_source,fname,samplerate,fname_temp); - if(system(command) < 0) + int fd_temp; + char command[sizeof(path_source)+200]; + strcpy(fname_temp,"/tmp/espeakXXXXXX"); + if((fd_temp = mkstemp(fname_temp)) >= 0) { - Error("Failed to resample: ",command); + close(fd_temp); + sprintf(command,"sox \"%s%s.wav\" -r %d -c 1 -w %s polyphase\n",path_source,fname,samplerate,fname_temp); + if(system(command) < 0) + { + Error("Failed to resample: ",command); + return(0); + } + } + + f = fopen(fname_temp,"rb"); + if(f == NULL) + { + Error("Can't read temp file: ",fname_temp); return(0); } + resample_wav = 1; + fseek(f,40,SEEK_SET); // skip past the WAV header, up to before "data length" } - - f = fopen(fname_temp,"rb"); - if(f == NULL) - { - Error("Can't read temp file: ",fname_temp); - return(0); - } - resample_wav = 1; - fseek(f,40,SEEK_SET); // skip past the WAV header, up to before "data length" #endif } diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 23bd9c65..25940453 100755 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -779,6 +779,13 @@ int Unpronouncable(Translator *tr, char *word) return(Unpronouncable_en(tr,word)); } + utf8_in(&c,word); + if((tr->letter_bits_offset > 0) && (c < 0x241)) + { + // Latin characters for a language with a non-latin alphabet + return(0); // so we can re-translate the word as English + } + if(tr->langopts.param[LOPT_UNPRONOUNCABLE] == 1) return(0); @@ -2523,8 +2530,19 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c if((match1.points == 0) && ((option_sayas & 0x10) == 0)) { - // no match, try removing the accent and re-translating the word n = utf8_in(&letter,p-1)-1; + + if(tr->letter_bits_offset > 0) + { + // not a Latin alphabet, switch to the default Latin alphabet language + if((letter <= 0x241) && iswalpha(letter)) + { + sprintf(phonemes,"%c%s",phonSWITCH,tr->langopts.ascii_language); + return(0); + } + } + + // no match, try removing the accent and re-translating the word if((letter >= 0xc0) && (letter <= 0x241) && ((ix = remove_accent[letter-0xc0]) != 0)) { // within range of the remove_accent table diff --git a/src/espeakedit.cpp b/src/espeakedit.cpp index 336d6917..bbd907f0 100755 --- a/src/espeakedit.cpp +++ b/src/espeakedit.cpp @@ -619,9 +619,9 @@ const long style): MyChild::~MyChild(void) { - wxWindow *w; canvas = NULL; #ifndef PLATFORM_WINDOWS + wxWindow *w; // bug in wxMDIChildFrame, we need to explicitly remove the ChildFrame from the ClientWindow w = myframe->GetClientWindow(); w->RemoveChild(this); diff --git a/src/extras.cpp b/src/extras.cpp index 95b9c7e2..62c03ce2 100644 --- a/src/extras.cpp +++ b/src/extras.cpp @@ -496,7 +496,7 @@ void Lexicon_Ru() char fname[sizeof(path_dsource)+20]; // KOI8-R codes for Russian vowels - static char vowels[] = {0xa3,0xc0,0xc1,0xc5,0xc9,0xcf,0xd1,0xd5,0xd9,0xdc,0}; + static unsigned char vowels[] = {0xa3,0xc0,0xc1,0xc5,0xc9,0xcf,0xd1,0xd5,0xd9,0xdc,0}; typedef struct { const char *suffix; @@ -617,7 +617,7 @@ p_unicode = unicode; ru_stress = vcount; break; } - if(strchr(vowels,c) != NULL) + if(strchr((char *)vowels,c) != NULL) { vcount++; } @@ -1163,6 +1163,7 @@ void Test2() const char* text1 = "Hello world. Testing."; +extern void TestCompile2(void); void TestTest(int control) {//======================= @@ -1177,7 +1178,7 @@ void TestTest(int control) //CharsetToUnicode("ISO-8859-4"); //CharsetToUnicode("ISCII"); - +TestCompile2(); return; if(control==2) diff --git a/src/readclause.cpp b/src/readclause.cpp index 582e8282..4e836cb7 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -654,7 +654,6 @@ static int LoadSoundFile(const char *fname, int index) int length; char fname_temp[100]; char fname2[sizeof(path_home)+13+40]; - char command[sizeof(fname2)+sizeof(fname2)+40]; if(fname == NULL) { @@ -680,6 +679,7 @@ static int LoadSoundFile(const char *fname, int index) int fd_temp; const char *resample; int header[3]; + char command[sizeof(fname2)+sizeof(fname2)+40]; fseek(f,20,SEEK_SET); for(ix=0; ix<3; ix++) @@ -1243,9 +1243,10 @@ static int attr_prosody_value(int param_type, const wchar_t *pw, int *value_out) } // end of attr_prosody_value -static int AddNameData(const char *name, int wide) -{//=============================================== +int AddNameData(const char *name, int wide) +{//======================================== // Add the name to the namedata and return its position +// (Used by the Windows SAPI wrapper) int ix; int len; void *vp; diff --git a/src/speak_lib.cpp b/src/speak_lib.cpp index 1ff56c2b..18a9545c 100644 --- a/src/speak_lib.cpp +++ b/src/speak_lib.cpp @@ -74,11 +74,12 @@ static int dispatch_audio(short* outbuf, int length, espeak_EVENT* event) int a_wave_can_be_played = fifo_is_command_enabled(); +#ifdef DEBUG_ENABLED SHOW("*** dispatch_audio > uid=%d, [write=%p (%d bytes)], sample=%d, a_wave_can_be_played = %d\n", (event) ? event->unique_identifier : 0, wave_test_get_write_buffer(), 2*length, (event) ? event->sample : 0, a_wave_can_be_played); - +#endif switch(my_mode) { @@ -156,11 +157,14 @@ static int create_events(short* outbuf, int length, espeak_EVENT* event, uint32_ else { event = event_list + i; - +#ifdef DEBUG_ENABLED SHOW("Synthesize: event->sample(%d) + %d = %d\n", event->sample, the_write_pos, event->sample + the_write_pos); +#endif event->sample += the_write_pos; } +#ifdef DEBUG_ENABLED SHOW("*** Synthesize: i=%d (event_list_ix=%d), length=%d\n",i,event_list_ix,length); +#endif finished = dispatch_audio((short *)outbuf, length, event); length = 0; // the wave data are played once. i++; @@ -365,7 +369,6 @@ static int initialise(void) static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text, int flags) {//======================================================================================== // Fill the buffer with output sound - ENTER("Synthesize"); int length; int finished = 0; int count_buffers = 0; @@ -374,6 +377,7 @@ static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text, #endif #ifdef DEBUG_ENABLED + ENTER("Synthesize"); if (text) { SHOW("Synthesize > uid=%d, flags=%d, >>>text=%s<<<\n", unique_identifier, flags, text); @@ -429,7 +433,9 @@ static espeak_ERROR Synthesize(unsigned int unique_identifier, const void *text, for(;;) { +#ifdef DEBUG_ENABLED SHOW("Synthesize > %s\n","for (next)"); +#endif out_ptr = outbuf; out_end = &outbuf[outbuf_size]; event_list_ix = 0; @@ -524,11 +530,13 @@ void MarkerEvent(int type, unsigned int char_position, int value, unsigned char ep->audio_position = int(time); ep->sample = (count_samples + mbrola_delay + (out_ptr - out_start)/2); +#ifdef DEBUG_ENABLED SHOW("MarkerEvent > count_samples=%d, out_ptr=%x, out_start=0x%x\n",count_samples, out_ptr, out_start); SHOW("*** MarkerEvent > type=%s, uid=%d, text_pos=%d, length=%d, audio_position=%d, sample=%d\n", label[ep->type], ep->unique_identifier, ep->text_position, ep->length, ep->audio_position, ep->sample); - +#endif + if((type == espeakEVENT_MARK) || (type == espeakEVENT_PLAY)) ep->id.name = &namedata[value]; else @@ -542,11 +550,13 @@ espeak_ERROR sync_espeak_Synth(unsigned int unique_identifier, const void *text, unsigned int position, espeak_POSITION_TYPE position_type, unsigned int end_position, unsigned int flags, void* user_data) {//=========================================================================== + +#ifdef DEBUG_ENABLED ENTER("sync_espeak_Synth"); - SHOW("sync_espeak_Synth > position=%d, position_type=%d, end_position=%d, flags=%d, user_data=0x%x, text=%s\n", position, position_type, end_position, flags, user_data, text); - - espeak_ERROR aStatus; +#endif + + espeak_ERROR aStatus; InitText(flags); my_unique_identifier = unique_identifier; @@ -748,8 +758,10 @@ ESPEAK_API espeak_ERROR espeak_Synth(const void *text, size_t size, unsigned int end_position, unsigned int flags, unsigned int* unique_identifier, void* user_data) {//===================================================================================== +#ifdef DEBUG_ENABLED ENTER("espeak_Synth"); SHOW("espeak_Synth > position=%d, position_type=%d, end_position=%d, flags=%d, user_data=0x%x, text=%s\n", position, position_type, end_position, flags, user_data, text); +#endif espeak_ERROR a_error=EE_INTERNAL_ERROR; static unsigned int temp_identifier; @@ -805,8 +817,10 @@ ESPEAK_API espeak_ERROR espeak_Synth_Mark(const void *text, size_t size, unsigned int* unique_identifier, void* user_data) {//========================================================================= +#ifdef DEBUG_ENABLED ENTER("espeak_Synth_Mark"); SHOW("espeak_Synth_Mark > index_mark=%s, end_position=%d, flags=%d, text=%s\n", index_mark, end_position, flags, text); +#endif espeak_ERROR a_error=EE_OK; static unsigned int temp_identifier; diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 5d9c6b87..88b0b120 100755 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.39.39 11.Dec.08"; +const char *version_string = "1.39.42 17.Dec.08"; const int version_phdata = 0x013900; int option_device_number = -1; @@ -69,8 +69,8 @@ int FormantTransition2(frameref_t *seq, int &n_frames, unsigned int data1, unsig -static int ReadPhFile(char **ptr, const char *fname) -{//================================================= +static char *ReadPhFile(void *ptr, const char *fname) +{//================================================== FILE *f_in; char *p; unsigned int length; @@ -82,25 +82,25 @@ static int ReadPhFile(char **ptr, const char *fname) if((f_in = fopen(buf,"rb")) == NULL) { fprintf(stderr,"Can't read data file: '%s'\n",buf); - return(1); + return(NULL); } - if(*ptr != NULL) - Free(*ptr); + if(ptr != NULL) + Free(ptr); if((p = Alloc(length)) == NULL) { fclose(f_in); - return(-1); + return(NULL); } if(fread(p,1,length,f_in) != length) { fclose(f_in); - return(-1); + return(NULL); } - *ptr = p; + fclose(f_in); - return(0); + return(p); } // end of ReadPhFile @@ -112,11 +112,11 @@ int LoadPhData() int result = 1; unsigned char *p; - if(ReadPhFile((char **)(&phoneme_tab_data),"phontab") != 0) + if((phoneme_tab_data = (unsigned char *)ReadPhFile((void *)(phoneme_tab_data),"phontab")) == NULL) return(-1); - if(ReadPhFile((char **)(&phoneme_index),"phonindex") != 0) + if((phoneme_index = (unsigned int *)ReadPhFile((void *)(phoneme_index),"phonindex")) == NULL) return(-1); - if(ReadPhFile((char **)(&spects_data),"phondata") != 0) + if((spects_data = ReadPhFile((void *)(spects_data),"phondata")) == NULL) return(-1); wavefile_data = (unsigned char *)spects_data; diff --git a/src/synthesize.cpp b/src/synthesize.cpp index 6a199da9..ba63c59a 100755 --- a/src/synthesize.cpp +++ b/src/synthesize.cpp @@ -1479,6 +1479,9 @@ int SynthOnTimer() } do { + if(WcmdqUsed() > 0) + WavegenOpenSound(); + if(Generate(phoneme_list,&n_phoneme_list,1)==0) { SpeakNextClause(NULL,NULL,1); @@ -1511,7 +1514,6 @@ int SpeakNextClause(FILE *f_in, const void *text_in, int control) int clause_tone; char *voice_change; - FILE *f_mbrola; static FILE *f_text=NULL; static const void *p_text=NULL; @@ -1629,9 +1631,12 @@ int SpeakNextClause(FILE *f_in, const void *text_in, int control) #ifdef USE_MBROLA_LIB MbrolaTranslate(phoneme_list,n_phoneme_list,NULL); #else - if((f_mbrola = f_trans) == stderr) - f_mbrola = stdout; - MbrolaTranslate(phoneme_list,n_phoneme_list,f_mbrola); + { + FILE *f_mbrola; + if((f_mbrola = f_trans) == stderr) + f_mbrola = stdout; + MbrolaTranslate(phoneme_list,n_phoneme_list,f_mbrola); + } #endif } diff --git a/src/synthesize.h b/src/synthesize.h index 10089d8c..f50a208e 100755 --- a/src/synthesize.h +++ b/src/synthesize.h @@ -297,6 +297,10 @@ void SetEmbedded(int control, int value); void SelectPhonemeTable(int number); int SelectPhonemeTableName(const char *name); +void Write4Bytes(FILE *f, int value); +int Read4Bytes(FILE *f); +int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *err_name,int flags); + extern unsigned char *envelope_data[18]; extern int formant_rate[]; // max rate of change of each formant diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 9b7910bd..f42321d0 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -153,6 +153,7 @@ static Translator* NewTranslator(void) tr->langopts.param[LOPT_UNPRONOUNCABLE] = 's'; // don't count this character at start of word tr->langopts.max_initial_consonants = 3; tr->langopts.replace_chars = NULL; + tr->langopts.ascii_language = ""; // Non-Latin alphabet languages, use this language to speak Latin words, default is English SetLengthMods(tr,201); // tr->langopts.length_mods = length_mods_en; @@ -576,6 +577,7 @@ SetLengthMods(tr,3); // all equal SetLetterBits(tr,LETTERGP_C,hy_consonants); tr->langopts.max_initial_consonants = 6; tr->langopts.numbers = 0x409; +// tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words } break; @@ -652,13 +654,13 @@ SetLengthMods(tr,3); // all equal case L('k','o'): // Korean, TEST { static const char ko_ivowels[] = {0x63,0x64,0x67,0x68,0x6d,0x72,0x74,0x75,0}; // y and i vowels - static const char ko_voiced[] = {0x02,0x05,0x06,0xab,0xaf,0xb7,0xbc,0}; // voiced consonants, l,m,n,N + static const unsigned char ko_voiced[] = {0x02,0x05,0x06,0xab,0xaf,0xb7,0xbc,0}; // voiced consonants, l,m,n,N tr->letter_bits_offset = OFFSET_KOREAN; memset(tr->letter_bits,0,sizeof(tr->letter_bits)); SetLetterBitsRange(tr,LETTERGP_A,0x61,0x75); SetLetterBits(tr,LETTERGP_Y,ko_ivowels); - SetLetterBits(tr,LETTERGP_G,ko_voiced); + SetLetterBits(tr,LETTERGP_G,(const char *)ko_voiced); tr->langopts.stress_rule = 8; // ?? 1st syllable if it is heavy, else 2nd syllable tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words diff --git a/src/translate.h b/src/translate.h index 50ae91dc..acfa1255 100755 --- a/src/translate.h +++ b/src/translate.h @@ -378,6 +378,7 @@ typedef struct { int testing; // testing options: bit 1= specify stressed syllable in the form: "outdoor/2" int listx; // compile *_listx after *list const unsigned int *replace_chars; // characters to be substitutes + const char *ascii_language; // switch to this language for Latin characters } LANGUAGE_OPTIONS; @@ -517,7 +518,6 @@ extern int (* uri_callback)(int, const char *, const char *); extern int (* phoneme_callback)(const char *); extern void SetLengthMods(Translator *tr, int value); -int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, char *err_name,int flags); void LoadConfig(void); int TransposeAlphabet(char *text, int offset, int min, int max); int utf8_in(int *c, const char *buf);