Browse Source

[1.30.03] lang=sv: update dictionary.

lang=jbo (lojban): initial draft.
Linux: look for env variable ESPEAK_DATA_PATH


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@117 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 17 years ago
parent
commit
5634dd1891

+ 17
- 7
dictsource/dict_phonemes View File

@@ -225,10 +225,9 @@ Dictionary sv_dict
I i: O o: U u- u: W
y y: Y:

: ; b B d f g h
j k l m n N p R
s S s. S; sx t v w
z
: ; b d f g h j
k l m n N p R s
S s. S; sx t v w z


Dictionary sw_dict
@@ -253,9 +252,10 @@ s t t[ ts; v w z

Dictionary zhy_dict

a aa aai aan aau ai au e
ei eo eoi eu i iu o oe
oi ong ou u ui yu
a aa aai aan aau ai ang au
e ei eng eo eoi eu i ing
iu ng o oe oen oi ong ou
u ui ung yu

b c d f g h j k
l m n N p r s t
@@ -348,6 +348,16 @@ S; t th ts ts. ts. tS; tS;
tsh v w x z z.


Dictionary jbo_dict

@ a aI aU e eI i l-
o OI r- u

b d dZ f g h j k
l m n N p R s S
t tS v w x z Z


Dictionary hbs_dict

& @ @2 a A a: aI aU

+ 86
- 0
dictsource/jbo_list View File

@@ -0,0 +1,86 @@

// Numbers
_0 no
_1 pa
_2 Re
_3 Si
_4 vo
_5 mu
_6 xa
_7 ze
_8 bi
_9 so
_dpt pi_


a abu
b b@
c S@
d d@
e ebu
f f@
g g@
i ibu
j Z@
k k@
l l@
m m@
n n@
o obu
p p@
r R@
s s@
t t@
u ubu
v v@
x x@
y '@bu
z z@

h @h@bu
q k@bu
w v@bu



e'o $u+ // request
xu $u+ // question

pu $u+ // past

ko $u+
ku $u+
cu $u+
se $u+
te $u+

la $u+ // article
le $u+
li $u+
lo $u+

pe $u+ // of
po $u+
po'e $u+

fa $u+
fe $u+
fi $u+
fo $u+
fu $u+

i $u+ $pause

// terminators (include a pause after)
ku ku_:
boi bOI_:
vau vaU_:
kei keI_:

// pronouns
mi $u+
do $u+
ti $u+
ta $u+
tu $u+
zo'e $u+

+ 108
- 0
dictsource/jbo_rules View File

@@ -0,0 +1,108 @@

// This file is UTF8 encoded
// Spelling to phoneme rules for Lojban (an artificial constructed language).


.group a
a a
ai aI
au aU

.group b
b b

.group c
c S

.group d
d d
dj dZ

.group e
e e
ei eI

.group f
f f

.group g
g g

.group h
h h

.group i
i i
i (A j

.group j
j Z

.group k
k k

.group l
l l-
A) l l
l (A l

.group m
m m

.group n
n n
n (g N
n (k N

.group o
o o
oi OI

.group p
p p

.group q
q kw

.group r
r r-
A) r R
r (A R


.group s
s s

.group t
t t
tc tS

.group u
u u
u (A w

.group v
v v

.group w
w w

.group x
x x

.group y
y @

.group z
z z

.group
' h
_) ' (_ '@h@

. _!
_) . (@P1 _! // remove . prefix
. (_S1 _! // remove . suffix


ˈ ' // U+2c8 stress marker

+ 3
- 1
dictsource/no_list View File

@@ -211,7 +211,7 @@ ikke $u
// auxillary verbs (be, have, can, etc)

være $u+
er E:r $u
er ,E:r
var $u
vært $u

@@ -254,5 +254,7 @@ i i: $atend
// MAIN WORD DICTIONARY
//*********************

der dE:r
her hE:r
kom kOm
system syst'e:m

+ 46
- 6
dictsource/sv_list View File

@@ -34,7 +34,7 @@ v ve:
w d'8b@lve:
x Eks
y y:
z s'e:t@
z s'E:ta2

_. p'8Nkt

@@ -76,10 +76,8 @@ _1M2 mIlj'u:n
_0M3 bIlj'u:nER
_1M3 bIlj'u:n
_dpt p'8Nkt

(1 : a) f'Ws.ta


// abbreviations
//**************

@@ -197,19 +195,28 @@ andras andRas
ange anje:
anger anje:R
anges anje:s
anne ann
anse anse:
anser anse:R
anses anse:s
arkiv 'aRki:v
av A:v $u
bäste b'EstE
betala b'Et'A:l,a
bet be:t
// betala b'Et'A:l,a
betalt b'Et'A:lt
bort bORt
bott b'Ut
botten b'OtEn
bra bRA:
dags daks
dan dA:n
dem dEm
dig dEj
dra dRA:
drar dRA:R
dras dRA:s
duger du-gER
därför d'ERfY:R
egen e:gEn
egna e:gna
@@ -223,6 +230,7 @@ framme fR'amE
framåt fRamOt
gemensam jEm'e:nsam
gemensamt jEm'e:nsamt
grep gRe:p
greps gRe:ps
gripna gRi:pna
ha hA:
@@ -248,11 +256,15 @@ måsten m'Ost@n
nvda Enve:de:A:
ont Unt
ost Ust
par pA:R
per pE:R
program pRUgR'am
redigera REdIS;'e:Ra
rad RA:d
raden RA:d%En
rader RA:d%ER
sade sA:dE
sades sA:dEs
sent se:nt
sex s'Eks
sig sEj
skolan sk'u:lan
@@ -262,20 +274,30 @@ stad stA:d
staden stA:dEn
stadens stA:dEns
stan stA:n
stor stu:R
stort stu:Rt
susanna s8s'ana
susanne s8s'an
svar svA:R
tar tA:R
ta tA:
tar tA:R
tas tA:s
togs t'u:gs
tomt t'Umt
tom t'Um
torsdag t'u:SdA:g
torsdags t'u:Sdags
torsdagen t'u:SdA:gEn
torsdagens t'u:SdA:gEns
tredje tR'e:djE
tyvärr t%yv'E:R
usa u-Es'A:
usas u-Es'A:s
usa:s u-Es'A:s
vad vA:d $u
valt vA:lt
var vA:R $u
vare vA:RE $u
vem vEm


@@ -285,14 +307,21 @@ browser _^_EN
button _^_EN
cancel _^_EN
checked _^_EN
column _^_EN
columns _^_EN
desktop _^_EN
dot _^_EN
edit _^_EN
email _^_EN
Explorer _^_EN
firefox _^_EN
frame _^_EN
frames _^_EN
gaim _^_EN
google _^_EN
graphic _^_EN
graphics _^_EN
has _^_EN
heading _^_EN
headings _^_EN
image _^_EN
@@ -301,24 +330,35 @@ jaws _^_EN
leaving _^_EN
level _^_EN
link _^_EN
links _^_EN
mail _^_EN
messenger _^_EN
Microsoft _^_EN
mozilla _^_EN
name _^_EN
no _^_EN
of _^_EN
office _^_EN
one _^_EN
online _^_EN
orca ORka
password _^_EN
page _^_EN
read _^_EN
reader _^_EN
row _^_EN
rows _^_EN
screen _^_EN
software _^_EN
submenu _^_EN
table _^_EN
tables _^_EN
this _^_EN
tray _^_EN
unchecked _^_EN
unselected _^_EN
user _^_EN
view _^_EN
web _^_EN
with _^_EN
word _^_EN

+ 225
- 34
dictsource/sv_rules View File

@@ -4,22 +4,37 @@

.group a
a A:
ik) a %a
a (CC a
a (vs A:
a (vb A:
a (vd A:
a (va a
a (rt_ A:
_) a (rt %a
a (vg A:
a (r_ a
a (s_ a
p) a (d_ a
k) a (d_ a
k) a (k A:
kl) a (r A:
ikl) a (r_ a
xempl) a (r A:
sv) a (r A:
sv) a (rt a
b) a (k A:
bl) a (d A:
gl) a (d A:
gl) a (d% a
b) a (kte a
k) a (s_ a
k) a (ni a
b) a (r_ A:
lt) a (t A:
_b) a (k A:
bb) a (r_ a
a (CC a
a (C% a
// r) a (C% a
a (_ a
&) a (_ a2
a (re a
@@ -27,7 +42,7 @@
a (rna a
l) a (rs A:
idr) a A:
k) a (ta ,a
k) a (ta %a
m) a (j a
om) a (t A:
m) a (ter a
@@ -48,7 +63,7 @@
st) a (t_ a
tot) a (l 'A:
_gl) a (s A:
_gl) a (ss a
gl) a (s% a
v) a (ld A:
v) a (rd A:
sm) a (rt A:
@@ -76,22 +91,65 @@
ppd) a (t a
r) a (ba a
ass) a a
l) a (gl A:
_d) a (g A:
l) a (g A:
l) a (gg a
d) a (g A:
d) a (g% a
ik) a (ns 'A:
et) a (g 'A:
t) a (g A:
t) a (g% a
f) a (rt 'A:
f) a (rl 'A:
t) a (ti a
tt) a (C a
f) a (ren A:
n) a (ti %a
s) a (ti %a
t) a (ti %a
ks) a (m a
ts) a (m a
// tt) a (C a
n) a (l_ 'A:
tt) a (ga A:
tt) a (get A:
tt) a (git A:

&) a a
dd) a (C a

dr) a (t a
dr) a (d a
nd) a (r a
str) a a
edr) a (r A:
s) a (kn A:
s) a (ks A:
s) a (ke A:
t) a (ls A:
at) a ( a
ep) a (r %a
arbet aRbe:t
amerik amERIk
agera age:Ra
pl) a (nera %a
analy analy:
_) avta A:vtA:
_) avge A:vje:
_) avge A:vj'e:
v) a (lf A:
delt) a A:
ret) a (g A:
edr) a (g A:
sk) a (da A:
sk) a (de A:
sk) a (p A:
t) a (lC A:
t) a (l% a
v) a (ria a
b) a (r A:
t) a (l_ 'A:
t) a (l_ 'A:
b) a (r% a
a (bo a
alkohol alkUho:l
allvar allvA:R

.group b
b b
@@ -99,9 +157,11 @@
bevakn bEvA:kn
bredband bRe:dband
begrav bEgRA:v
begrip BEgR'i:p
begrip bEgR'i:p
beslag bEsl'A:g
beslagta bEsl'A:gtA:
betal b%Et'A:l


.group c
c k
@@ -113,6 +173,7 @@
c (ä s
c (ö s
ch S
ch (ef sx
ck k
ck (A k: // ??
computer _^_EN
@@ -124,8 +185,8 @@
dagen dA:gEn
daglig dA:glIg
diske dIskE
djup j'u-p
djur j'u-R
dju j'u-
djung j'8N
dum d8m
datorer dat'u:RER
dator dA:tOR
@@ -141,18 +202,18 @@
e e:
h) e (m E
e (CC E
&) e %E
med) e (l E
b) e (s E
b) e (k E

e (j E
d) e (lv e:
d) e (c E
d) e (ls e:
m) e (dde e:
d) e (ln e:
d) e (lt e:
l) e (dn e:
d) e (bat E
s) e (kund E
ch) e (f E:
e (ta E
e (x E
@@ -169,30 +230,72 @@
n) e (ds e:
br) e (v e:
sv) e (r E
_s) e (p E
s) e (p %E
ka) e (l E
b) e (l_ E
nyh) e (t e:
r) e (sul E
r) e (sur E
r) e (dak E
b) e (f E
b) e (k E
b) e (h E
b) e (s E
b) e (v E
b) e (f %E
b) e (g %E
b) e (k %E
b) e (h %E
b) e (s %E
b) e (v %E
b) e (l %E
b) e (t %E
b) e (r %E
r) e (g %E
s) e (k %E
v) e (ta e:
r) e (ta e:
r) e (dn e:
l) e (ta e:
e (nli e:
e (gent E
pr) e (n E
pr) e (n %E
mp) e (l %E
pr) e (c %E
sp) e (c %E
g) e (n %E
_) e (tik E
r) e (ce E
m) e (tod E
p) e (ri E
xtr) e (m e:
v) e (k e:
it) e (t_ e:
st) e (mC 'e:
s) e (ra e:
r) e (ra e:
n) e (ra e:
f) e (ra e:
g) e (ra e:
m) e (ra e:
d) e (ra e:
l) e (ra e:
t) e (ra e:
m) e (del e:
d) e (lse %E
g) e (nom e:
liot) e (k e:
c) e (r e:
l) e (da e:
gh) e (t e:
h) e (ten e:
st) e (k e:
yst) e (m e:
it) e (t e:
_h) e (ta e:
ember 'EmbER
e (rsä e:
e (rsatt e:
e (nbar e:
e (rin e:
p) e (da E
r) e (tur %E
e (xemp %E
elek 'ElEk
espeak _^_EN
ekonom 'Eku:n,O:m
@@ -205,6 +308,7 @@ enhet e:nhe:t
f (f
familj fam'Ilj
formad fORmad
face _^_EN

.group g
g g
@@ -220,9 +324,20 @@ enhet e:nhe:t
g (n N
gj j
lä) g (e g
gjord ju:Rd
vä) g g
lo) g (i g
y) g (e g
y) g (a g
y) g (o g
a) g (e g
i) g (i g
a) g (i g
sla) g g
gjor ju:R
gani gan'I
garage gaR'A:S
garant g%aR'ant
gata gA:ta
glöm glWm
guide g'aId
guider g'aIdER
@@ -232,26 +347,46 @@ enhet e:nhe:t
h h
h (h
hj j
hjälp jElp
hög hY:g
heading _^_EN

.group i
i i:
i (CC I
i (nf %I
i (g_ I
i (nstr %I
s) i (t I
dr) i (v i:

item _^_EN
_fl) i (k i:
t) i (d i:
skr) i (v i:
v) i (sn i:
l) i (kna i:
l) i (c I
d) i (r I
t) i (s I
c) i I
c) i (s_ i:
Cl) i (kaC %I
kr) i (ti I
kr) i (te I
kr) i (s i:
kr) i (st i:
krit) i (k_ i:
ikon Ik'o:n
inne InE
ibili IbIlI
itut Itu-t
imag _^_EN

.group j
j j

java jA:va
j (uster sx
jou (r sxU

.group k
@@ -286,8 +421,7 @@ ikon Ik'o:n
lg (_ lj
_) lj j
låg l'o:g
ljud j'u-d
ljug j'u-g
lju j'u-
ligen lIgEn
lager lA:gER

@@ -296,10 +430,12 @@ ligen lIgEn
m (m
menu _^_EN
människ m'EnIsx,
medlem m'e:dlEm
medl m'e:dl
maga maga
meny mEn'y:
minimera mIni:m'e:Ra2
maria m%aR'i:a
marie m%aR'i:
maximera maksi:m'e:Ra2
motor m'u:tOR
motorer m'Otu:RER
@@ -324,10 +460,19 @@ ligen lIgEn
normal nORmA:l
natur n'at'u-R
nali nalI
navig n%av%Ig

.group o
o u:
o (CC O
o (C% U
o (bb O
o (dd O
o (mm O
o (pp O
o (ss O
o (tt O
o (ff O
o (rC u:
o (rr O
o (ll O
@@ -337,6 +482,8 @@ ligen lIgEn
o (rg O
o (ck O
f) o (n 'o:
pr) o (c %U
s) o (ci %U
l) o (g 'o:
l) o (v 'o:
l) o (gg 'O
@@ -346,11 +493,16 @@ ligen lIgEn
f) o (rm 'O
pr) oj Osx'
o (ns U
l) o (k %U
g) o (r U
nn) o (ns O
ss) o (n O
C) o (rs O
k) o (rta O
k) o (rt O
b) o (rt O
n) o (r_ O
t) o (r_ O
s) o (r_ O
rs) o (rd u:
o (rde o:
b) o (st u:
@@ -363,8 +515,8 @@ ligen lIgEn
osparat u:spA:Rat
och 'Ok
k) o (ns O
pr) o (cent O
p) o (lis O
pr) o (cent %O
p) o (lis %O
p) o (pu O
g) o (n O
sp) o (rt O
@@ -372,14 +524,27 @@ ligen lIgEn
upp) o (rt o:
l) o (n O
d) o (n O
pr) o (b %O
pr) o (d %O
k) o (lu %O
inf) o (rmati %O
k) o (d o:
lk) o (r o:
g) o (d u:
_) o (j O
o (ni 'o:
m) o (t 'u:
k) o (k 'u:
bl) o (d 'u:
k) o (rv O
n) o (vell %O
st) o (rm O
operat OpERat

.group p
p p
p (p
pion pI;'u:n
påstå po:sto:
paket pak'e:t
parentes paR@nt,e:s
@@ -401,6 +566,7 @@ ligen lIgEn
rss s.
rg (_ Rj
radera Rad'e:Ra
rediger R%EdIsx'e:R
rafik Raf'i:k
regel Re:gEl
resor R'e:sOR
@@ -420,10 +586,11 @@ rubrik R8bR'i:k
sk (ö sx
fi) s (k s
fu) s (k s
skj sx
skj S;
stj sx
sio (n sx'u:
ssio (n sx'u:
skype sk'ajp
spegel spe:gEl
segel se:gEl
spel spe:l
@@ -431,6 +598,7 @@ rubrik R8bR'i:k
säg sEj
service sY:Rvi:s
spara spA:Ra
sjack sjak
svara svA:Ra
slog sl'u:g
stått stOt
@@ -450,7 +618,6 @@ rubrik R8bR'i:k
tt (A t: // ??
ti (on sx'
tj S;

&C) te (_S2 tE // ??
task _^_EN
talsyntes t'A:lsynt,e:s
@@ -463,6 +630,7 @@ rubrik R8bR'i:k
u u-
u (tb u-
u (tf u-
u (tg u-
u (ts u-
u (tr u-
u (tv u-
@@ -471,20 +639,30 @@ rubrik R8bR'i:k
u (n 8
u (tl u-
sj) u (k u-
j) u (ni u-
j) u (l u-
r) u (m_ 8:
utmärk 'u-tm@Rk
b) u (tik 8
v) u (x 8
lin) u (x %8
uppge 8pje:
u (tn u-
u (tr u-
u (ng 8
u (nkC %8
u (kti %8
upload _^_EN

.group v
v v
v (v
vali valI
varandra vaRandRa
varn vA:Rn
varan vA:Ran
verk vERk
verktyg vERkty:g

.group w
w v
@@ -499,6 +677,9 @@ upload _^_EN
.group y
y y:
y (CC y
t) y (d 'y:
s) y (s %y
t) y (g 'y:
s) y (nska y:

.group z
@@ -507,8 +688,12 @@ upload _^_EN

.group å
å o:
å (CC O
å (CC o:
å (C% O
å (ng O
tr) å (d 'o:
l) å (s 'o:
l) å (ss 'O
v) å (r 'o:
r) å (k o:
h) å (r 'o:
@@ -522,6 +707,7 @@ upload _^_EN
ä E:
ä (CC E
ä (r E:
ä (rd E:
tr) ä (d E:
v) ä (lk E:
l) ä (sn E:
@@ -529,9 +715,11 @@ upload _^_EN
sk) ä (rg E:
l) ä (st E:
n) ä (tt E

v) ä (x E
n) ä (t E:
f) ä (rd E:
b) ä (r E:
r) ä (k E:
ärl (d 'E:R

@@ -540,6 +728,9 @@ upload _^_EN
ö Y:
ö (CC 'W
f) ö (rd 'Y:
f) ö (rk %W
l) ö (sn 'Y:
l) ö (st 'Y:
ö (vr 'Y:
r) ö (m 'W


+ 3
- 0
espeak-data/voices/jbo View File

@@ -0,0 +1,3 @@
name lojban
language jbo


+ 7
- 3
phsource/compile_report View File

@@ -1,4 +1,4 @@
42 phoneme tables
43 phoneme tables
new total
base 96 96
base2 24 115
@@ -12,6 +12,7 @@
cy 29 122
de 33 123
eo 13 108
jbo 4 109
fi 40 127
fr 34 118
fr_ca 11 118
@@ -1243,6 +1244,7 @@ vowel/ee_6 [E] en_n
[&] sk
[E3] sv
vowel/e_mid [E] en_rp
[e] jbo
[E] fr_ca
[E] hi
[E] hu
@@ -1443,7 +1445,8 @@ vowelr/aa_r [A:] en_sc
[A@] en_sc
vowelr/oo_r [O@] en_sc
vowelr/o_r [o@] en_sc
vowelr/r-voc [r-] hi
vowelr/r-voc [r-] jbo
[r-] hi
[r-] sk
[r:] sk
[r-] hr
@@ -1622,7 +1625,8 @@ vwl_fr/@R [R] fr
[x] pt_pt
vwl_fr/@R2 [R] fr_ca
vwl_hi/A [a:] hi
vwl_hi/l-voc [l-] hi
vwl_hi/l-voc [l-] jbo
[l-] hi
[l-] sk
[l:] sk
vwl_no/& [a] no

+ 23
- 0
phsource/ph_lojban View File

@@ -0,0 +1,23 @@
// Phonemes for Lojban (an artificial constructed language)
// Inherits phonemes from Esperanto


phoneme r- // syllabic r, for lojban
vowel starttype (@) endtype (@)
length 220
formants vowelr/r-voc
endphoneme

phoneme l- // syllabuc l, for lojban
vowel starttype (@) endtype (@)
length 140
formants vwl_hi/l-voc
endphoneme

phoneme e
vowel starttype (e) endtype (e)
length 170
formants vowel/e_mid
endphoneme



+ 1
- 1
phsource/ph_norwegian View File

@@ -71,7 +71,7 @@ endphoneme

phoneme E:
vowel starttype (e) endtype (e)
length 250
length 260
formants vowel/ee_1
endphoneme


+ 1
- 1
phsource/ph_swedish View File

@@ -33,7 +33,7 @@ phoneme E
vowel starttype (e) endtype (e)
length 140
formants vowel/ee
reduceto @ 2
reduceto E- 2
endphoneme

phoneme E:

+ 4
- 1
phsource/phonemes View File

@@ -98,7 +98,7 @@ phoneme _! // Short pause, don't replace by linking
pause
formants NULL
starttype _ endtype _
length 25
length 35
lengthmod 1
nolink
endphoneme
@@ -1160,6 +1160,9 @@ include ph_german
phonemetable eo base
include ph_esperanto

phonemetable jbo eo
include ph_lojban

phonemetable fi base
include ph_finnish


+ 9
- 0
src/numbers.cpp View File

@@ -208,6 +208,7 @@ int Translator::TranslateRoman(char *word, char *ph_out)
int prev;
int value;
int subtract;
int repeat = 0;
unsigned int flags;
char number_chars[N_WORD_BYTES];

@@ -224,6 +225,14 @@ int Translator::TranslateRoman(char *word, char *ph_out)
return(0);

value = roman_values[p2 - roman_numbers];
if(value == prev)
{
repeat++;
if(repeat >= 3)
return(0);
}
else
repeat = 0;

if((prev==5) || (prev==50) || (prev==500))
{

+ 28
- 15
src/phonemelist.cpp View File

@@ -498,27 +498,40 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence)
{
int x;

if(langopts.vowel_pause && (ph->type != phPAUSE) && (next->type == phVOWEL))
if(langopts.vowel_pause && (ph->type != phPAUSE))
{
if(langopts.vowel_pause & 0x04)
{
// break before a word which starts with a vowel
insert_ph = phonPAUSE_VSHORT;
}

if((ph->type == phVOWEL) && ((x = langopts.vowel_pause & 0x03) != 0))
if((ph->type != phVOWEL) && (langopts.vowel_pause & 0x200))
{
// adjacent vowels over a word boundary
if(x == 2)
insert_ph = phonPAUSE_SHORT;
else
insert_ph = phonPAUSE_VSHORT;
// add a pause after a word which ends in a consonant
insert_ph = phonPAUSE_NOLINK;
}

if(((plist2+1)->stress >= 4) && (langopts.vowel_pause & 0x08))
if(next->type == phVOWEL)
{
// pause before a words which starts with a stressed vowel
insert_ph = phonPAUSE_SHORT;
if((x = langopts.vowel_pause & 0x0c) != 0)
{
// break before a word which starts with a vowel
if(x == 0xc)
insert_ph = phonPAUSE_NOLINK;
else
insert_ph = phonPAUSE_VSHORT;
}
if((ph->type == phVOWEL) && ((x = langopts.vowel_pause & 0x03) != 0))
{
// adjacent vowels over a word boundary
if(x == 2)
insert_ph = phonPAUSE_SHORT;
else
insert_ph = phonPAUSE_VSHORT;
}
if(((plist2+1)->stress >= 4) && (langopts.vowel_pause & 0x100))
{
// pause before a words which starts with a stressed vowel
insert_ph = phonPAUSE_SHORT;
}
}
}


+ 7
- 7
src/speak.cpp View File

@@ -260,13 +260,13 @@ static void init_path(char *argv0)
#ifdef PLATFORM_DOS
strcpy(path_home,PATH_ESPEAK_DATA);
#else
// char *env;
// if((env = getenv("ESPEAK_DATA_PATH")) != NULL)
// {
// snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
// if(GetFileLength(path_home) == -2)
// return; // an espeak-data directory exists
// }
char *env;
if((env = getenv("ESPEAK_DATA_PATH")) != NULL)
{
snprintf(path_home,sizeof(path_home),"%s/espeak-data",env);
if(GetFileLength(path_home) == -2)
return; // an espeak-data directory exists
}

snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
if(access(path_home,R_OK) != 0)

+ 1
- 1
src/synthdata.cpp View File

@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"

const char *version_string = "1.30.02 02.Jan.08";
const char *version_string = "1.30.03 04.Jan.08";
const int version_phdata = 0x013000;

int option_device_number = -1;

+ 15
- 1
src/tr_languages.cpp View File

@@ -39,6 +39,7 @@

#define L_qa 0x716100
#define L_grc 0x677263 // grc Ancient Greek
#define L_jbo 0x6a626f // jbo Lojban
#define L_zhy 0x7a6879 // zhy


@@ -214,7 +215,6 @@ Translator *SelectTranslator(const char *name)
tr->langopts.vowel_pause = 1;
tr->langopts.stress_rule = 2;
tr->langopts.stress_flags = 0x6 | 0x10;
// tr->langopts.stress_flags = 0x1; // don't give full stress to monosyllables
tr->langopts.unstressed_wd1 = 1;
tr->langopts.unstressed_wd2 = 2;

@@ -409,6 +409,20 @@ SetLengthMods(tr,3); // all equal
}
break;

case L_jbo: // Lojban
{
static const short stress_lengths_jbo[8] = {180,180, 220,220, 0,0, 260,280};
static const wchar_t jbo_punct_within_word[] = {'.',',','\'',0x2c8,0}; // allow period and comma within a word, also stress marker
tr = new Translator();
SetupTranslator(tr,stress_lengths_jbo,NULL);
tr->langopts.stress_rule = 2;
tr->langopts.vowel_pause = 0x20c; // pause before a word which starts with a vowel, or after a word which ends in a consonant
tr->punct_within_word = jbo_punct_within_word;
tr->langopts.param[LOPT_SYLLABLE_CAPS] = 1; // capitals indicate stressed syllables
SetLetterVowel(tr,'y');
}
break;

case L('l','a'): //Latin
{
tr = new Translator();

+ 32
- 26
src/translate.cpp View File

@@ -396,6 +396,7 @@ Translator::Translator()
static const unsigned char stress_amps2[] = {16,16, 20,20, 20,24, 24,21 };
static const short stress_lengths2[8] = {182,140, 220,220, 220,240, 260,280};
static const wchar_t empty_wstring[1] = {0};
static const wchar_t punct_in_word[2] = {'\'', 0}; // allow hyphen within words

charset_a0 = charsets[1]; // ISO-8859-1, this is for when the input is not utf8
dictionary_name[0] = 0;
@@ -423,6 +424,7 @@ Translator::Translator()


char_plus_apostrophe = empty_wstring;
punct_within_word = punct_in_word;

for(ix=0; ix<8; ix++)
{
@@ -657,6 +659,8 @@ int Translator::TranslateWord(char *word1, int next_pause, WORD_TAB *wtab)
spell_word = 0;
found = LookupDictList(&word1, phonemes, dictionary_flags, FLAG_ALLOW_TEXTMODE, wtab); // the original word

// if textmode, LookupDictList() replaces word1 by the new text and returns found=0

if(phonemes[0] == phonSWITCH)
{
// change to another language in order to translate this word
@@ -1709,6 +1713,7 @@ void *Translator::TranslateClause(FILE *f_text, const void *vp_input, int *tone_
int embedded_count = 0;
int letter_count = 0;
int space_inserted = 0;
int syllable_marked = 0;
char *word;
char *p;
int j, k;
@@ -1933,7 +1938,8 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
if(char_inserted)
next_in = char_inserted;

if(!IsAlpha(c) && !iswspace(c) && (c != '\''))
// allow certain punctuation within a word (usually only apostrophe)
if(!IsAlpha(c) && !iswspace(c) && (wcschr(punct_within_word,c) == 0))
{
if(IsAlpha(prev_out))
{
@@ -1974,10 +1980,10 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
{
if(!IsAlpha(prev_out) || (langopts.ideographs && ((c >= 0x3000) || (prev_out >= 0x3000))))
{
if(prev_out != '\'')
if(wcschr(punct_within_word,prev_out) == 0)
letter_count = 0; // don't reset count for an apostrophy within a word

if((prev_out != ' ') && (prev_out != '\''))
if((prev_out != ' ') && (wcschr(punct_within_word,prev_out) == 0))
{
// start of word, insert space if not one there already
c = ' ';
@@ -2004,37 +2010,36 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
{
c = towlower(c);

if(iswlower(prev_in))
if(langopts.param[LOPT_SYLLABLE_CAPS])
{
c = ' '; // lower case followed by upper case, treat as new word
space_inserted = 1;
prev_in2 = c;
if(syllable_marked == 0)
{
char_inserted = c;
c = 0x2c8; // stress marker
syllable_marked = 1;
}
}
//#ifdef deleted
// changed to break after the last uppercase letter, not before. See below
else
if((c != ' ') && iswupper(prev_in) && iswlower(next_in) &&
(memcmp(&source[source_index],"s ",2) != 0)) // ENGLISH specific plural
{
c = ' '; // change from upper to lower case, start new word at the last uppercase
space_inserted = 1;
prev_in2 = c;
next_word_flags |= FLAG_NOSPACE;
if(iswlower(prev_in))
{
c = ' '; // lower case followed by upper case, treat as new word
space_inserted = 1;
prev_in2 = c;
}
else
if((c != ' ') && iswupper(prev_in) && iswlower(next_in) &&
(memcmp(&source[source_index],"s ",2) != 0)) // ENGLISH specific plural
{
c = ' '; // change from upper to lower case, start new word at the last uppercase
space_inserted = 1;
prev_in2 = c;
next_word_flags |= FLAG_NOSPACE;
}
}
//#endif
}
else
{
#ifdef deleted
if(iswupper(prev_in) && iswalpha(prev_out2) &&
(memcmp(&source[source_index-1],"s ",2) != 0)) // ENGLISH specific plural
{
// change to break after the last uppercase letter, not before.
c = ' '; // more than one upper case followed by lower case, treat as new word
space_inserted = 1;
prev_in2 = c;
}
#endif
if((all_upper_case) && (letter_count > 2))
{
if((c == 's') && (next_in==' '))
@@ -2211,6 +2216,7 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
pre_pause = 0;
word_mark = 0;
all_upper_case = FLAG_ALL_UPPER;
syllable_marked = 0;
}
}
else

+ 5
- 1
src/translate.h View File

@@ -227,7 +227,7 @@ extern const int param_defaults[N_SPEECH_PARAM];



#define N_LOPTS 13
#define N_LOPTS 14
#define LOPT_DIERESES 1
// 1=remove [:] from unstressed syllables, 2= remove from unstressed or non-penultimate syllables
// bit 4=0, if stress < 4, bit 4=1, if not the highest stress in the word
@@ -271,6 +271,9 @@ extern const int param_defaults[N_SPEECH_PARAM];
// change [t] when followed by unstressed vowel
#define LOPT_REDUCE_T 12

// stressed syllable is indicated by capitals
#define LOPT_SYLLABLE_CAPS 13


typedef struct {
// bits0-2 separate words with (1=pause_vshort, 2=pause_short, 3=pause, 4=pause_long 5=[?] phonemme)
@@ -389,6 +392,7 @@ public:
int dict_condition; // conditional apply some pronunciation rules and dict.lookups
const unsigned short *charset_a0; // unicodes for characters 0xa0 to oxff
const wchar_t *char_plus_apostrophe; // single chars + apostrophe treated as words
const wchar_t *punct_within_word; // allow these punctuation characters within words

// holds properties of characters: vowel, consonant, etc for pronunciation rules
unsigned char letter_bits[256];

Loading…
Cancel
Save