lang=vi: recognise combining accent characters (for tone accents). Use a different intonation pattern, with more expression, for sentences which end in exclamation mark. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@112 d46cf337-b52f-0410-862d-fd96e6ae7743master
@@ -1,4 +1,4 @@ | |||
//maintainer: Willem van der Walt | |||
//maintainer: Willem van der Walt | |||
// email: [email protected] | |||
// tel: +27 12 8413996 | |||
// Meraka Institute, CSIR | |||
@@ -104,20 +104,32 @@ _roman rum'eIns@ | |||
// Place names | |||
alaska al'aska | |||
asië A:si@ | |||
babilon babilOn | |||
bangladesh baNglad'ES | |||
bastille bast'il | |||
bethlehem bEt_liEm | |||
boekarest bukarEst | |||
bonnievale _^_EN | |||
brittanje $2 | |||
caledon kalidOn | |||
carolina karul'ina | |||
ceres se@r@s | |||
ceylon s@lOn | |||
china S'ina | |||
franschhoek frA~nsh'uk | |||
gadara x2@dA:ra | |||
galilea x2al@l'i:a | |||
gariep x2ar'ip | |||
getsémané x2Ets'e@mani | |||
goudini $2 | |||
(graaff reinet) x2rA:f||r@n'Et | |||
griekeland x2rik@lant | |||
hermon $1 | |||
hirosjima hiruS'ima | |||
israel IsraI:l | |||
italië it'A:li;@ | |||
jerusalem j@r'ysalEm | |||
kanada kanad%a | |||
kanaän kA:nA:an | |||
kenia ki:nia | |||
@@ -139,6 +151,7 @@ tunisië $2 | |||
turkye $2 | |||
upington apiNt@n | |||
vesuvius v@su:viWs | |||
wellington wEliNt@n | |||
worcester v'ust@r | |||
zimbabwe zI:mb'ab_wE | |||
@@ -147,7 +160,9 @@ zimbabwe zI:mb'ab_wE | |||
// People names | |||
Abiméleg abin'e@lEx2 | |||
abraham A:bram | |||
ackerman ak@rman | |||
adrie A:dri | |||
aletta al'Eta | |||
alida al'ida | |||
allah %alA: | |||
André 'andreI | |||
@@ -155,18 +170,23 @@ annette an'Et | |||
antoinette antun'Et | |||
benjamin bEndZ@m@n | |||
bester b'Est@r | |||
beyers beI@rs | |||
blomerus blum'e@rWs | |||
botha bo@ta | |||
bouwer b@U@r | |||
breytenbach breIt@nbax2 | |||
brouwer bruw'&:r | |||
caesar siz@r | |||
carl kA:r@L | |||
cecilia s@si:lia | |||
charl SA:l | |||
charles _^_EN | |||
charlie tSA:li | |||
chopin S%OpA~ | |||
conradie $2 | |||
chris krIs | |||
christo krIstu | |||
christoffel kr@stOf@l | |||
christian krIstian | |||
christelle kr@st&l | |||
christine kr@st'i:n | |||
@@ -185,6 +205,7 @@ eksteen $1 | |||
elisabeth il'isabEt | |||
elize il'i:z | |||
elsabé &ls@bi | |||
emmarentia Emar'e~nSja | |||
eségiël is'e@x2i_@l | |||
estelle %ist&l | |||
etienne Eti@n | |||
@@ -199,6 +220,7 @@ freud frOId | |||
gabriël x2A:bri@l | |||
george _^_EN | |||
gerhard x2&rart | |||
gerhardus $2 | |||
gloria glO:ria | |||
gouws x2@Us | |||
grange x2rA:nsi | |||
@@ -206,6 +228,7 @@ gustav gustaf | |||
havenga hA:f@Nx2a | |||
haydn hAId@n | |||
helena hil'e@na | |||
helloïse hEluw'i:z | |||
herklaas $1 | |||
herman $1 | |||
hilde hild@ | |||
@@ -255,6 +278,7 @@ mozart mo@tsart | |||
naomi na_'o@mi | |||
natasha n%at'aSa | |||
naudé nOd'e@ | |||
neil _^_EN | |||
philip fIl@p | |||
phillips fIl@ps | |||
pierre p'e@r | |||
@@ -268,6 +292,7 @@ ronel run'&l | |||
rousseau r@s@U | |||
roux r'u | |||
salomo sA:l@mo@ | |||
sandra sandra | |||
schalk sk'alk | |||
scheepers ske@p@rs | |||
schmidt Smit | |||
@@ -290,6 +315,7 @@ vincent _^_EN | |||
violet _^_EN $capital | |||
william _^_EN | |||
yolande jul'and@ | |||
yvonne iv'On | |||
zyl seIl | |||
marais mar'E: | |||
mandela mand'E:la | |||
@@ -457,16 +483,20 @@ aangaande $2 | |||
aanstaande $2 | |||
adagio ad'A:dZi;%@U | |||
afkere afke@r@ | |||
agamemnon ax2am'EmnOn | |||
agterstevoor $4 | |||
agterweë $3 | |||
algaande $2 | |||
algehele alx2@h,e@l@ | |||
allegro al'Egru | |||
alles al@s | |||
almiskie $3 | |||
alom al_'Om | |||
alreeds $2 | |||
alternatiewe $4 | |||
amen A:mEn | |||
anatomie $4 | |||
anale an'A:l@ | |||
anatomie $4 $only | |||
asof asOf | |||
asook %as_o@k | |||
aspris $2 | |||
@@ -474,6 +504,7 @@ asseblief as@bl'if | |||
attraksie $2 | |||
babelaas bab@lA:s | |||
barrikade $3 | |||
beide beId@ | |||
belangriker b@laNr@k,Ir | |||
belangrikst@ b@laNr@kst@ | |||
@@ -482,6 +513,7 @@ beswil bEsv@l | |||
bêre b&:r@ | |||
beskryf b@skr'eIf | |||
bestes bEst@s | |||
beta be@ta | |||
bewe be@v@ | |||
bewend be@v@nt | |||
bewering b@ve@rIN | |||
@@ -490,6 +522,7 @@ bostaande b'o@stA:nd@ | |||
cabernet kab@rn'eI | |||
camembert kam@mb'&:r | |||
camouflage kamufl'A:Z | |||
charisma kar'Isma | |||
chemikalieë $3 | |||
dadelik dA:d@lIk | |||
@@ -499,20 +532,24 @@ dekade dEk'A:d@ | |||
deurentyd dy@r@nteIt | |||
deurgaans $1 | |||
deurkruis $2 | |||
deurstraalde $2 | |||
dikwels dIkv@ls | |||
diplomasie d@plo@mas'i | |||
dusver dWsf&r | |||
eenkeer $1 | |||
efesiër if'e@si@r | |||
effense Ef@ns@ | |||
ekself %&ks'&lf | |||
ekstra Ekstra | |||
elders &ld@rs | |||
elite il'i:t | |||
enige e@nIx2@ | |||
eone $2 | |||
era e@ra | |||
erger &rg@r | |||
espeak i:;spi:k | |||
(et cetera) Ets'Et@ra | |||
euro Y@ru | |||
exodus Eks'o@dWs | |||
@@ -520,6 +557,8 @@ figuur f@x2yr | |||
filippense f@l@pEns@ | |||
finalis $3 | |||
finaliste $3 | |||
fort fOrt | |||
forte fOrt@ | |||
frontaal $2 | |||
frontale $2 | |||
@@ -539,14 +578,15 @@ graffiti graf'iti | |||
gratis x2r'A:t@s | |||
hallo h'Il,@U | |||
hanteer $2 | |||
hanou hA:n@U | |||
hardop hart?Op | |||
hasepad hA:s@pat | |||
heeltemal he@lt@mal | |||
heengaan he@nx2A:n | |||
hek h&k | |||
hekke h&k@ | |||
helaas he@l'A:s | |||
here he@r@ | |||
herero hEr'E:ru | |||
herrysenis h&r'eIs@n@s | |||
hiernamaals hi:rn'A:mA:ls | |||
hierso hi:rsO | |||
@@ -554,13 +594,17 @@ hoera hur'A: | |||
hoewel huv'&l | |||
hokaai hOkAI | |||
hoofsaaklik $2 | |||
hosanna hus'ana | |||
ibis $1 | |||
idee $2 | |||
idilles id'Il@s | |||
ignoreer ix2no@r'e@r | |||
inagneming @nax2ne@m@N | |||
indien Indin $verb | |||
inkatha iNk'A:ta | |||
inkluis $2 | |||
insomnia @nsOmnija | |||
intens @nt'Ens | |||
intensiteit $4 | |||
@@ -568,16 +612,21 @@ jawoord jA:vo@rt | |||
jupiter jupit@r | |||
kafee kaf'e@ | |||
katswink katsv@nk | |||
kaviaar kavi'A:r | |||
klaasvakie $2 | |||
knapsekêrel knaps@k&:r@l | |||
komaan kOmA:n | |||
konkawe kOnk'A:v@ | |||
kopiereg kup'ir&x2 | |||
korswel kOrsv@l | |||
kotiljons kOt@lj'o~ns | |||
kritiek krIt'ik | |||
kulture $2 | |||
kunsmatige kWnsm'A:t@x2@ | |||
kwansuis $2 | |||
latere l'A:t@r@ | |||
lekker l&k@r | |||
lekkerder l&k@rd@r | |||
lekkerste l&k@rst@ | |||
@@ -611,7 +660,6 @@ negering n@x2e@r@N | |||
netjies nE:icis | |||
netjiese nEicis@ | |||
netsowel nEtso@v&l | |||
nietemin n'it@m@n | |||
nimmermeer $1 | |||
nobelprys $2 | |||
normale nOrm'A:l@ | |||
@@ -663,7 +711,7 @@ petite p@tit | |||
pinotage pinut'A:Z | |||
pirouette p@ru:'Et | |||
reeds re@ts | |||
rebelleer r@b@le@r | |||
retireer r@t@re@:r | |||
retoriek r@tur'ik | |||
rimpeling rImp@l@N | |||
@@ -693,6 +741,7 @@ sonop sOn_Op | |||
sover so@f&r | |||
spesmaas $2 | |||
stabiel stab'il | |||
staccato $2 | |||
terdeë $2 | |||
terug t@-rWx2 | |||
@@ -702,7 +751,7 @@ tevrede t@fre@d@ | |||
toegee tux2e@ | |||
totale tut'A:l@ | |||
totsiens $2 | |||
tragiek trax2'ik | |||
uitdaging YydA:x2@N | |||
uiteraard Yyt@r_'A:rt | |||
@@ -721,6 +770,7 @@ verdere f&rd@r@ | |||
vererger f@r&rg@r | |||
ver f'&:r | |||
verg f&rx2 | |||
vergeleë f&:rx2@l,e@@ | |||
vergete f@rx2e@t@ | |||
vermy $2 | |||
verre f&:r@ | |||
@@ -733,6 +783,7 @@ verte f&rt@ | |||
vertes f&rt@s | |||
via via | |||
volheid $1 | |||
volte $1 | |||
voluit fOl_Yyt | |||
voorgee fo@rx2e@ | |||
voorkeer $1 |
@@ -244,15 +244,11 @@ v w x z | |||
Dictionary vi_dict | |||
@ @: @:I @:U @I @U a a: | |||
a:I a:U aI aU E e eU EU | |||
i i@ iU O o OI oI u | |||
u@ uI y y@ yI | |||
b c d D f g h j | |||
k kh l m n N n^ p | |||
Q s t t[ ts; tS; v w | |||
x z Z z; | |||
@: a a: a:I aI aU E e | |||
i o | |||
b d g h k m n p | |||
s t t[ ts; v w z | |||
Dictionary zhy_dict |
@@ -150,6 +150,7 @@ ai $abbrev | |||
api $abbrev | |||
asap $abbrev | |||
awol eIw0l | |||
cia $abbrev | |||
cio $abbrev | |||
ctrl k0ntr'oUl | |||
dept dI2pA@tm@nt |
@@ -1,4 +1,80 @@ | |||
// replace combining (tone) accents with single characters | |||
.replace | |||
à à | |||
á á | |||
ả ả | |||
ã ã | |||
ạ ạ | |||
ằ ằ | |||
ắ ắ | |||
ẳ ẳ | |||
ẵ ẵ | |||
ặ ặ | |||
ầ ầ | |||
ấ ấ | |||
ẩ ẩ | |||
ẫ ẫ | |||
ậ ậ | |||
è è | |||
é é | |||
ẻ ẻ | |||
ẽ ẽ | |||
ẹ ẹ | |||
ề ề | |||
ế ế | |||
ể ể | |||
ễ ễ | |||
ệ ệ | |||
ì ì | |||
í í | |||
ỉ ỉ | |||
ĩ ĩ | |||
ị ị | |||
ò ò | |||
ó ó | |||
ỏ ỏ | |||
õ õ | |||
ọ ọ | |||
ồ ồ | |||
ố ố | |||
ổ ổ | |||
ỗ ỗ | |||
ộ ộ | |||
ờ ờ | |||
ớ ớ | |||
ở ở | |||
ỡ ỡ | |||
ợ ợ | |||
ù ù | |||
ú ú | |||
ủ ủ | |||
ũ ũ | |||
ụ ụ | |||
ừ ừ | |||
ứ ứ | |||
ử ử | |||
ữ ữ | |||
ự ự | |||
ỳ ỳ | |||
ý ý | |||
ỷ ỷ | |||
ỹ ỹ | |||
ỵ ỵ | |||
.group a | |||
a a: | |||
ai a:I | |||
@@ -572,4 +648,3 @@ | |||
$ d'o||l'a | |||
% f'@2n||tS;'am | |||
@@ -924,8 +924,6 @@ vdiph/@u [u:] en_wm | |||
vdiph/@u_2 [oU] en_rp | |||
vdiph/@u_3 [@U] ro | |||
vdiph/@u_en [oU] en | |||
[@U] vi | |||
[@:U] vi | |||
vdiph/ui [uI] base2 | |||
[uI] en | |||
[uI] eo | |||
@@ -940,6 +938,8 @@ vdiph/Vi [@:I] vi | |||
vdiph/Vu [@U] af | |||
vdiph/Vu_2 [oU] en_wm | |||
vdiph/Vu_3 [o:] nl | |||
vdiph/Vu_4 [@U] vi | |||
[@:U] vi | |||
vdiph/&y [&y] fi | |||
[Wy] nl | |||
vdiph/yi [yi] fi | |||
@@ -1501,8 +1501,8 @@ vowel/V_2 [V] en | |||
[V#] ru | |||
vowel/V_3 [V] en_rp | |||
[V] hi | |||
[@:] vi | |||
vowel/V_4 [V] en_sc | |||
[@:] vi | |||
vowel/V_6 [V] en_us | |||
vowel/y [y:] en | |||
[y:] de |
@@ -71,7 +71,7 @@ endphoneme | |||
phoneme a: | |||
vowel starttype (a) endtype (a) | |||
length 260 | |||
length 280 | |||
formants vowel/a_2 | |||
endphoneme | |||
@@ -134,8 +134,8 @@ endphoneme | |||
phoneme @: | |||
vowel starttype (@) endtype (@) | |||
length 260 | |||
formants vowel/V_3 | |||
length 280 | |||
formants vowel/V_4 | |||
endphoneme | |||
@@ -223,7 +223,7 @@ endphoneme | |||
phoneme a:U | |||
vowel starttype (a) endtype (u) | |||
length 250 | |||
length 260 | |||
formants vdiph/au | |||
endphoneme | |||
@@ -250,20 +250,20 @@ endphoneme | |||
phoneme @U | |||
vowel starttype (@) endtype (u) | |||
length 200 | |||
formants vdiph/@u_en | |||
formants vdiph/Vu_4 | |||
endphoneme | |||
phoneme @:U | |||
vowel starttype (@) endtype (u) | |||
length 250 | |||
formants vdiph/@u_en | |||
length 260 | |||
formants vdiph/Vu_4 | |||
endphoneme | |||
phoneme i@ | |||
vowel starttype (i) endtype (@) | |||
length 230 | |||
length 240 | |||
formants vdiph2/ii@_3 | |||
endphoneme | |||
@@ -668,7 +668,7 @@ void copy_rule_string(char *string, int &state) | |||
if(c == '\\') | |||
{ | |||
c = *p++; // treat next character literally | |||
if((c >= '0') && (c <= '2') && (p[0] >= '0') && (p[0] <= '7') && (p[1] >= '0') && (p[1] <= '7')) | |||
if((c >= '0') && (c <= '3') && (p[0] >= '0') && (p[0] <= '7') && (p[1] >= '0') && (p[1] <= '7')) | |||
{ | |||
// character code given by 3 digit octal value; | |||
c = (c-'0')*64 + (p[0]-'0')*8 + (p[1]-'0'); |
@@ -236,82 +236,68 @@ unsigned char *envelope_data[16] = { | |||
// pitch change during the main part of the clause | |||
static int drops_0[8] = {0x400,0x400,0x700,0x700,0x700,0xa00,0x1800,0x0e00}; | |||
static int drops_1[8] = {0x400,0x400,0x600,0x600,0xc00,0xc00,0x0e00,0x0e00}; | |||
static int drops_2[8] = {0x400,0x400,0x600,0x600,-0x800,0xc00,0x0e00,0x0e00}; | |||
//static int drops_1[8] = {0x400,0x400,0x600,0x600,0xc00,0xc00,0x0e00,0x0e00}; | |||
//static int drops_2[8] = {0x400,0x400,0x600,0x600,-0x800,0xc00,0x0e00,0x0e00}; | |||
static short oflow[] = {0, 20, 12, 4, 0}; | |||
static short oflow_emf[] = {5, 24, 15, 10, 5}; | |||
static short oflow_less[] = {1, 17, 10, 5, 1}; | |||
static short back_emf[] = {36, 32, 0}; | |||
typedef struct { | |||
unsigned char pitch_env0; /* pitch envelope, tonic syllable at end */ | |||
unsigned char tonic_max0; | |||
unsigned char tonic_min0; | |||
unsigned char pitch_env0; /* pitch envelope, tonic syllable at end */ | |||
unsigned char tonic_max0; | |||
unsigned char tonic_min0; | |||
unsigned char pitch_env1; /* followed by unstressed */ | |||
unsigned char tonic_max1; | |||
unsigned char tonic_min1; | |||
unsigned char pitch_env1; /* followed by unstressed */ | |||
unsigned char tonic_max1; | |||
unsigned char tonic_min1; | |||
unsigned char pre_start; | |||
unsigned char pre_end; | |||
unsigned char pre_start; | |||
unsigned char pre_end; | |||
unsigned char body_start; | |||
unsigned char body_end; | |||
unsigned char body_start; | |||
unsigned char body_end; | |||
int *body_drops; | |||
unsigned char body_max_steps; | |||
unsigned char body_lower_u; | |||
int *body_drops; | |||
unsigned char body_max_steps; | |||
unsigned char body_lower_u; | |||
char n_overflow; | |||
short *overflow; | |||
short *backwards; | |||
unsigned char tail_start; | |||
unsigned char tail_end; | |||
unsigned char tail_shape; | |||
unsigned char tail_start; | |||
unsigned char tail_end; | |||
unsigned char tail_shape; | |||
} TONE_TABLE; | |||
#define N_TONE_TABLE 15 | |||
static TONE_TABLE tone_table[N_TONE_TABLE] = { | |||
{PITCHfall, 30, 5, PITCHfall, 30, 8, // statement | |||
20, 25, 34, 22, drops_0, 3, 3, 12, 7, 0}, | |||
20, 25, 34, 22, drops_0, 3, 3, 5, oflow, NULL, 12, 7, 0}, | |||
{PITCHfrise, 37,10, PITCHfrise2, 35,10, // comma | |||
20, 25, 34, 20, drops_0, 3, 3, 15, 24, 0}, | |||
20, 25, 34, 20, drops_0, 3, 3, 5, oflow, NULL, 15, 24, 0}, | |||
{PITCHfrise, 39,10, PITCHfrise2, 36,10, // question | |||
20, 25, 34, 20, drops_0, 3, 3, 15, 29, 0}, | |||
{PITCHfall, 36, 0, PITCHfall, 40, 30, // statement, emphatic | |||
20, 25, 34, 22, drops_0, 3, 3, 20, 4, 0}, | |||
#ifdef deleted | |||
{PITCHfall, 30, 5, PITCHfall, 30, 7, // statement | |||
20, 25, 34, 22, drops_1, 3, 3, 12, 8, 0}, | |||
{PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | |||
20, 25, 34, 20, drops_1, 3, 3, 15, 25, 0}, | |||
{PITCHfall, 30, 5, PITCHfall, 30, 7, // exclamation | |||
20, 25, 34, 22, drops_1, 3, 3, 12, 8, 0}, | |||
20, 25, 34, 20, drops_0, 3, 3, 5, oflow, NULL, 15, 29, 0}, | |||
{PITCHfall, 41, 4, PITCHfall, 41, 27, // exclamation | |||
20, 25, 34, 24, drops_0, 3, 4, 5, oflow_emf, back_emf, 18, 5, 0}, | |||
{PITCHfall, 38, 2, PITCHfall, 42, 30, // statement, emphatic | |||
20, 25, 34, 22, drops_0, 3, 3, 5, oflow, NULL, 15, 5, 0}, | |||
{PITCHfall, 30, 5, PITCHfall, 30, 7, // statement | |||
20, 25, 34, 22, drops_2, 3, 3, 12, 8, 0}, | |||
{PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | |||
20, 25, 34, 20, drops_2, 3, 3, 15, 25, 0}, | |||
{PITCHfall, 28, 6, PITCHfall, 28, 10, // statement, less intonation | |||
20, 25, 30, 22, drops_0, 4, 3, 5, oflow_less, NULL, 12, 6, 0}, | |||
{PITCHfall, 30, 5, PITCHfall, 30, 7, // exclamation | |||
20, 25, 34, 22, drops_2, 3, 3, 12, 8, 0}, | |||
{PITCHfrise2, 34,12, PITCHfall, 28,10, // comma, less intonation | |||
20, 25, 30, 22, drops_0, 4, 3, 5, oflow_less, NULL, 9,14, 0}, | |||
// alternatives | |||
{PITCHfall, 36, 6, PITCHfall, 36, 8, | |||
30, 20, 18, 34, drops_0, 3, 3, 12, 8, 0}, | |||
{PITCHfrise, 38, 8, PITCHfrise2, 36, 8, | |||
30, 20, 18, 34, drops_0, 3, 3, 20, 32, 0}, | |||
{PITCHfall, 36, 6, PITCHfall, 36, 8, | |||
30, 20, 18, 34, drops_0, 3, 3, 12, 8, 0}, | |||
#endif | |||
}; | |||
@@ -351,7 +337,7 @@ static void count_pitch_vowels(int start, int end, int clause_end) | |||
number_pre = -1; /* number of vowels before 1st primary stress */ | |||
number_body = 0; | |||
number_tail = 0; /* number between tonic syllable and next primary */ | |||
last_primary = 0; | |||
last_primary = -1; | |||
last2_primary = 0; | |||
for(ix=start; ix<end; ix++) | |||
@@ -382,7 +368,7 @@ static void count_pitch_vowels(int start, int end, int clause_end) | |||
} | |||
if(number_pre < 0) | |||
number_pre = 0; | |||
number_pre = end; | |||
number_tail = end - max_stress_posn - 1; | |||
tone_posn = max_stress_posn; | |||
@@ -393,9 +379,17 @@ static void count_pitch_vowels(int start, int end, int clause_end) | |||
tone_posn = tone_posn2 = end-1; | |||
} | |||
else | |||
if(end == clause_end) | |||
if(last_primary >= 0) | |||
{ | |||
if(end == clause_end) | |||
{ | |||
syllable_tab[last_primary].stress = PRIMARY_LAST; | |||
} | |||
} | |||
else | |||
{ | |||
syllable_tab[last_primary].stress = PRIMARY_LAST; | |||
// no primary stress. Use the highest stress | |||
syllable_tab[tone_posn].stress = PRIMARY_LAST; | |||
} | |||
} /* end of count_pitch_vowels */ | |||
@@ -412,8 +406,8 @@ static int count_increments(int ix, int end_ix, int min_stress) | |||
while(ix < end_ix) | |||
{ | |||
stress = syllable_tab[ix++].stress; | |||
// if(stress >= PRIMARY_MARKED) | |||
// break; | |||
if(stress >= PRIMARY_LAST) | |||
break; | |||
if(stress >= min_stress) | |||
count++; | |||
@@ -466,14 +460,15 @@ static int calc_pitch_segment(int ix, int end_ix, TONE_TABLE *t, int min_stress, | |||
int pitch=0; | |||
int increment=0; | |||
int n_primary=0; | |||
int n_steps=0; | |||
int initial; | |||
int overflow=0; | |||
int n_overflow; | |||
int *drops; | |||
short *overflow_tab; | |||
SYLLABLE *syl; | |||
static short overflow_tab1[5] = {0, 20, 12, 4, 0}; | |||
static short continue_tab[5] = {-14, 16, 10, 4, 0}; | |||
static short continue_tab[5] = {-13, 16, 10, 4, 0}; | |||
drops = t->body_drops; | |||
@@ -481,13 +476,15 @@ static int calc_pitch_segment(int ix, int end_ix, TONE_TABLE *t, int min_stress, | |||
{ | |||
initial =0; | |||
overflow = 0; | |||
n_overflow = 5; | |||
overflow_tab = continue_tab; | |||
increment = (t->body_end - t->body_start) << 8; | |||
increment = increment / (t->body_max_steps -1); | |||
} | |||
else | |||
{ | |||
overflow_tab = overflow_tab1; | |||
n_overflow = t->n_overflow; | |||
overflow_tab = t->overflow; | |||
initial = 1; | |||
} | |||
@@ -503,19 +500,19 @@ static int calc_pitch_segment(int ix, int end_ix, TONE_TABLE *t, int min_stress, | |||
{ | |||
// a primary stress | |||
if(initial) | |||
if((initial) || (stress == 5)) | |||
{ | |||
initial = 0; | |||
overflow = 0; | |||
n_primary = count_increments(ix,end_ix,min_stress); | |||
n_steps = n_primary = count_increments(ix,end_ix,min_stress); | |||
if(n_primary > t->body_max_steps) | |||
n_primary = t->body_max_steps; | |||
if(n_steps > t->body_max_steps) | |||
n_steps = t->body_max_steps; | |||
if(n_primary > 1) | |||
if(n_steps > 1) | |||
{ | |||
increment = (t->body_end - t->body_start) << 8; | |||
increment = increment / (n_primary -1); | |||
increment = increment / (n_steps -1); | |||
} | |||
else | |||
increment = 0; | |||
@@ -524,20 +521,26 @@ static int calc_pitch_segment(int ix, int end_ix, TONE_TABLE *t, int min_stress, | |||
} | |||
else | |||
{ | |||
if(n_primary > 0) | |||
if(n_steps > 0) | |||
pitch += increment; | |||
else | |||
{ | |||
pitch = (t->body_end << 8) - (increment * overflow_tab[overflow++])/16; | |||
if(overflow > 4) | |||
if(overflow >= n_overflow) | |||
{ | |||
overflow = 0; | |||
overflow_tab = overflow_tab1; | |||
overflow_tab = t->overflow; | |||
} | |||
} | |||
} | |||
n_steps--; | |||
n_primary--; | |||
if((t->backwards) && (n_primary < 2)) | |||
{ | |||
pitch = t->backwards[n_primary] << 8; | |||
} | |||
} | |||
if(stress >= PRIMARY) | |||
@@ -889,7 +892,7 @@ void Translator::CalcPitches(int clause_type) | |||
option = 0; | |||
group_tone_emph = group_tone = punct_to_tone[option][clause_type]; | |||
group_tone_emph = punct_to_tone[option][3]; // emphatic form of statement | |||
group_tone_emph = punct_to_tone[option][4]; // emphatic form of statement | |||
if(clause_type == 4) | |||
no_tonic = 1; /* incomplete clause, used for abbreviations such as Mr. Dr. Mrs. */ | |||
@@ -924,11 +927,23 @@ void Translator::CalcPitches(int clause_type) | |||
if(syl->stress >= 4) | |||
count_primary++; | |||
if((syl->stress == 6) && (syllable_tab[st_ix+1].stress == 6)) | |||
if(syl->stress == 6) | |||
{ | |||
syllable_tab[st_ix].flags = 2; | |||
syl->stress = 4; | |||
// are the next primary syllables also emphasized ? | |||
for(ix=st_ix+1; ix<n_st; ix++) | |||
{ | |||
if(syllable_tab[ix].stress == 4) | |||
break; | |||
if(syllable_tab[ix].stress == 6) | |||
{ | |||
// emphasize this syllable, but don't end the current tone group | |||
syllable_tab[st_ix].flags = 2; | |||
syl->stress = 5; | |||
break; | |||
} | |||
} | |||
} | |||
if(syl->stress == 6) | |||
{ | |||
// an emphasized syllable, end the tone group after the next primary stress |
@@ -35,7 +35,7 @@ | |||
#include "translate.h" | |||
#include "wave.h" | |||
const char *version_string = "1.29.25 14.Dec.07"; | |||
const char *version_string = "1.29.26 18.Dec.07"; | |||
const int version_phdata = 0x012924; | |||
int option_device_number = -1; |
@@ -341,8 +341,8 @@ unsigned char *length_mod_tabs[6] = { | |||
/* index by 0=. 1=, 2=?, 3=! 4=none */ | |||
static unsigned char punctuation_to_tone[4][5] = { | |||
{0,1,2,3,0}, | |||
{0,1,2,3,0}, | |||
{0,1,2,3,4}, | |||
{5,6,2,0,4}, | |||
{0,1,2,3,0}, | |||
{0,1,2,3,0} }; | |||
@@ -369,6 +369,9 @@ int IsAlpha(unsigned int c) | |||
if((c >= 0x901) && (c <= 0x957)) | |||
return(1); // Devanagari vowel signs and other signs | |||
if((c >= 0x300) && (c <= 0x36f)) | |||
return(1); // combining accents | |||
return(0); | |||
} | |||
@@ -821,9 +821,11 @@ static void WavegenSetEcho(void) | |||
if(delay == 0) | |||
amp = 0; | |||
echo_head = (delay * samplerate)/1000; | |||
echo_length = echo_head; // ensure completion of echo at the end of speech | |||
// echo_length = echo_head * 2; // perhaps allow 2 echo periods at the end of speech ? | |||
echo_length = echo_head; // ensure completion of echo at the end of speech. Use 1 delay period? | |||
if(amp > 20) | |||
echo_length = echo_head * 2; // perhaps allow 2 echo periods if the echo is loud. | |||
// echo_amp units are 1/256ths of the amplitude of the original sound. | |||
echo_amp = amp; |