[1.31.09]

More fixes for &--; sequences.
lang=es: use phoneme [O] for letter 'o' except at end of word.
leng=es: attempt to improve single 'r' between two vowels.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@139 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2008-02-11 11:34:10 +00:00
parent c3d666f15c
commit ab7edfc7f7
22 changed files with 217 additions and 148 deletions
+4 -4
View File
@@ -275,12 +275,11 @@ static TONE_HEAD tone_head_table[N_TONE_HEAD_TABLE] = {
};
static TONE_NUCLEUS tone_nucleus_table[N_TONE_NUCLEUS_TABLE] = {
{PITCHfall, 30, 5, PITCHfall, 30, 8, NULL, 12, 7, 0}, // 0 statement
{PITCHfall, 30, 5, PITCHfall, 32, 9, NULL, 12, 7, 0}, // 0 statement
{PITCHfrise, 35, 8, PITCHfrise2, 35,10, NULL, 15, 23, 0}, // 1 comma
{PITCHfrise, 39,10, PITCHfrise2, 36,10, NULL, 15, 28, 0}, // 2 question
// {PITCHfall, 41, 4, PITCHfall, 41,27, NULL, 16, 4, T_EMPH}, // 3 exclamation
{PITCHfall, 43, 3, PITCHfall, 43,35, NULL, 35, 4, T_EMPH}, // 3 exclamation
// {PITCHrisefall,47, 8, PITCHrise, 48,30, NULL, 48, 5, T_EMPH}, // 3 exclamation
{PITCHfall, 41, 4, PITCHfall, 41,35, NULL, 35, 4, T_EMPH}, // 3 exclamation
{PITCHfall, 38, 2, PITCHfall, 42,30, NULL, 15, 5, 0}, // 4 statement, emphatic
{PITCHfall, 28, 5, PITCHfall, 28, 9, NULL, 12, 7, 0}, // 5 statement, less intonation
{PITCHfrise, 30, 8, PITCHfrise2, 30,10, NULL, 13, 20, 0}, // 6 comma, less intonation
@@ -772,6 +771,7 @@ void Translator::CalcPitches_Tone(int clause_tone)
if((p->type == phPAUSE) && (p->ph->std_length > 50))
{
pause = 1; // there is a pause since the previous vowel
prevw_tph = phoneme_tab[phonPAUSE]; // forget previous tone
}
if(p->newword)
@@ -817,7 +817,7 @@ void Translator::CalcPitches_Tone(int clause_tone)
}
}
if(prev_tph->mnemonic == 0x343132) // [214]
if(prevw_tph->mnemonic == 0x343132) // [214]
{
if(tph->mnemonic == 0x343132) // [214]
prev_p->tone_ph = LookupPh("35");
+58 -21
View File
@@ -1695,6 +1695,7 @@ MNEM_TAB xml_char_mnemonics[] = {
{"amp", '&'},
{"quot", '"'},
{"nbsp", ' '},
{"apos", '\''},
{NULL,-1}};
@@ -1723,13 +1724,18 @@ int Translator::ReadClause(FILE *f_in, char *buf, unsigned short *charix, int n_
int n_xml_buf;
int terminator;
int punct;
int found;
int any_alnum = 0;
int self_closing;
int punct_data;
const char *p;
char buf2[40];
wchar_t xml_buf[N_XML_BUF+1];
#define N_XML_BUF2 12
char buf2[N_XML_BUF2+2];
static char ungot_string[N_XML_BUF2+4];
static int ungot_string_ix = -1;
if(clear_skipping_text)
{
skipping_text = 0;
@@ -1752,14 +1758,13 @@ f_input = f_in; // for GetC etc
if(ungot_char2 != 0)
{
c2 = ungot_char2;
ungot_char2 = 0;
}
else
{
c2 = GetC();
}
while(!Eof() || (ungot_char != 0))
while(!Eof() || (ungot_char != 0) || (ungot_char2 != 0) || (ungot_string_ix >= 0))
{
if(!iswalnum(c1))
{
@@ -1782,47 +1787,79 @@ f_input = f_in; // for GetC etc
cprev = c1;
c1 = c2;
c2 = GetC();
if(Eof())
if(ungot_string_ix >= 0)
{
c2 = ' ';
if(ungot_string[ungot_string_ix] == 0)
ungot_string_ix = -1;
}
if((ungot_string_ix == 0) && (ungot_char2 == 0))
{
c1 = ungot_string[ungot_string_ix++];
}
if(ungot_string_ix >= 0)
{
c2 = ungot_string[ungot_string_ix++];
}
else
{
c2 = GetC();
if(Eof())
{
c2 = ' ';
}
}
ungot_char2 = 0;
if((option_ssml) && (phoneme_mode==0))
{
if((ssml_ignore_l_angle != '&') && (c1 == '&') && ((c2=='#') || ((c2 >= 'a') && (c2 <= 'z'))))
{
n_xml_buf = 0;
c1 = c2;
while(!Eof() && (iswalnum(c1) || (c1=='#')) && (n_xml_buf < 12))
while(!Eof() && (iswalnum(c1) || (c1=='#')) && (n_xml_buf < N_XML_BUF2))
{
buf2[n_xml_buf++] = c1;
c1 = GetC();
}
buf2[n_xml_buf] = 0;
c2 = GetC();
sprintf(ungot_string,"%s%c%c",&buf2[0],c1,c2);
if(buf2[0] == '#')
if(c1 == ';')
{
// character code number
c1 = '#'; // in case there isn't a number
if(buf2[1] == 'x')
sscanf(&buf2[2],"%x",(unsigned int *)(&c1));
if(buf2[0] == '#')
{
// character code number
if(buf2[1] == 'x')
found = sscanf(&buf2[2],"%x",(unsigned int *)(&c1));
else
found = sscanf(&buf2[1],"%d",&c1);
}
else
sscanf(&buf2[1],"%d",&c1);
{
if((found = LookupMnem(xml_char_mnemonics,buf2)) != -1)
{
c1 = found;
if(c2 == 0)
c2 = ' ';
}
}
}
else
{
if((j = LookupMnem(xml_char_mnemonics,buf2)) != -1)
{
c1 = j;
}
else
{
c1 = '&';
}
found = -1;
}
if(found <= 0)
{
ungot_string_ix = 0;
c1 = '&';
c2 = ' ';
}
if((sayas_mode == 0x14) && (c1 <= 0x20))
{
c1 += 0xe000; // move into unicode private usage area
+3
View File
@@ -310,6 +310,9 @@ void Translator::CalcLengths()
else
p->prepause = 60;
if(prev->type == phSTOP)
p->prepause = 60;
if((langopts.word_gap & 0x10) && (p->newword))
p->prepause = 60;
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.31.08 08.Feb.08";
const char *version_string = "1.31.09 11.Feb.08";
const int version_phdata = 0x013105;
int option_device_number = -1;