Browse Source

[1.41.18]

*_list: Changed name to $combine (from $alt2) for the attribute which indicates that a word should combine with the next word.

Voices files: Added attribute "speed", which specified a percentage change to the speaking speeds which are used for this voice.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@229 d46cf337-b52f-0410-862d-fd96e6ae7743
master
jonsd 15 years ago
parent
commit
075bfe9006

+ 16
- 16
dictsource/cs_list View File

@@ -185,25 +185,25 @@ si $u


// Prepositions
// the $alt2 prepositions should also be included in cs_rules
// the $combine prepositions should also be included in cs_rules
// as prefixes, so "na-" (for example) is removed from the combined
// word before the pronuciation of the main word is determined.

skrz $u $brk $alt2 // though
skrz $u $brk $combine // though
skrze $u $pause // through
pro $u $pause $alt2 // for
na $u $brk $alt2 // to/for/on
o $u $pause $alt2 // around/about
při $u $pause $alt2 // into,in,around
pro $u $pause $combine // for
na $u $brk $combine // to/for/on
o $u $pause $combine // around/about
při $u $pause $combine // into,in,around
v v_ $brk // in
po $u $pause $alt2 // after,around
za $u $pause $alt2 // behind
před $u $pause $alt2 // in front of
po $u $pause $combine // after,around
za $u $pause $combine // behind
před $u $pause $combine // in front of
mezi $pause // between
pod $u $pause $alt2 // below
pod $u $pause $combine // below
pode $u $pause // below
s s_ $pause // with
nad $u $pause $alt2 // above
nad $u $pause $combine // above
nade $u $pause // above

k $brk // towards
@@ -213,16 +213,16 @@ naproti $pause // opposite

během $pause // during
podle $pause // according to
dle $u $pause $alt2 // along
dle $u $pause $combine // along
vedle $pause // beside
kolem $pause // around
okolo $pause // around
do $u $brk $alt2 // to
od $u $brk $alt2 // away from
do $u $brk $combine // to
od $u $brk $combine // away from
ode $u $brk // away from
z s_ $brk // out of/from
ze $u $brk $alt2 // out of/from
bez $pause $alt2 // without
ze $u $brk $combine // out of/from
bez $pause $combine // without
beze $pause // without
místo $pause // instead of


+ 5
- 6
dictsource/dict_phonemes View File

@@ -39,13 +39,12 @@ v2 w x z

Dictionary jbo_dict

@ @- a aI aU e eI i
l- o oI r- u
@ 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
- b d dZ f g h j
k l m n N p R s
S t tS v w x z Z


Dictionary hu_dict

+ 1
- 1
dictsource/en_list View File

@@ -360,7 +360,7 @@ irc $abbrev
lbs paUndz
LBS $abbrev
ltd lImI2tI2d
mc m@k $alt2 // combine with the following word
mc m@k $combine // combine with the following word
ny $abbrev
oem $abbrev
ok $abbrev

+ 3
- 2
dictsource/fr_rules View File

@@ -23,7 +23,7 @@

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

// Letter classes:
@@ -623,7 +623,8 @@ p) ès (_ Es
gg g // agglomérer
ai) gni n^ // craignions châtaignier
gn n^ // agneau
gn (ie n // comagnie
gn (ie n // compagnie
dia) g (no g
_quatrevin) gts (_ z2

vin) gt (_A t // liaison: vingt ans

+ 1
- 1
dictsource/hu_list View File

@@ -231,7 +231,7 @@ noha $u $pause // even thought


// Negative
nem $alt2 $strend
nem $u $combine $strend
ne $u+

e $u // "-e" question

+ 54
- 42
dictsource/hu_rules View File

@@ -16,9 +16,9 @@

.group á
á a:
@) ában (_S4 a:bAn
@) ának (_S4 a:nAk
@) ától (_S4 a:to:l
@) ában (_S4q a:bAn
@) ának (_S4q a:nAk
@) ától (_S4q a:to:l

.group b
b b
@@ -38,9 +38,10 @@
ar) csz (e ts
harmin) c ts
anar) ch (i C
balda) ch (in C
hierar) ch (i C
me) ch (a C
te) ch (n C
te) ch C
pszi) ch C
pszy) ch C
mün) ch (en C
@@ -73,29 +74,27 @@ hierar) ch (i C

_) church tSYR2tS


.group d
d d
dd d:
dts tS:
dt t:
dtszé t:se:
apró) d (sz d
a) dsz ts:
dsz (_S3 ts:
beszé) d (szin d
cselé) d d
enge) dsz ts:
engedelmeske) dsz ts:
fogó) dz (kod ts
fenyegető) dz z
föl) d (sánc d
hazu) dsz ts:
ha) d (járat d
ha) d (sor d
hor) d (szék d
harapó) dz z
mara) dsz ts:
himbáló) dz z
pa) d (sor d
tu) dsz ts:
ren) d (sza d
va) d (sző d
kére) dz ts
mentegető) dz z
dz dz
@@ -107,7 +106,13 @@ mentegető) dz z
A) ds (A tS:
dsz ts
dsz (C ts
A) dsz (A ts:
dsz (a ds
a) dsz (A ts:
e) dsz (A ts:
o) dsz (A ts:
a) dsz (í ds
é) dsz ds
ó) dsz ts:
dz dz
C) dzs dZ
A) dzs (A dZ:
@@ -115,6 +120,9 @@ mentegető) dz z
A) dj (A J:
dj J:
min) dny n^
ná) d d
ná) dd d:



.group e
@@ -126,9 +134,9 @@ mentegető) dz z
.group é
é e:
éi (é e::i:
@) ében (_S4 e:bEn
@) ének (_S4 e:nEk
@) étől (_S4 e:tY:l
@) ében (_S4q e:bEn
@) ének (_S4q e:nEk
@) étől (_S4q e:tY:l

.group ë
ë Y
@@ -164,13 +172,9 @@ _minde) gy (ik J:

_) goethe gY:tE
_) goethé gY:te:
me) g (gyú g
me) g (győz g
me) g (gyil g
me) g (gyű g
me) g (gyász g
me) g (gyűr g
me) g (gy g
le) g (gy g
orszá) g (gyűlés g

.group h
h h
@@ -185,13 +189,15 @@ _minde) gy (ik J:
í i:
íts i:tS:
fesz) ítsd i:tSd
ford) ítsd i:tSd
semmis) ítsd i:tSd
bizony) ítsd i:tSd

.group j
j j
@) jában (_S5 ja:bAn
@) jának (_S5 ja:nAk
@) jától (_S5 ja:to:l
@) jában (_S5q ja:bAn
@) jának (_S5q ja:nAk
@) jától (_S5q ja:to:l
_) javíts jAvi:tS:
_) javítsd jAvi:tSd

@@ -199,12 +205,12 @@ bizony) ítsd i:tSd
.group k
k k
kk k:
kk (C kk
kk (C k:
_) köztársaság k'Ysta:R2SASa:g
központ kYspont
központj kYsponc
_) köz kYz
_) község kYSSe:g
község kYSSe:g
készség ke:SSe:g
_) kétség ke:tS:e:g

@@ -251,10 +257,10 @@ szamue) ly lli
nj n^n^
nyj n^n^

_) nem (- n,Em // has $alt2 attribute in hu_list, combine with the next word
_) nem (- n,Em // has $combine attribute in hu_list, combine with the next word
me) nny (ország n^
me) nny (d n^
ajá) nlj j:


.group o
@@ -301,6 +307,7 @@ szamue) ly lli
ssz ss2
szts stS:
sztsze stsE

föld) s (ánc S
s (színű S
hel) s (inki z
@@ -329,6 +336,8 @@ _nyílá) s S
liszte) szs (ák SZ
pénze) s S
rend) sz (er s:
robbaná) s S
robbaná) ss S:


.group t
@@ -338,15 +347,18 @@ liszte) szs (ák SZ
t t
tc ts:
tt t:
@) tól (_S3 to:l
@) től (_S3 tY:l
ttk t:k
@) tól (_S3q to:l
@) től (_S3q tY:l
tt (C tt
ttn t:n
ttr t:R2
ty c
// s) ty c: //
// z) ty c: // keztyű
ttj tc:
ts (_S2 tS //general rule with word end of ts letters
tsü tSy
ttj c:
tty c:
apá) ts (ág tS:
becsüle) t t
@@ -358,13 +370,15 @@ becsüle) tt t:
ezüs) tt t:
éle) t t
éle) tt t:
felej) ts tS
gyapo) t t
gyapo) tt t:
gráni) t t
gráni) tt t:
já) tsz (ani ts:
já) tsz ts:
já) tssz ts:
tsz ts:
kegyele) t t
kegyele) tt t:
szorí) ts (a tS:
ürí) ts (e tS:
mula) ts tS:
@@ -387,6 +401,7 @@ becsüle) tt t:
C) tj c
A) tj (A c:
C) tyj c
ttyj c:
A) tyj (A c:

_ka) ty (n ti
@@ -407,8 +422,8 @@ vörösmar) ty ti
dön) ts (ön tS
folyama) t (jel t
hi) t (sze t
kattin) ts tS
kiál) ts tS
hi) t (szó t
korlá) tj (ára c:
köve) ts (ég tS:
t (jel t //need this general rule when any not added word contains the tjel part
kür) t t
@@ -416,7 +431,6 @@ kattin) ts tS
kür) t (jel t
küldö) ttj c:
neve) ts (ég tS:
on) ts (u tS
o) tt t:
szen) t (szék t
szé) t t
@@ -424,13 +438,10 @@ kattin) ts tS
szöve) ts (ég tS:
söté) ts (ég tS:
sajá) ts (ág tS:

pillan) ts tS

tar) ts tS
á) t (sor t
á) t (sé t
(á) t (sze t
á) t (sze t
á) t (sug t
á) t (suh t
á) t (sur t
ne) t (c t
@@ -518,6 +529,7 @@ lefeje) z (ték s
mé) zc (sz z
nehé) z (sé S
iga) zs (ág SS
iga) z (szí z
ga) zs (ág SS
pén) z z
szá) z (sz z

+ 3
- 2
dictsource/jbo_list View File

@@ -74,12 +74,12 @@ po'u _;_pohu $u
goi _;_goI $u

ija _;_iZa // should this series be unstressed?
ijanai _;_iZanaI
ijanai _;_iZan'aI
ije _;_iZe
ije'i _;_iZehi
ijenai _;_iZenaI
ijo _;_iZo
ijonai _;_iZonaI
ijonai _;_iZon'aI
inaja _;_inaZa

to _::to $u // start parenthesis, pause but don't raise intonation
@@ -90,3 +90,4 @@ boi boI_:: $u
vau vaU_:: $u
kei keI_:: $u
toi toI_:: $u


+ 0
- 1
dictsource/jbo_rules View File

@@ -81,7 +81,6 @@
.group r
r r- // syllabic
A) r R
C) r (A @-*
r (A R



+ 3
- 3
dictsource/pl_list View File

@@ -804,11 +804,11 @@ winegret $3
(ze mną) z'EmnO~

// words marked with $alt2 are combined with word marked with $alt
// words marked with $combine are combined with word marked with $alt
// (used for 'nie' with single-syllable verbs)

nie $u $alt2
ni $u $alt2
nie $u $combine
ni $u $combine




+ 8
- 8
dictsource/sk_list View File

@@ -202,18 +202,18 @@ si $u+ // reflexive
ho $u+

// Prepositions
o o_ $u $brk $alt2
o o_ $u $brk $combine
k k $brk // at,on,to
v v_ $brk // at,in,into
z z_ $brk // from,of
na $u $alt2 // at,for,into
po $pause $alt2 // about,after
pod $pause $alt2 // under
na $u $combine // at,for,into
po $pause $combine // about,after
pod $pause $combine // under
s s_ $pause // with
so $pause $alt2 // with
bezo $pause $alt2 // without
bez $pause $alt2 // without
pri $pause $alt2 // about,beside,at
so $pause $combine // with
bezo $pause $combine // without
bez $pause $combine // without
pri $pause $combine // about,beside,at

// Conjunctions
a $u $pause // and

+ 1
- 1
dictsource/sk_rules View File

@@ -223,7 +223,7 @@ _štipen) d (i d
n (íT n
@C) n (ej_ n

_) na (-P3 'na // include $alt2 words as stressed prefixes
_) na (-P3 'na // include $combine words as stressed prefixes

n (ent n
_be) n (ef n

+ 3
- 0
dictsource/ta_list View File

@@ -216,6 +216,9 @@ _dpt _pul.l.i
பங்கம் $alt
பீடி $alt
பீதி $alt
பம்பரம் $alt
பாதுஷா $alt
பேகம் $alt


தானம் $alt // initial த as [d]

+ 5
- 1
dictsource/ta_rules View File

@@ -73,6 +73,9 @@
_) க (ம்பீர gV
_) க (ந்தர்வ gV
_) க (ோவிந்த g
_) க (ணே gV



ங NV
ங (B N
@@ -166,7 +169,8 @@
_) ப (காசுர bV
_) ப (ோஜ b
_) ப (தில bV

_) ப (க்தி bV
_) ப (ஜ bV

ம mV
ம (B m

+ 3
- 1
phsource/compile_report View File

@@ -619,11 +619,13 @@ r3/r_u [(u)] base
r3/r_uvl [r"] base
[R2] da
r3/r_uvl.wav [r"] base
[R] fr
[r] fr
[r/2] fr
[R2] da
r3/rx [*] base
[r/] base
[r/] af
[r/2] fr
[R] fr_ca
[r/] ru
[x] pt_pt

+ 12
- 6
phsource/ph_french View File

@@ -1,7 +1,7 @@
//====================================================
// French
//====================================================
// Updated 2009-10-07 Michel Such <[email protected]>
// Updated 2009-10-13 Michel Such <[email protected]>

phoneme (l) virtual
// Used for l and l/
@@ -463,18 +463,18 @@ phoneme p2 // silent unless followed by vowel
endphoneme


phoneme r // between vowels in a word
phoneme r
liquid uvl starttype (r) endtype (r)
vowelin f1=0 f2=1600 -300 300 f3=-200 80 len=20
vowelout f1=2 f2=1600 -300 300 f3=-300 80
length 100
lengthmod 7
beforenotvowel r/2
formants vwl_fr/r
formants vwl_fr/r+r3/r_uvl.wav%25
after _ vwl_fr/_r
after k vwl_fr/tr
after p vwl_fr/tr
after t vwl_fr/tr
after t vwl_fr/tr+r3/r_uvl.wav%30
after r/2 vwl_fr/_r
endphoneme

@@ -486,7 +486,7 @@ phoneme R // First letter of a word
length 100
lengthmod 0
beforenotvowel r/2
formants vwl_fr/_r2
formants vwl_fr/_r2+r3/r_uvl.wav%25
after _ vwl_fr/_r
after (a) vwl_fr/_r
after (e) vwl_fr/_r
@@ -516,7 +516,13 @@ phoneme r/2 // variant of [r] when not preceding a vowel
vowelout f1=2 f2=1600 -300 300 f3=-300 100
length 100
lengthmod 2
formants vwl_fr/r_+r3/rx%25
formants vwl_fr/r_
after (a) vwl_fr/r_+r3/r_uvl.wav%30
after (e) vwl_fr/r_+r3/r_uvl.wav%30
after (@) vwl_fr/r_+r3/r_uvl.wav%30
after (i) vwl_fr/r_+r3/r_uvl.wav%30
after (o) vwl_fr/r_+r3/r_uvl.wav%30
after (u) vwl_fr/r_+r3/r_uvl.wav%30
before m r3/r_n
before n r3/r_n
endphoneme

+ 4
- 2
phsource/ph_lojban View File

@@ -4,13 +4,15 @@

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

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


BIN
phsource/vwl_fr/w_a View File


+ 1
- 1
src/compiledict.cpp View File

@@ -91,7 +91,7 @@ MNEM_TAB mnem_flags[] = {
{"$double", 19}, // IT double the initial consonant of next word
{"$alt", 20}, // use alternative pronunciation
{"$alt2", 21},
{"$combine", 22}, // Combine with the next word

{"$max3", 27}, // limit to 3 repetitions
{"$brk", 28}, // a shorter $pause

+ 11
- 0
src/dictionary.cpp View File

@@ -1167,6 +1167,17 @@ void SetWordStress(Translator *tr, char *output, unsigned int &dictionary_flags,
}
break;

case 10: // penultimate, but final if only 1 or 2 syllables
if(stressed_syllable == 0)
{
if(vowel_count < 4)
{
vowel_stress[vowel_count - 1] = 4;
max_stress = 4;
break;
}
}
// drop through to next case
case 2:
// a language with stress on penultimate vowel


+ 14
- 1
src/setlengths.cpp View File

@@ -116,6 +116,11 @@ void SetSpeed(int control)
wpm = embedded_value[EMBED_S];
if(control == 2)
wpm = embedded_value[EMBED_S2];

if(voice->speed_percent > 0)
{
wpm = (wpm * voice->speed_percent)/100;
}
wpm2 = wpm;

if(wpm > 369) wpm = 369;
@@ -561,7 +566,7 @@ void CalcLengths(Translator *tr)
if((len = tr->stress_lengths[stress]) == 0)
len = tr->stress_lengths[6];

length_mod = (length_mod * len)/128;
length_mod = length_mod * len;

if(p->tone_ph != 0)
{
@@ -581,6 +586,14 @@ void CalcLengths(Translator *tr)
length_mod = length_mod * (256 + (280 - len)/3)/256;
}

if(length_mod > tr->langopts.max_lengthmod*speed1)
{
//limit the vowel length adjustment for some languages
length_mod = (tr->langopts.max_lengthmod*speed1);
}

length_mod = length_mod / 128;

if(p->type != phVOWEL)
{
length_mod = 256; // syllabic consonant

+ 2
- 2
src/synthdata.cpp View File

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

const char *version_string = "1.41.17 15.Oct.09";
const int version_phdata = 0x014100;
const char *version_string = "1.41.18 19.Oct.09";
const int version_phdata = 0x014118;

int option_device_number = -1;


+ 0
- 4
src/synthesize.cpp View File

@@ -1275,11 +1275,7 @@ int Generate(PHONEME_LIST *phoneme_list, int *n_ph, int resume)
}
else
{
// if((prev->type != phVOWEL) && ((prev->ph->phflags & phVOICED)==0) && ((next->ph->phflags & phVOICED)==0))
// DoSpect(p->ph,prev->ph,phoneme_tab[phonPAUSE_SHORT],2,p,0);
// else
DoSpect(p->ph,prev->ph,phoneme_tab[phonPAUSE],2,p,0);
// DoSpect(p->ph,prev->ph,next->ph,2,p,0);
}
break;


+ 42
- 48
src/tr_languages.cpp View File

@@ -146,8 +146,9 @@ static Translator* NewTranslator(void)
tr->stress_lengths[ix] = stress_lengths2[ix];
}
memset(&(tr->langopts),0,sizeof(tr->langopts));
tr->langopts.max_lengthmod = 500;

tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.unstressed_wd1 = 1;
tr->langopts.unstressed_wd2 = 3;
tr->langopts.param[LOPT_SONORANT_MIN] = 95;
@@ -260,7 +261,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_af[8] = {170,140, 220,220, 0, 0, 250,270};
SetupTranslator(tr,stress_lengths_af,NULL);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.vowel_pause = 0x30;
tr->langopts.param[LOPT_DIERESES] = 1;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -279,7 +280,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_bn,stress_amps_bn);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable
tr->letter_bits_offset = OFFSET_BENGALI;
SetIndicLetters(tr); // call this after setting OFFSET_BENGALI
@@ -299,7 +300,7 @@ Translator *SelectTranslator(const char *name)

tr->charset_a0 = charsets[14]; // ISO-8859-14
// tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
// tr->langopts.intonation_group = 4;

// 'diminished' is an unstressed final syllable
@@ -320,7 +321,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_da[8] = {160,140, 200,200, 0,0, 220,210};
SetupTranslator(tr,stress_lengths_da,NULL);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_ORDINAL_DOT | NUM_1900;
}
@@ -330,7 +331,7 @@ Translator *SelectTranslator(const char *name)
case L('d','e'):
{
static const short stress_lengths_de[8] = {150,130, 200,200, 0, 0, 260,275};
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.word_gap = 0x8; // don't use linking phonemes
tr->langopts.vowel_pause = 0x30;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -346,7 +347,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_en[8] = {182,140, 220,220, 0,0, 248,275};
SetupTranslator(tr,stress_lengths_en,NULL);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.numbers = NUM_HUNDRED_AND | NUM_ROMAN | NUM_1900;
tr->langopts.param[LOPT_COMBINE_WORDS] = 2; // allow "mc" to cmbine with the following word
}
@@ -378,7 +379,7 @@ Translator *SelectTranslator(const char *name)
SetLetterBits(tr,LETTERGP_Y,el_fvowels); // front vowels: ε η ι υ

tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6; // mark unstressed final syllables as diminished
tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2;
@@ -408,7 +409,7 @@ Translator *SelectTranslator(const char *name)

tr->langopts.word_gap = 1;
tr->langopts.vowel_pause = 2;
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6 | 0x10;
tr->langopts.unstressed_wd1 = 3;
tr->langopts.unstressed_wd2 = 2;
@@ -429,7 +430,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_es,stress_amps_es);

tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;

// stress last syllable if it doesn't end in vowel or "s" or "n"
// 'diminished' is an unstressed final syllable
@@ -459,7 +460,7 @@ Translator *SelectTranslator(const char *name)
static const short stress_lengths_eu[8] = {200, 200, 200, 200, 0, 0, 210, 230}; // very weak stress
static const unsigned char stress_amps_eu[8] = {16,16, 18,18, 18,18, 18,18 };
SetupTranslator(tr,stress_lengths_eu,stress_amps_eu);
tr->langopts.stress_rule = 1; // ?? second syllable ??
tr->langopts.stress_rule = STRESSPOSN_2L; // ?? second syllable ??
tr->langopts.numbers = NUM_SINGLE_STRESS + NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_VIGESIMAL;
}
break;
@@ -479,7 +480,7 @@ Translator *SelectTranslator(const char *name)

SetupTranslator(tr,stress_lengths_fi,stress_amps_fi);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x56; // move secondary stress from light to a following heavy syllable
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.long_stop = 130;
@@ -499,7 +500,7 @@ Translator *SelectTranslator(const char *name)
static const unsigned char stress_amps_fr[8] = {18,16, 20,20, 20,22, 22,21 };

SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
tr->langopts.stress_rule = 3; // stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable
tr->langopts.stress_flags = 0x0024; // don't use secondary stress
tr->langopts.param[LOPT_IT_LENGTHEN] = 1; // remove lengthen indicator from unstressed syllables

@@ -508,14 +509,6 @@ Translator *SelectTranslator(const char *name)
}
break;

#ifdef deleted
case L('g','a'): // Irish Gaelic
{
tr->langopts.stress_rule = 1;
}
break;
#endif

case L('h','i'): // Hindi
case L('n','e'): // Nepali
case L('p','a'): // Punjabi
@@ -556,7 +549,7 @@ Translator *SelectTranslator(const char *name)
SetupTranslator(tr,stress_lengths_hr,stress_amps_hr);
tr->charset_a0 = charsets[2]; // ISO-8859-2

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5;
@@ -582,12 +575,12 @@ Translator *SelectTranslator(const char *name)
tr->charset_a0 = charsets[2]; // ISO-8859-2

tr->langopts.vowel_pause = 0x20;
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x8036;
tr->langopts.unstressed_wd1 = 2;
// tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x4; // don't propagate over word boundaries
tr->langopts.param[LOPT_IT_DOUBLING] = 1;
tr->langopts.param[LOPT_COMBINE_WORDS] = 99; // combine some prepositions with the following word
// tr->langopts.param[LOPT_COMBINE_WORDS] = 9; // combine some prepositions with the following word

tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_5 | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS | NUM_ORDINAL_DOT | NUM_OMIT_1_HUNDRED;
tr->langopts.min_roman = 1;
@@ -605,7 +598,7 @@ SetLengthMods(tr,3); // all equal
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0};

SetupTranslator(tr,stress_lengths_hy,NULL);
tr->langopts.stress_rule = 3; // default stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // default stress on final syllable

tr->letter_bits_offset = OFFSET_ARMENIAN;
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
@@ -623,7 +616,7 @@ SetLengthMods(tr,3); // all equal
static const unsigned char stress_amps_id[8] = {16,18, 18,18, 20,22, 22,21 };

SetupTranslator(tr,stress_lengths_id,stress_amps_id);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_ROMAN;
tr->langopts.stress_flags = 0x6 | 0x10;
tr->langopts.accents = 2; // "capital" after letter name
@@ -636,7 +629,7 @@ SetLengthMods(tr,3); // all equal
static const wchar_t is_lettergroup_B[] = {'c','f','h','k','p','t','x',0xfe,0}; // voiceless conants, including 'þ' ?? 's'

SetupTranslator(tr,stress_lengths_is,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10;
tr->langopts.param[LOPT_IT_LENGTHEN] = 0x11; // remove lengthen indicator from unstressed vowels
tr->langopts.param[LOPT_REDUCE] = 2;
@@ -659,7 +652,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_it,stress_amps_it);

tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x10 | 0x20000;
tr->langopts.vowel_pause = 1;
tr->langopts.unstressed_wd1 = 2;
@@ -681,12 +674,13 @@ SetLengthMods(tr,3); // all equal
static const wchar_t jbo_punct_within_word[] = {'.',',','\'',0x2c8,0}; // allow period and comma within a word, also stress marker (from LOPT_CAPS_IN_WORD)

SetupTranslator(tr,stress_lengths_jbo,NULL);
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.vowel_pause = 0x20c; // pause before a word which starts with a vowel, or after a word which ends in a consonant
// tr->langopts.word_gap = 1;
tr->punct_within_word = jbo_punct_within_word;
tr->langopts.param[LOPT_CAPS_IN_WORD] = 2; // capitals indicate stressed syllables
SetLetterVowel(tr,'y');
tr->langopts.max_lengthmod = 368;
}
break;

@@ -725,7 +719,7 @@ SetLengthMods(tr,3); // all equal
case L('l','a'): //Latin
{
tr->charset_a0 = charsets[4]; // ISO-8859-4, includes a,e,i,o,u-macron
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x20;
tr->langopts.unstressed_wd1 = 0;
tr->langopts.unstressed_wd2 = 2;
@@ -742,7 +736,7 @@ SetLengthMods(tr,3); // all equal

SetupTranslator(tr,stress_lengths_lv,stress_amps_lv);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.spelling_stress = 1;
tr->charset_a0 = charsets[4]; // ISO-8859-4
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
@@ -761,7 +755,7 @@ SetLengthMods(tr,3); // all equal
tr->charset_a0 = charsets[5]; // ISO-8859-5
tr->letter_groups[0] = vowels_cyrillic;

tr->langopts.stress_rule = 4; // antipenultimate
tr->langopts.stress_rule = STRESSPOSN_3R; // antipenultimate
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2;
tr->langopts.numbers2 = 0x8a; // variant numbers before thousands,milliards
}
@@ -772,7 +766,7 @@ SetLengthMods(tr,3); // all equal
{
static const short stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.vowel_pause = 1;
tr->langopts.param[LOPT_DIERESES] = 1;
tr->langopts.param[LOPT_PREFIXES] = 1;
@@ -788,7 +782,7 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_no[8] = {160,140, 200,200, 0,0, 220,210};

SetupTranslator(tr,stress_lengths_no,NULL);
tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_ALLOW_SPACE | NUM_1900 + NUM_ORDINAL_DOT;
}
@@ -800,8 +794,8 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_om[8] = {200,200, 200,200, 0,0, 200,200};

SetupTranslator(tr,stress_lengths_om,stress_amps_om);
tr->langopts.stress_rule = 2;
tr->langopts.stress_flags = 2 + NUM_SWAP_TENS | NUM_THOUS_SPACE | NUM_NOPAUSE; //??
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16 + 0x80000;
}
break;

@@ -813,7 +807,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);

tr->charset_a0 = charsets[2]; // ISO-8859-2
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6; // mark unstressed final syllables as diminished
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x8;
tr->langopts.max_initial_consonants = 7; // for example: wchrzczony :)
@@ -832,7 +826,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_pt,stress_amps_pt);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

tr->langopts.stress_rule = 3; // stress on final syllable
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable
tr->langopts.stress_flags = 0x6 | 0x10 | 0x20000;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_DFRACTION_2 | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_ROMAN;
SetLetterVowel(tr,'y');
@@ -848,7 +842,7 @@ SetLengthMods(tr,3); // all equal

SetupTranslator(tr,stress_lengths_ro,stress_amps_ro);

tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x100 + 0x6;

tr->charset_a0 = charsets[2]; // ISO-8859-2
@@ -863,7 +857,7 @@ SetLengthMods(tr,3); // all equal

case L('r','w'): // Kiryarwanda
{
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16;
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

@@ -880,7 +874,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_sk,stress_amps_sk);
tr->charset_a0 = charsets[2]; // ISO-8859-2

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x16;
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
tr->langopts.max_initial_consonants = 5;
@@ -889,7 +883,7 @@ SetLengthMods(tr,3); // all equal

tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;
tr->langopts.numbers2 = 0x100;
tr->langopts.thousands_sep = 0; //no thousands separator
tr->langopts.thousands_sep = STRESSPOSN_1L; //no thousands separator
tr->langopts.decimal_sep = ',';

if(name2 == L('c','s'))
@@ -911,7 +905,7 @@ SetLengthMods(tr,3); // all equal

SetupTranslator(tr,stress_lengths_sq,stress_amps_sq);

tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x16 + 0x100;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_DFRACTION_4;
@@ -926,7 +920,7 @@ SetLengthMods(tr,3); // all equal
static const short stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
SetupTranslator(tr,stress_lengths_sv,stress_amps_sv);

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
SetLetterVowel(tr,'y');
tr->langopts.numbers = NUM_SINGLE_STRESS + NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_1900;
tr->langopts.accents = 1;
@@ -942,7 +936,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

tr->langopts.vowel_pause = 1;
tr->langopts.stress_rule = 2;
tr->langopts.stress_rule = STRESSPOSN_2R;
tr->langopts.stress_flags = 0x6 | 0x10;

tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_SINGLE_AND | NUM_OMIT_1_HUNDRED;
@@ -961,7 +955,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_ta,stress_amps_ta);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable
tr->langopts.break_numbers = 0x24a8; // 1000, 100,000 10,000,000

@@ -1045,7 +1039,7 @@ SetLengthMods(tr,3); // all equal
SetupTranslator(tr,stress_lengths_vi,stress_amps_vi);
tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable

tr->langopts.stress_rule = 0;
tr->langopts.stress_rule = STRESSPOSN_1L;
tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word
// tr->langopts.vowel_pause = 4;
tr->letter_groups[0] = vowels_vi;
@@ -1064,7 +1058,7 @@ SetLengthMods(tr,3); // all equal

SetupTranslator(tr,stress_lengths_zh,stress_amps_zh);

tr->langopts.stress_rule = 3; // stress on final syllable of a "word"
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable of a "word"
tr->langopts.stress_flags = 2; // don't automatically set diminished stress (may be set in the intonation module)
tr->langopts.vowel_pause = 0;
tr->langopts.tone_language = 1; // Tone language, use CalcPitches_Tone() rather than CalcPitches()

+ 4
- 2
src/translate.cpp View File

@@ -1448,7 +1448,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
return(flags);
}

if((flags & FLAG_ALT2_TRANS) && ((sylimit = tr->langopts.param[LOPT_COMBINE_WORDS]) > 0))
if(flags & FLAG_COMBINE)
{
char *p2;
int ok = 1;
@@ -1456,6 +1456,8 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
int c_word2;
char ph_buf[N_WORD_PHONEMES];

sylimit = tr->langopts.param[LOPT_COMBINE_WORDS];

// LANG=cs,sk
// combine a preposition with the following word
p2 = word;
@@ -1492,7 +1494,7 @@ static int TranslateWord2(Translator *tr, char *word, WORD_TAB *wtab, int pre_pa
{
*p2 = '-'; // replace next space by hyphen
flags = TranslateWord(translator, word, next_pause, wtab); // translate the combined word
if(CountSyllables(p) > (sylimit & 0xf))
if((sylimit > 0) && (CountSyllables(p) > (sylimit & 0x1f)))
{
// revert to separate words
*p2 = ' ';

+ 10
- 0
src/translate.h View File

@@ -55,6 +55,7 @@
#define FLAG_DOUBLING 0x80000 // doubles the following consonant
#define FLAG_ALT_TRANS 0x100000 // language specific
#define FLAG_ALT2_TRANS 0x200000 // language specific
#define FLAG_COMBINE 0x400000 // combine with the next word

#define FLAG_MAX3 0x08000000 // limit to 3 repeats
#define FLAG_PAUSE1 0x10000000 // shorter prepause
@@ -296,6 +297,14 @@ extern const int param_defaults[N_SPEECH_PARAM];
#define LOPT_ALT 15


// stress_rule
#define STRESSPOSN_1L 0 // 1st syllable
#define STRESSPOSN_2L 1 // 2nd syllable
#define STRESSPOSN_2R 2 // penultimate
#define STRESSPOSN_1R 3 // final syllable
#define STRESSPOSN_3R 4 // antipenultimate


typedef struct {
// bits0-2 separate words with (1=pause_vshort, 2=pause_short, 3=pause, 4=pause_long 5=[?] phonemme)
// bit 3=don't use linking phoneme
@@ -408,6 +417,7 @@ typedef struct {
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
int max_lengthmod;
} LANGUAGE_OPTIONS;



+ 1
- 0
src/voice.h View File

@@ -30,6 +30,7 @@ typedef struct {
int speedf2;
int speedf3;

int speed_percent; // adjust the WPM speed by this percentage
int flutter;
int roughness;
int echo_delay;

+ 9
- 0
src/voices.cpp View File

@@ -104,6 +104,7 @@ enum {
V_MBROLA,
V_KLATT,
V_FAST,
V_SPEED,

// these need a phoneme table to have been specified
V_REPLACE,
@@ -150,6 +151,7 @@ static keywtab_t keyword_tab[] = {
{"consonants", V_CONSONANTS},
{"klatt", V_KLATT},
{"fast_test", V_FAST},
{"speed", V_SPEED},

// these just set a value in langopts.param[]
{"l_dieresis", 0x100+LOPT_DIERESES},
@@ -379,6 +381,7 @@ void VoiceReset(int tone_only)

voice->formant_factor = 256;

voice->speed_percent = 100;
voice->echo_delay = 0;
voice->echo_amp = 0;
voice->flutter = 64;
@@ -867,6 +870,10 @@ voice_t *LoadVoice(const char *vname, int control)
value = sscanf(p,"%d %d",&voice->consonant_amp, &voice->consonant_ampv);
break;

case V_SPEED:
sscanf(p,"%d",&voice->speed_percent);
break;

case V_MBROLA:
{
int srate = 16000;
@@ -911,6 +918,8 @@ voice_t *LoadVoice(const char *vname, int control)
new_translator = SelectTranslator(translator_name);
}

SetSpeed(1); // for speed_percent

for(ix=0; ix<N_PEAKS; ix++)
{
voice->freq2[ix] = voice->freq[ix];

Loading…
Cancel
Save