Browse Source

[1.41.15]

Fixes to: announce punctuation ( --punct option)


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@227 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 16 years ago
parent
commit
1ef2aa6091

+ 9
- 2
dictsource/dict_phonemes View File

Dictionary pa_dict Dictionary pa_dict


@ a a~ e E e~ E~ i @ a a~ e E e~ E~ i
I i: i~ I~ o O o: O~
o~ r- U u u~ U~ V V~
I i~ I~ o O O~ o~ r-
U u u~ U~ V V~


: ; b bh c ch d d. : ; b bh c ch d d.
dh dh. f g gh H j J dh dh. f g gh H j J
Jh k kh l l. m n N Jh k kh l l. m n N
n. n^ p ph Q R s S n. n^ p ph Q R s S
t t. th th. v x z t t. th th. v x z


Dictionary prs_dict

@ A i o

b d h l t X

+ 4
- 3
dictsource/en_list View File



// numeric // numeric


_0 zero $text // TEST
//_0 z'i@roU
//_0 zero $text // TEST
_0 z'i@roU
_1 w'0n _1 w'0n
?6 _1 w'Vn ?6 _1 w'Vn
_2 t'u: _2 t'u:
ogre oUg3 ogre oUg3
okay oUk'eI okay oUk'eI
oled oUlEd // abbrev oled oUlEd // abbrev
omeg oUm'eIg@
omega oUm'eIg@
omelet 0ml@t omelet 0ml@t
omelette 0ml@t omelette 0ml@t
omnibus $1 omnibus $1
omniscience 0mn'IsI@ns omniscience 0mn'IsI@ns
opaque oUp'eIk opaque oUp'eIk
oped 0p'Ed
opine oUp'aIn opine oUp'aIn
opossum @p0s@m opossum @p0s@m
opponent @poUn@nt opponent @poUn@nt

+ 3
- 1
dictsource/fr_list View File



// 2006-11-18 Gilles Casse <[email protected]> // 2006-11-18 Gilles Casse <[email protected]>
// //
// Updated 2009-09-28 Michel Such <[email protected]>
// Updated 2009-10-09 Michel Such <[email protected]>
// //
// * Numbers, a few abbreviations and exceptions. // * Numbers, a few abbreviations and exceptions.
// //
afrikaans afrikans afrikaans afrikans
bahamas baamas bahamas baamas
bangladesh bA~gladES bangladesh bA~gladES
bayeux bajY
bélarus belarys bélarus belarys
belize beliz belize beliz
bissau bisa'o bissau bisa'o
(burkina faso) byrkina||faso (burkina faso) byrkina||faso
burundi burundi burundi burundi
calvados calvadoss $text
croatie kroasi croatie kroasi
esperanto E2sperA~to esperanto E2sperA~to
groenland groEnlA~d groenland groEnlA~d

+ 3
- 1
dictsource/fr_rules View File



// 2006-11-18 Gilles Casse <[email protected]> // 2006-11-18 Gilles Casse <[email protected]>
// //
// Updated: 2009-09-25 Michel Such <[email protected]>
// Updated: 2009-10-09 Michel Such <[email protected]>
// //


// Letter classes: // Letter classes:
ol) en (t_ A~ // somnolent, violent ol) en (t_ A~ // somnolent, violent
Vol) en (t_ // somnolent, violent Vol) en (t_ // somnolent, violent
Xol) ent (_ t2 // volent Xol) ent (_ t2 // volent
eul) ent (_ t2 // veulent
ul) en (t_ A~ // turbulent ul) en (t_ A~ // turbulent
Vul) en (t_ Vul) en (t_
imCoC) en (t_ A~ // impotent imCoC) en (t_ A~ // impotent


_) n (_° nymero _) n (_° nymero
_) neuro (@@P5 nYro _) neuro (@@P5 nYro
_) nvda (P4 Envedea




.group o .group o

+ 4
- 1
dictsource/hu_list View File

_0Z2 sa:zAd // hundredths _0Z2 sa:zAd // hundredths
_0Z3 EzR2Ed _0Z3 EzR2Ed
_0Z4 ti:zEzR2Ed _0Z4 ti:zEzR2Ed

_0Z5 sa:zEzR2Ed
_0Z6 miliomod


// ordinal numbers // ordinal numbers


október $alt október $alt
november $alt november $alt
december $alt december $alt


//The following 12 row contains shorter hungarian month names //The following 12 row contains shorter hungarian month names
jan $alt jan $alt
feb $alt feb $alt

+ 40
- 2
dictsource/hu_rules View File



.group á .group á
á a: á a:

@) ában (_S4 a:bAn
@) ának (_S4 a:nAk




.group b .group b
b b b b
bb b: bb b:
@) ban (_S3 bAn
@) ben (_S3 bEn


biz (A b'iz, // bizalmas etc. biz (A b'iz, // bizalmas etc.
biedermeier bi:dER2ma:jER2 biedermeier bi:dER2ma:jER2
dd d: dd d:
dts tS: dts tS:
dt t: dt t:
apró) d (sz d
a) dsz ts: a) dsz ts:
beszé) d (szin d
cselé) d d cselé) d d
enge) dsz ts: enge) dsz ts:
engedelmeske) dsz ts: engedelmeske) dsz ts:
fogó) dz (kod ts
hazu) dsz ts: hazu) dsz ts:
ha) d (járat d
hor) d (szék d
mara) dsz ts: mara) dsz ts:
tu) dsz ts: tu) dsz ts:
kére) dz ts kére) dz ts
mentegető) dz z
// dd d: // dd d:
dz dz dz dz
A) dz (A d:z A) dz (A d:z


.group e .group e
e E e E

D_-_) es (_ %ES D_-_) es (_ %ES
_) egyezség _!'EJ:ESSe:g _) egyezség _!'EJ:ESSe:g
.group é .group é
é e: é e:
éi (é e::i: éi (é e::i:
@) ében (_S4 e:bEn
@) ének (_S4 e:nEk


.group ë .group ë
ë Y ë Y
C) gyj J C) gyj J
A) gyj (A J: A) gyj (A J:
ha) gyj J: ha) gyj J:
_e) gy (es J:
e) gy (jelentésű J
_e) gy (es J:
_e) gy (et_ J: _e) gy (et_ J:
_e) gy (etlen J: _e) gy (etlen J:
_e) gy (ik J: _e) gy (ik J:
_e) gy (üt J: _e) gy (üt J:
e) gyj (elentésű Jj
gyön) gy (sor J
_minde) gy (ik J: _minde) gy (ik J:


na) gysz (a Js na) gysz (a Js


.group i .group i
i i i i
@) i (_S1 i

_) itthon ithon _) itthon ithon


.group í .group í
í i: í i:
íts i:tS: íts i:tS:
fesz) ítsd i:tSd
bizony) ítsd i:tSd


.group j .group j
j j j j
@) jában (_S5 ja:bAn
@) jának (_S5 ja:nAk

_) javíts jAvi:tS: _) javíts jAvi:tS:
_) javítsd jAvi:tSd _) javítsd jAvi:tSd



.group k .group k
k k k k
kk k: kk k:
föld) s (ánc S föld) s (ánc S
s (színű S s (színű S
hel) s (inki z hel) s (inki z

ki) s (ebb SS ki) s (ebb SS
_má) s (szó S _má) s (szó S
_munká) s S _munká) s S
tty c: tty c:
apá) ts (ág tS: apá) ts (ág tS:
becsüle) t t becsüle) t t
csalódo) tts (ág tS:
cson) t t cson) t t
cson) tj c cson) tj c
ezüs) t t ezüs) t t
éle) t t éle) t t


felej) ts tS felej) ts tS

gyapo) t t

gráni) t t

já) tsz (ani ts: já) tsz (ani ts:
tsz ts: tsz ts:
szorí) ts (a tS: szorí) ts (a tS:
á) t (sző t á) t (sző t
á) t (szú t á) t (szú t
á) t (szű t á) t (szű t
á) t (jut t
á) t (jö t
bizo) tts (ág tS: bizo) tts (ág tS:
állí) ts tS: állí) ts tS:
állapo) t (sor t állapo) t (sor t
köve) ts (ég tS: köve) ts (ég tS:
kür) t t kür) t t
kür) tj c kür) tj c
küldö) ttj c:
korlátozo) tts tS: korlátozo) tts tS:
neve) ts (ég tS: neve) ts (ég tS:
on) ts (u tS on) ts (u tS
o) tt t:
szen)t (szék t szen)t (szék t
szé) t t szé) t t
szöve) ts (ég tS: szöve) ts (ég tS:
söté) ts (ég tS:
sajá) ts (ág tS:

pillan) ts tS pillan) ts tS
romlo) tts tS: romlo) tts tS:
tar) ts tS tar) ts tS
e) z (t s e) z (t s
ho) z (ta s ho) z (ta s
ho) z (tá s ho) z (tá s
helye) z (ked s
inté) z (ked s inté) z (ked s
költö) z (köd s költö) z (köd s



+ 68
- 2
dictsource/ta_list View File

//_xx விழுக்காடு $text // TESTING doesn't reduce vowels


// This file is UTF8 encoded // This file is UTF8 encoded
// Spelling to phoneme words and exceptions for Tamil // Spelling to phoneme words and exceptions for Tamil


_0M5 a:jirVma:jirVmko:d.i // 10,000,000,000,000 _0M5 a:jirVma:jirVmko:d.i // 10,000,000,000,000
_1M5 a:jirVma:jirVmko:d.i _1M5 a:jirVma:jirVmko:d.i


_dpt _pul.l.i _dpt _pul.l.i


// exceptions
பாபு $alt // initial ப as [b]
பாலு $alt
பவானி $alt
பகவதி $alt
பானம் $alt
பாறம் $alt
பாரதி $alt
பாரதம் $alt
பரதம் $alt
பாப $alt
பாகம் $alt
பண்தம் $alt
பவனி $alt

தானம் $alt // initial த as [d]
தேகம் $alt
திரவியம் $alt
தூபம் $alt
தீபம் $alt
தீபாவளி $alt
தீரம் $alt
தைரியம் $alt
திடம் $alt
திரவம் $alt
திடீர் $alt
திவசம் $alt
தியானம் $alt
தானியம் $alt
தண்டனை $alt
துவம்சம் $alt
திருஷ்டி $alt
தயாநிதி $alt
தயாளு $alt
துக்கம் $alt
திகில் $alt
துந்துவி $alt
தயவு $alt
தடால் $alt
திக் $alt
தடக் $alt
தீக்ஷை $alt



கக $alt // initial க as [g]
கனம் $alt
கணம் $alt
கணபதி $alt
கணீர் $alt
கிலி $alt
கில்லி $alt
கோதுமை $alt
கோபுரம் $alt
காந்தம் $alt
காந்தி $alt
குண்டு $alt
கோலி $alt
குகை $alt
கிரி $alt
கோமதி $alt




பப pVpV

+ 44
- 1
dictsource/ta_rules View File

_) எ ;e // add a short [j] sound at start of word ? _) எ ;e // add a short [j] sound at start of word ?


ஏ e: ஏ e:
_) ஏ ;e:: // add a short [j] sound at start of word ?
_) ஏ ;e: // add a short [j] sound at start of word ?


ஐ aI ஐ aI


்) க (B g ்) க (B g
_) க kV _) க kV
_) க (B k _) க (B k
_) க (T gV // if word has $alt attribute in ta_list
_) க (BT g // $alt
க்க kkV க்க kkV
க்க (B kk க்க (B kk
_) க (ௌ g
க (ீத g
க (ஜ gV

_) க (ம்பீர gV
_) க (ந்தர்வ gV
_) க (ோவிந்த g


ங NV ங NV
ங (B N ங (B N



ச sV // ?? [z] ச sV // ?? [z]
ச (B s ச (B s
_) ச sa _) ச sa
ஞ்) ச dZV ஞ்) ச dZV
ஞ்) ச (B dZ ஞ்) ச (B dZ



ஜ dZV ஜ dZV
ஜ (B dZ ஜ (B dZ



ஞ n^V ஞ n^V
ஞ (B n^ ஞ (B n^



ட d.V ட d.V
ட (B d. ட (B d.
_) ட t.V _) ட t.V
ட்ட t.t.V ட்ட t.t.V
ட்ட (B t.t. ட்ட (B t.t.



ண n.V ண n.V
ண (B n. ண (B n.



த dV த dV
த (B d த (B d
_) த tV _) த tV
_) த (B t _) த (B t
_) த (T dV // if word has $alt attribute in ta_list
_) த (BT d // if word has $alt
த்த ttV த்த ttV
த்த (B tt த்த (B tt


// exceptions, த as [d]
_) த (ன dV
_) த (ர்ம dV
_) த (ுர் d
_) த (ூர d
_) த (ெய்வ d
_) த (ுஷ் d
_) த (க்ஷிணா dV

ந nV ந nV
ந (B n // dental n ந (B n // dental n



ன nV ன nV
ன (B n // alveolar n ன (B n // alveolar n



ப bV ப bV
ப (B b ப (B b
_) ப pV _) ப pV
_) ப (B p _) ப (B p
_) ப (T bV // if word has $alt attribute in ta_list
_) ப (BT b // if word has $alt
ப்ப ppV ப்ப ppV
ப்ப (B pp ப்ப (B pp
ட்) ப pV ட்) ப pV
ஃ) ப fV ஃ) ப fV
ஃ) ப (B f ஃ) ப (B f



ம mV ம mV
ம (B m ம (B m



ய jV ய jV
ய (B j ய (B j



ர rV ர rV
ர (B r ர (B r



ற RV ற RV
ற (B R ற (B R
ற் (ற t. // RR -> t.R ற் (ற t. // RR -> t.R



ல lV ல lV
ல (B l ல (B l



ள l.V ள l.V
ள (B l. ள (B l.



ழ z.V ழ z.V
ழ (B z. ழ (B z.



வ vV வ vV
வ (B v வ (B v



ஶ SV ஶ SV
ஶ (B S ஶ (B S



ஷ s.V ஷ s.V
ஷ (B s. ஷ (B s.



ஸ sV ஸ sV
ஸ (B s ஸ (B s



ஹ hV ஹ hV
ஹ (B h ஹ (B h



க்ஷ ks.V க்ஷ ks.V
க்ஷ (B ks. க்ஷ (B ks.



+ 16
- 9
phsource/compile_report View File

61 phoneme tables
62 phoneme tables
new total new total
base 104 104 base 104 104
base2 26 125 base2 26 125
eu 6 126 eu 6 126
mn 15 115 mn 15 115
pa 13 153 pa 13 153
prs 8 111


Data file Used by Data file Used by
b/b [b] base b/b [b] base
[k] base2 [k] base2
[k] en [k] en
[k] fi [k] fi
[k] fr
[kh] hi [kh] hi
[k] hu [k] hu
[k] lv [k] lv
vdiph/au [aU] en vdiph/au [aU] en
[aU] af [aU] af
[a:U] vi [a:U] vi
[aU] prs
vdiph/au# [aU] en_sc vdiph/au# [aU] en_sc
vdiph/au_2 [au] zhy vdiph/au_2 [au] zhy
vdiph/au_3 [aU] en_rp vdiph/au_3 [aU] en_rp
[EI] vi [EI] vi
[eI] hy [eI] hy
[eI] ne [eI] ne
[eI] prs
vdiph/eei_2 [eI] eo vdiph/eei_2 [eI] eo
[ei] fi [ei] fi
[ei] lv [ei] lv
[e~] hi [e~] hi
[e~] pt [e~] pt
[e~] bn [e~] bn
vnasal/ii_n [I~] hi
vnasal/i_n [i~] pt vnasal/i_n [i~] pt
[i~] bn [i~] bn
[i:~] bn [i:~] bn
vnasal/i_n2 [I~] hi
[i~] hi
vnasal/i_n2 [i~] hi
vnasal/m- [m-] sw vnasal/m- [m-] sw
vnasal/n- [n-] sw vnasal/n- [n-] sw
vnasal/nn- [N-] sw vnasal/nn- [N-] sw
[A] zh [A] zh
vowel/aa_3 [A:] af vowel/aa_3 [A:] af
[A] sq [A] sq
[A] prs
vowel/aa_4 [A:] sv vowel/aa_4 [A:] sv
[O] vi [O] vi
vowel/aa_5 [A:] en_n vowel/aa_5 [A:] en_n
[E2] id [E2] id
[e] hy [e] hy
[E] bn [E] bn
[E] prs
vowel/e_mid2 [E] af vowel/e_mid2 [E] af
[E] de [E] de
[E2] de [E2] de
[i:] kn [i:] kn
[i] ne [i] ne
[i] mn [i] mn
[i] prs
vowel/i# [y:] cy vowel/i# [y:] cy
vowel/i_2 [i2] de vowel/i_2 [i2] de
[i:] de [i:] de
[oU] en_n [oU] en_n
[oU] en_wi [oU] en_wi
[o:] de [o:] de
[o2] fr
[o] hi [o] hi
[o] ta [o] ta
[o] it [o] it
[o] bn [o] bn
[o] mr [o] mr
[o:] mn [o:] mn
[o:] pa
vowel/o_2 [o:] cy vowel/o_2 [o:] cy
[o2] fr
[o:] hi [o:] hi
[o:] hu [o:] hu
[o:] la [o:] la
[o] vi [o] vi
[o] da [o] da
[o:] bn [o:] bn
[o:] pa
vowel/o-_2 [V] en_n vowel/o-_2 [V] en_n
[V] en_wm [V] en_wm
vowel/o_3 [oU] en_sc vowel/o_3 [oU] en_sc
[o] fr
[o:] ta [o:] ta
vowel/o-_3 [U] en_rp vowel/o-_3 [U] en_rp
vowel/o-_4 [o] ro vowel/o-_4 [o] ro
[O] da [O] da
vowel/o_6 [O:] nl vowel/o_6 [O:] nl
vowel/o_7 [o] ku vowel/o_7 [o] ku
vowel/o_8 [o] fr
vowel/oe [W] en vowel/oe [W] en
[W] af [W] af
[W] de [W] de
[o] zhy [o] zhy
[O] tr [O] tr
[O] id [O] id
[o] prs
vowel/oo_1 [O:] en_n vowel/oo_1 [O:] en_n
[O:] en_rp [O:] en_rp
[O@] en_rp [O@] en_rp
[u] kn [u] kn
[u:] kn [u:] kn
[u] bn [u] bn
[u] prs
vowel/u# [u:] en_sc vowel/u# [u:] en_sc
[Y] tr [Y] tr
vowel/u_2 [u1] fi vowel/u_2 [u1] fi
vwl_en_us/or [o@] en_us vwl_en_us/or [o@] en_us
[O:] en_sc [O:] en_sc
vwl_en_us/ur [U@] en_us vwl_en_us/ur [U@] en_us
vwl_fr/r [R] fr
[r] fr
vwl_fr/r [r] fr
[r2] fr [r2] fr
vwl_fr/_r [R] fr vwl_fr/_r [R] fr
[r] fr [r] fr
[E~] fr [E~] fr
[W~] fr [W~] fr
vwl_fr/@R [x] pt_pt vwl_fr/@R [x] pt_pt
vwl_fr/_r2 [R] fr
vwl_fr/@R2 [R] fr_ca vwl_fr/@R2 [R] fr_ca
vwl_fr/@R3 [Q2] hy vwl_fr/@R3 [Q2] hy
vwl_fr/@R4 [Q2] hy vwl_fr/@R4 [Q2] hy

+ 11
- 11
phsource/ph_french View File

//==================================================== //====================================================
// French // French
//==================================================== //====================================================
// Updated 2009-09-30 Michel Such <[email protected]>
// Updated 2009-10-07 Michel Such <[email protected]>


phoneme (l) virtual phoneme (l) virtual
// Used for l and l/ // Used for l and l/


phoneme i- // shorter phoneme i- // shorter
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 130
length 110
formants vowel/i_2 formants vowel/i_2
after (l) l/li-15 after (l) l/li-15
after (r) vwl_fr/ri after (r) vwl_fr/ri
phoneme o phoneme o
vowel starttype (o) endtype (o) vowel starttype (o) endtype (o)
length 170 length 170
formants vowel/o_3
formants vowel/o_8
after (l) l/lo-10 after (l) l/lo-10
after (r) vwl_fr/ro after (r) vwl_fr/ro
before l/ DFT+l/l_o before l/ DFT+l/l_o
phoneme o2 phoneme o2
vowel starttype (o) endtype (o) vowel starttype (o) endtype (o)
length 170 length 170
formants vowel/o_2
formants vowel/o
after (l) l/lo-10 after (l) l/lo-10
after (r) vwl_fr/ro after (r) vwl_fr/ro
before l/ vowel/o_mid2+l/l_o before l/ vowel/o_mid2+l/l_o


phoneme wA phoneme wA
vowel starttype (o) endtype (a) vowel starttype (o) endtype (a)
length 230
length 220
formants vwl_fr/w_a formants vwl_fr/w_a
after (l) l/lo-10 after (l) l/lo-10
after (r) vwl_fr/ro-15
after (r) vwl_fr/ro
before l/ DFT-10+l/l_a before l/ DFT-10+l/l_a
before j DFT before j DFT
before (r) DFT+vwl_fr/xr before (r) DFT+vwl_fr/xr
lengthmod 2 lengthmod 2
wave ustop/k%40 // reduce strength of noise burst wave ustop/k%40 // reduce strength of noise burst
before _ ustop/k_ before _ ustop/k_
before (r) ustop/kr%45
before (r) ustop/k%50
before r/2 ustop/k%60 before r/2 ustop/k%60
before (l) ustop/kl%45 before (l) ustop/kl%45
before (i) ustop/ki%45 before (i) ustop/ki%45


phoneme r // between vowels in a word phoneme r // between vowels in a word
liquid uvl starttype (r) endtype (r) liquid uvl starttype (r) endtype (r)
vowelin f1=0 f2=1600 -300 300 f3=-200 80
vowelin f1=0 f2=1600 -300 300 f3=-200 80 len=20
vowelout f1=2 f2=1600 -300 300 f3=-300 80 vowelout f1=2 f2=1600 -300 300 f3=-300 80
length 100 length 100
lengthmod 7 lengthmod 7


phoneme R // First letter of a word phoneme R // First letter of a word
liquid uvl starttype (r) endtype (r) liquid uvl starttype (r) endtype (r)
vowelin f1=0 f2=1600 -300 300 f3=-200 80
vowelin f1=0 f2=1600 -300 300 f3=-200 80 len=20
vowelout f1=2 f2=1600 -300 300 f3=-300 80 vowelout f1=2 f2=1600 -300 300 f3=-300 80
length 100 length 100
lengthmod 0 lengthmod 0
beforenotvowel r/2 beforenotvowel r/2
formants vwl_fr/r
formants vwl_fr/_r2
after _ vwl_fr/_r after _ vwl_fr/_r
after (a) vwl_fr/_r after (a) vwl_fr/_r
after (e) vwl_fr/_r after (e) vwl_fr/_r


phoneme r/2 // variant of [r] when not preceding a vowel phoneme r/2 // variant of [r] when not preceding a vowel
liquid uvl starttype r/2 endtype r/2 liquid uvl starttype r/2 endtype r/2
vowelout f1=2 f2=1600 -300 300 f3=-300 80
vowelout f1=2 f2=1600 -300 300 f3=-300 100
length 100 length 100
lengthmod 2 lengthmod 2
formants vwl_fr/r_+r3/rx%25 formants vwl_fr/r_+r3/rx%25

+ 1
- 1
phsource/ph_hindi View File

phoneme I~ phoneme I~
vowel starttype (i) endtype (i) vowel starttype (i) endtype (i)
length 170 length 170
formants vnasal/i_n2
formants vnasal/ii_n
endphoneme endphoneme


phoneme e~ phoneme e~

+ 3
- 0
phsource/phonemes View File



phonemetable pa hi phonemetable pa hi
include ph_punjabi include ph_punjabi

phonemetable prs base
include ph_dari

BIN
phsource/vnasal/aa_n4 View File


BIN
phsource/vnasal/i_n2 View File


BIN
phsource/vnasal/ii_n View File


BIN
phsource/vowel/V_6 View File


BIN
phsource/vwl_fr/w_a View File


+ 1
- 4
src/compiledict.cpp View File

unsigned char bad_phoneme[4]; unsigned char bad_phoneme[4];
static char nullstring[] = {0}; static char nullstring[] = {0};


WORD_TAB winfo;

comment = NULL; comment = NULL;
text_not_phonemes = 0; text_not_phonemes = 0;
phonetic = word = nullstring; phonetic = word = nullstring;
if(word[0] == '_') if(word[0] == '_')
{ {
// This is a special word, used by eSpeak. Translate this into phonemes now // This is a special word, used by eSpeak. Translate this into phonemes now
memset(&winfo,0,sizeof(winfo));
strcat(phonetic, " "); // need a space to indicate word-boundary strcat(phonetic, " "); // need a space to indicate word-boundary


// PROBLEM vowel reductions are not applied to the translated phonemes // PROBLEM vowel reductions are not applied to the translated phonemes
// condition rules are not applied // condition rules are not applied
TranslateWord(translator,phonetic,0,&winfo);
TranslateWord(translator,phonetic,0,NULL);
text_not_phonemes = 0; text_not_phonemes = 0;
strncpy0(encoded_ph, word_phonemes, N_WORD_BYTES-4); strncpy0(encoded_ph, word_phonemes, N_WORD_BYTES-4);



+ 6
- 3
src/dictionary.cpp View File

sprintf(fname,"%s%c%s_dict",path_home,PATHSEP,name); sprintf(fname,"%s%c%s_dict",path_home,PATHSEP,name);
size = GetFileLength(fname); size = GetFileLength(fname);


if(tr->data_dictlist != NULL)
{
Free(tr->data_dictlist);
tr->data_dictlist = NULL;
}

f = fopen(fname,"rb"); f = fopen(fname,"rb");
if((f == NULL) || (size <= 0)) if((f == NULL) || (size <= 0))
{ {
return(1); return(1);
} }


if(tr->data_dictlist != NULL)
Free(tr->data_dictlist);

tr->data_dictlist = Alloc(size); tr->data_dictlist = Alloc(size);
fread(tr->data_dictlist,size,1,f); fread(tr->data_dictlist,size,1,f);
fclose(f); fclose(f);

+ 4
- 11
src/extras.cpp View File

char phonemes[80]; char phonemes[80];
char phonemes2[80]; char phonemes2[80];
char buf_out[120]; char buf_out[120];
WORD_TAB winfo;
static const char *vowels1 = "aeiou"; static const char *vowels1 = "aeiou";
static const char *vowels2 = "aeou"; static const char *vowels2 = "aeou";


} }
} }
// translate // translate
memset(&winfo,0,sizeof(winfo));
TranslateWord(translator,&word1[1],0,&winfo);
TranslateWord(translator,&word1[1],0, NULL);
DecodePhonemes(word_phonemes,phonemes); DecodePhonemes(word_phonemes,phonemes);


stress_posn1 = 0; stress_posn1 = 0;
vowel_ix++; vowel_ix++;
} }


memset(&winfo,0,sizeof(winfo));
TranslateWord(translator,&word2[1],0,&winfo);
TranslateWord(translator,&word2[1],0, NULL);
DecodePhonemes(word_phonemes,phonemes2); DecodePhonemes(word_phonemes,phonemes2);


vowel_ix = 1; vowel_ix = 1;
char pronounce2[80]; char pronounce2[80];
char phonemes[80]; char phonemes[80];
char phonemes2[80]; char phonemes2[80];
WORD_TAB winfo;


static const char *vowels = "aeiouyAEIOUY29@"; static const char *vowels = "aeiouyAEIOUY29@";


} }


// translate // translate
memset(&winfo,0,sizeof(winfo));
TranslateWord(translator,&word2[1],0,&winfo);
TranslateWord(translator,&word2[1],0, NULL);


DecodePhonemes2(word_phonemes,phonemes); // also need to change some phoneme names DecodePhonemes2(word_phonemes,phonemes); // also need to change some phoneme names


int wlen; int wlen;
int len; int len;
int check_root; int check_root;
WORD_TAB winfo;


char word[80]; char word[80];
char word2[80]; char word2[80];
} }


// translate // translate
memset(&winfo,0,sizeof(winfo));
TranslateWord(translator, &word2[1],0,&winfo);
TranslateWord(translator, &word2[1],0, NULL);
DecodePhonemes(word_phonemes,phonemes); DecodePhonemes(word_phonemes,phonemes);


// find the stress position in the translation // find the stress position in the translation

+ 13
- 18
src/numbers.cpp View File

char ph_buf2[50]; char ph_buf2[50];
char suffix[20]; char suffix[20];
char *wordptr; char *wordptr;
unsigned int dictflags[2];
unsigned int dictflags;


static const char str_pause[2] = {phonPAUSE_NOLINK,0}; static const char str_pause[2] = {phonPAUSE_NOLINK,0};


// but not if the next word starts with an upper-case letter // but not if the next word starts with an upper-case letter
ordinal = 2; ordinal = 2;
word[ix] = ' '; word[ix] = ' ';

if(tr->translator_name == L('h','u')) if(tr->translator_name == L('h','u'))
{ {
// lang=hu don't treat dot as ordinal indicator if the next word is a month name ($alt) // lang=hu don't treat dot as ordinal indicator if the next word is a month name ($alt)
dictflags[0] = 0;
wordptr = &word[ix+2]; wordptr = &word[ix+2];
LookupDictList(tr, &wordptr, ph_buf, dictflags, 0, NULL);
if(dictflags[0] & FLAG_ALT_TRANS) // TEST
dictflags = TranslateWord(tr, &word[ix+2], 0, NULL);
if(dictflags & FLAG_ALT_TRANS)
ordinal = 0; ordinal = 0;
} }
} }
} }
break; break;


case NUM_DFRACTION_1: // italian, say "hundredths" is leading zero
case NUM_DFRACTION_1: // italian, say "hundredths" if leading zero
case NUM_DFRACTION_5: // hungarian, always say "tenths" etc. case NUM_DFRACTION_5: // hungarian, always say "tenths" etc.
if(decimal_count <= 4)
LookupNum3(tr, atoi(&word[n_digits]), ph_buf, 0,0,0);
if((word[n_digits]=='0') || (decimal_mode == NUM_DFRACTION_5))
{ {
LookupNum3(tr, atoi(&word[n_digits]), ph_buf, 0,0,0);
if((word[n_digits]=='0') || (decimal_mode == 0xa000))
{
// decimal part has leading zeros, so add a "hundredths" or "thousandths" suffix
sprintf(string,"_0Z%d",decimal_count);
if(Lookup(tr, string, buf1) == 0)
break; // revert to speaking single digits
// decimal part has leading zeros, so add a "hundredths" or "thousandths" suffix
sprintf(string,"_0Z%d",decimal_count);
if(Lookup(tr, string, buf1) == 0)
break; // revert to speaking single digits


strcat(ph_buf,buf1);
}
strcat(ph_out,ph_buf);
n_digits += decimal_count;
strcat(ph_buf,buf1);
} }
strcat(ph_out,ph_buf);
n_digits += decimal_count;
break; break;


case NUM_DFRACTION_3: case NUM_DFRACTION_3:

+ 106
- 55
src/readclause.cpp View File







static int AnnouncePunctuation(Translator *tr, int c1, int c2, char *buf, int bufix)
{//=================================================================================
static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output, int *bufix, int end_clause)
{//==========================================================================================================
// announce punctuation names // announce punctuation names
// c1: the punctuation character // c1: the punctuation character
// c2: the following character // c2: the following character
const char *punctname; const char *punctname;
int found = 0; int found = 0;
int soundicon; int soundicon;
char *p;
int c2;
int len;
int bufix1;
char buf[200];
char buf2[80];

c2 = *c2_ptr;
buf[0] = 0;


if((soundicon = LookupSoundicon(c1)) >= 0) if((soundicon = LookupSoundicon(c1)) >= 0)
{ {
// add an embedded command to play the soundicon // add an embedded command to play the soundicon
sprintf(&buf[bufix],"\001%dI ",soundicon);
sprintf(buf,"\001%dI ",soundicon);
UngetC(c2); UngetC(c2);
found = 1; found = 1;
} }
if((punctname = LookupCharName(tr, c1)) != NULL) if((punctname = LookupCharName(tr, c1)) != NULL)
{ {
found = 1; found = 1;
if(bufix==0)
if((*bufix==0) || (end_clause==0))
{ {
punct_count=1; punct_count=1;
while(c2 == c1) while(c2 == c1)
punct_count++; punct_count++;
c2 = GetC(); c2 = GetC();
} }
UngetC(c2);
*c2_ptr = c2;
if(end_clause)
{
UngetC(c2);
}


p = &buf[bufix];
if(punct_count==1) if(punct_count==1)
{ {
sprintf(p,"%s %s %s",tone_punct_on,punctname,tone_punct_off);
sprintf(buf,"%s %s %s",tone_punct_on,punctname,tone_punct_off);
} }
else else
if(punct_count < 4) if(punct_count < 4)
{ {
sprintf(p,"\001+10S%s",tone_punct_on);
sprintf(buf,"\001+10S%s",tone_punct_on);
while(punct_count-- > 0) while(punct_count-- > 0)
sprintf(buf,"%s %s",buf,punctname);
sprintf(p,"%s %s\001-10S",buf,tone_punct_off);
{
sprintf(buf2," %s",punctname);
strcat(buf, buf2);
}
sprintf(buf2," %s\001-10S",tone_punct_off);
strcat(buf, buf2);
} }
else else
{ {
sprintf(p,"%s %s %d %s %s",
sprintf(buf,"%s %s %d %s %s",
tone_punct_on,punctname,punct_count,punctname,tone_punct_off); tone_punct_on,punctname,punct_count,punctname,tone_punct_off);
return(CLAUSE_COMMA);
} }
} }
else else
ssml_ignore_l_angle = c1; // this was &lt; which was converted to <, don't pick it up again as < ssml_ignore_l_angle = c1; // this was &lt; which was converted to <, don't pick it up again as <
} }
ungot_char2 = c1; ungot_char2 = c1;
buf[bufix] = ' ';
buf[bufix+1] = 0;
buf[0] = ' ';
buf[1] = 0;
} }
} }


if(found == 0) if(found == 0)
return(-1); return(-1);


bufix1 = *bufix;
len = strlen(buf);
strcpy(&output[*bufix],buf);
*bufix += len;

if(end_clause==0)
return(-1);

if(c1 == '-') if(c1 == '-')
return(CLAUSE_NONE); // no pause return(CLAUSE_NONE); // no pause
if(bufix > 0)
if(bufix1 > 0)
return(CLAUSE_SHORTCOMMA); return(CLAUSE_SHORTCOMMA);
if((strchr_w(punct_close,c1) != NULL) && !iswalnum(c2)) if((strchr_w(punct_close,c1) != NULL) && !iswalnum(c2))
return(CLAUSE_SHORTFALL+4); return(CLAUSE_SHORTFALL+4);
int any_alnum = 0; int any_alnum = 0;
int self_closing; int self_closing;
int punct_data; int punct_data;
int is_punctuation;
int save_c2;
int is_end_clause;
int announced_punctuation;
int stressed_word = 0; int stressed_word = 0;
const char *p; const char *p;
wchar_t xml_buf[N_XML_BUF+1]; wchar_t xml_buf[N_XML_BUF+1];
linelength = 0; linelength = 0;
} }


if(option_punctuation && (phoneme_mode==0) && (sayas_mode==0) && iswpunct(c1))
{
// option is set to explicitly speak punctuation characters
// if a list of allowed punctuation has been set up, check whether the character is in it
if((option_punctuation == 1) || (wcschr(option_punctlist,c1) != NULL))
{
if((terminator = AnnouncePunctuation(tr, c1, c2, buf, ix)) >= 0)
return(terminator);
}
}
announced_punctuation = 0;


if((phoneme_mode==0) && (sayas_mode==0) && ((punct = lookupwchar(punct_chars,c1)) != 0))
if((phoneme_mode==0) && (sayas_mode==0))
{ {
punct_data = punct_attributes[punct];
is_end_clause = 0;


if(punct_data & PUNCT_IN_WORD)
if((punct = lookupwchar(punct_chars,c1)) != 0)
{ {
// Armenian punctuation inside a word
stressed_word = 1;
*tone_type = punct_data >> 12 & 0xf; // override the end-of-sentence type
continue;
punct_data = punct_attributes[punct];
if(punct_data & PUNCT_IN_WORD)
{
// Armenian punctuation inside a word
stressed_word = 1;
*tone_type = punct_data >> 12 & 0xf; // override the end-of-sentence type
continue;
}

if((iswspace(c2) || (punct_data & 0x8000) || IsBracket(c2) || (c2=='?') || (c2=='-') || Eof()))
{
// note: (c2='?') is for when a smart-quote has been replaced by '?'
is_end_clause = 1;
}
} }


if((iswspace(c2) || (punct_data & 0x8000) || IsBracket(c2) || (c2=='?') || (c2=='-') || Eof()))
if(option_punctuation && iswpunct(c1))
{ {
// note: (c2='?') is for when a smart-quote has been replaced by '?'

is_punctuation = 1;
// option is set to explicitly speak punctuation characters
// if a list of allowed punctuation has been set up, check whether the character is in it
if((option_punctuation == 1) || (wcschr(option_punctlist,c1) != NULL))
{
if((terminator = AnnouncePunctuation(tr, c1, &c2, buf, &ix, is_end_clause)) >= 0)
return(terminator);
announced_punctuation = c1;
}
}


if(is_end_clause)
{
int c_next;
if((c1 == '.') && (cprev == '.')) if((c1 == '.') && (cprev == '.'))
{ {
c1 = 0x2026; c1 = 0x2026;
} }
nl_count = 0; nl_count = 0;
save_c2 = c2;
c_next = c2;


if(iswspace(c2))
if(iswspace(c_next))
{ {
while(!Eof() && iswspace(c2))
while(!Eof() && iswspace(c_next))
{ {
if(c2 == '\n')
if(c_next == '\n')
nl_count++; nl_count++;
c2 = GetC(); // skip past space(s)
}
if(!Eof())
{
UngetC(c2);
c_next = GetC(); // skip past space(s)
} }
} }


if((nl_count==0) && (c1 == '.')) if((nl_count==0) && (c1 == '.'))
{ {
// if(iswdigit(cprev) && (tr->langopts.numbers & NUM_ORDINAL_DOT) && islower(c2))
if(iswdigit(cprev) && (tr->langopts.numbers & NUM_ORDINAL_DOT)) if(iswdigit(cprev) && (tr->langopts.numbers & NUM_ORDINAL_DOT))
{ {
// dot after a number indicates an ordinal number // dot after a number indicates an ordinal number
is_punctuation = 0;
if(islower(c_next) || (c_next == '<'))
is_end_clause = 0; // only if followed by lower-case, (or if there is a XML tag)
} }
else else
if(iswlower(c2))
if(iswlower(c_next))
{ {
// next word has no capital letter, this dot is probably from an abbreviation // next word has no capital letter, this dot is probably from an abbreviation
c1 = ' '; c1 = ' ';
is_punctuation = 0;
is_end_clause = 0;
} }
if(any_alnum==0) if(any_alnum==0)
{ {
c1 = ' '; // no letters or digits yet, so probably not a sentence terminator c1 = ' '; // no letters or digits yet, so probably not a sentence terminator
is_punctuation = 0;
is_end_clause = 0;
} }
} }
c2 = save_c2;


if(is_punctuation)
if(is_end_clause)
{ {
UngetC(c_next);
buf[ix] = ' '; buf[ix] = ' ';
buf[ix+1] = 0; buf[ix+1] = 0;
} }
return(punct_data); // only recognise punctuation if followed by a blank or bracket/quote return(punct_data); // only recognise punctuation if followed by a blank or bracket/quote
} }
else
{
if(!Eof())
{
if(iswspace(c2))
UngetC(c_next);
}
}
} }
} }


if(speech_parameters[espeakSILENCE]==1) if(speech_parameters[espeakSILENCE]==1)
continue; continue;


if(c1 == announced_punctuation)
{
// const unsigned short keep_punctuation[] = {
// '\'', '-', 0x92, 0xb4, 0x2019, 0x2032, 0 };

// This character has already been announced, so delete it so that it isn't spoken a second time.
// Unless it's a hyphen or apostrophe (which is used by TranslateClause() )
if(!IsBracket(c1))
{
c1 = ' ';
}
}

j = ix+1; j = ix+1;
ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1; ix += utf8_out(c1,&buf[ix]); // buf[ix++] = c1;
if(!iswspace(c1) && !IsBracket(c1)) if(!iswspace(c1) && !IsBracket(c1))

+ 1
- 1
src/synthdata.cpp View File

#include "translate.h" #include "translate.h"
#include "wave.h" #include "wave.h"


const char *version_string = "1.41.13 10.Oct.09";
const char *version_string = "1.41.15 12.Oct.09";
const int version_phdata = 0x014100; const int version_phdata = 0x014100;


int option_device_number = -1; int option_device_number = -1;

+ 1
- 1
src/synthesize.cpp View File

// fprintf(stderr,"FMT%d %3s %3d-%3d f1=%d f2=%4d %4d %4d f3=%4d %3d\n", // fprintf(stderr,"FMT%d %3s %3d-%3d f1=%d f2=%4d %4d %4d f3=%4d %3d\n",
// which,WordToString(other_ph->mnemonic),len,rms,f1,f2,f2_min,f2_max,f3_adj,f3_amp); // which,WordToString(other_ph->mnemonic),len,rms,f1,f2,f2_min,f2_max,f3_adj,f3_amp);


if(other_ph->mnemonic == '?')
if((other_ph != NULL) && (other_ph->mnemonic == '?'))
flags |= 8; flags |= 8;


if(which == 1) if(which == 1)

+ 7
- 0
src/tr_languages.cpp View File

break; break;




case L('f','a'): // Farsi
{
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
}
break;


case L('f','i'): // Finnish case L('f','i'): // Finnish
{ {
static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 }; static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 };

+ 19
- 2
src/translate.cpp View File

int spell_word; int spell_word;
int stress_bits; int stress_bits;
int emphasize_allcaps = 0; int emphasize_allcaps = 0;
int wflags = wtab->flags;
int wmark = wtab->wmark;
int wflags;
int wmark;
WORD_TAB wtab_null[8];


// translate these to get pronunciations of plural 's' suffix (different forms depending on // translate these to get pronunciations of plural 's' suffix (different forms depending on
// the preceding letter // the preceding letter
static char word_iz[4] = {0,'i','z',0}; static char word_iz[4] = {0,'i','z',0};
static char word_ss[4] = {0,'s','s',0}; static char word_ss[4] = {0,'s','s',0};


if(wtab == NULL)
{
memset(wtab_null, 0, sizeof(wtab_null));
wtab = wtab_null;
}
wflags = wtab->flags;
wmark = wtab->wmark;

dictionary_flags[0] = 0; dictionary_flags[0] = 0;
dictionary_flags[1] = 0; dictionary_flags[1] = 0;
dictionary_flags2[0] = 0; dictionary_flags2[0] = 0;
end_phonemes[0] = 0; end_phonemes[0] = 0;
ph_limit = &phonemes[N_WORD_PHONEMES]; ph_limit = &phonemes[N_WORD_PHONEMES];


if(tr->data_dictlist == NULL)
{
// dictionary is not loaded
word_phonemes[0] = 0;
return(0);
}

// count the length of the word // count the length of the word
if(*word1 == ' ') word1++; // possibly a dot was replaced by space: $dot if(*word1 == ' ') word1++; // possibly a dot was replaced by space: $dot
wordx = word1; wordx = word1;
AppendPhonemes(tr,phonemes, N_WORD_PHONEMES, end_phonemes); AppendPhonemes(tr,phonemes, N_WORD_PHONEMES, end_phonemes);
end_phonemes[0] = 0; end_phonemes[0] = 0;
} }
memcpy(wordx,word_copy,strlen(word_copy));
} }
wordx[-1] = c_temp; wordx[-1] = c_temp;
} }

+ 1
- 1
src/translate.h View File

#define FLAG_DONT_SWITCH_TRANSLATOR 0x1000 #define FLAG_DONT_SWITCH_TRANSLATOR 0x1000
#define FLAG_SUFFIX_REMOVED 0x2000 #define FLAG_SUFFIX_REMOVED 0x2000
#define FLAG_HYPHEN_AFTER 0x4000 #define FLAG_HYPHEN_AFTER 0x4000
#define FLAG_ORDINAL 0x8000 // passed to TranslateNumber() to indicate an ordinal number


#define FLAG_NO_TRACE 0x10000 // passed to TranslateRules() to suppress dictionary lookup printout #define FLAG_NO_TRACE 0x10000 // passed to TranslateRules() to suppress dictionary lookup printout
#define FLAG_NO_PREFIX 0x20000 #define FLAG_NO_PREFIX 0x20000
#define FLAG_ORDINAL 0x40000 // passed to TranslateNumber() to indicate an ordinal number


// prefix/suffix flags (bits 8 to 14, bits 16 to 22) don't use 0x8000, 0x800000 // prefix/suffix flags (bits 8 to 14, bits 16 to 22) don't use 0x8000, 0x800000
#define SUFX_E 0x0100 // e may have been added #define SUFX_E 0x0100 // e may have been added

Loading…
Cancel
Save