mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-15 10:02:42 +00:00
[1.39.04]
Reduce pause when announcing punctuation. Fix crash for list of numbers in some languages, eg: "22,23,24,25,26,27..." Recognise XLL (etc) is not a valid Roman number. espeak_Cancel(), reset punctuation echo. Don't permanently change option_phoneme_input after using [[ ]] internally. lang=af: Only recognise word "'n" as [@] when followed by a space. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@193 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
@@ -265,6 +265,7 @@ wxSashLayoutWindow *win;
|
||||
|
||||
f_trans = stdout;
|
||||
option_ssml = 1;
|
||||
option_phoneme_input = 1;
|
||||
|
||||
|
||||
// if(LoadVoice(voice_name,0) == NULL)
|
||||
|
||||
+2
-2
@@ -780,7 +780,7 @@ int Translator::TranslateRoman(char *word, char *ph_out)
|
||||
else
|
||||
repeat = 0;
|
||||
|
||||
if((prev==5) || (prev==50) || (prev==500))
|
||||
if((prev > 1) && (prev != 10) && (prev != 100))
|
||||
{
|
||||
if(value >= prev)
|
||||
return(0);
|
||||
@@ -1353,7 +1353,7 @@ int Translator::TranslateNumber_1(char *word, char *ph_out, unsigned int *flags,
|
||||
if(Lookup("_dpt2",buf1))
|
||||
strcat(ph_out,buf1);
|
||||
|
||||
if(c == langopts.decimal_sep)
|
||||
if((c == langopts.decimal_sep) && isdigit(word[n_digits+1]))
|
||||
{
|
||||
Lookup("_dpt",buf1);
|
||||
strcat(ph_out,buf1);
|
||||
|
||||
+6
-5
@@ -511,7 +511,7 @@ const char *Translator::LookupSpecial(const char *string, char* text_out)
|
||||
SetWordStress(phonemes,flags[0],-1,0);
|
||||
DecodePhonemes(phonemes,phonemes2);
|
||||
sprintf(text_out,"[[%s]]",phonemes2);
|
||||
option_phoneme_input = 1;
|
||||
option_phoneme_input |= 2;
|
||||
return(text_out);
|
||||
}
|
||||
return(NULL);
|
||||
@@ -589,13 +589,14 @@ const char *Translator::LookupCharName(int c)
|
||||
DecodePhonemes(phonemes,phonemes2);
|
||||
sprintf(buf,"[[%s]] ",phonemes2);
|
||||
}
|
||||
option_phoneme_input |= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(buf,"[[(X1)(X1)(X1)]]");
|
||||
option_phoneme_input |= 2;
|
||||
}
|
||||
|
||||
option_phoneme_input = 1;
|
||||
return(buf);
|
||||
}
|
||||
|
||||
@@ -806,9 +807,9 @@ int Translator::AnnouncePunctuation(int c1, int c2, char *buf, int bufix)
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(p,"%s %s %d %s %s [[______]]",
|
||||
sprintf(p,"%s %s %d %s %s",
|
||||
tone_punct_on,punctname,punct_count,punctname,tone_punct_off);
|
||||
option_phoneme_input = 1;
|
||||
return(CLAUSE_COMMA);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -836,7 +837,7 @@ int Translator::AnnouncePunctuation(int c1, int c2, char *buf, int bufix)
|
||||
if(iswspace(c2) && strchr_w(punct_stop,c1)!=NULL)
|
||||
return(punct_attributes[lookupwchar(punct_chars,c1)]);
|
||||
|
||||
return(CLAUSE_COMMA);
|
||||
return(CLAUSE_SHORTCOMMA);
|
||||
} // end of AnnouncePunctuation
|
||||
|
||||
#define SSML_SPEAK 1
|
||||
|
||||
@@ -490,6 +490,7 @@ int main (int argc, char **argv)
|
||||
option_waveout = 0;
|
||||
option_wordgap = 0;
|
||||
option_endpause = 1;
|
||||
option_phoneme_input = 1;
|
||||
option_multibyte = espeakCHARS_AUTO; // auto
|
||||
f_trans = stdout;
|
||||
|
||||
|
||||
@@ -1065,6 +1065,7 @@ ESPEAK_API espeak_ERROR espeak_Cancel(void)
|
||||
}
|
||||
SHOW_TIME("espeak_Cancel > LEAVE");
|
||||
#endif
|
||||
embedded_value[EMBED_T] = 0; // reset echo for pronunciation announcements
|
||||
return EE_OK;
|
||||
} // end of espeak_Cancel
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.39 08.Sep.08";
|
||||
const char *version_string = "1.39.04 19.Sep.08";
|
||||
const int version_phdata = 0x013900;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -1510,6 +1510,8 @@ int SpeakNextClause(FILE *f_in, const void *text_in, int control)
|
||||
}
|
||||
n_phoneme_list = 0;
|
||||
WcmdqStop();
|
||||
|
||||
embedded_value[EMBED_T] = 0;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,12 @@
|
||||
#define L_jbo 0x6a626f // jbo Lojban
|
||||
#define L_zhy 0x7a6879 // zhy
|
||||
|
||||
|
||||
// start of unicode pages for character sets
|
||||
#define OFFSET_GREEK 0x380
|
||||
#define OFFSET_CYRILLIC 0x420
|
||||
#define OFFSET_DEVANAGARI 0x900
|
||||
#define OFFSET_TAMIL 0xb80
|
||||
#define OFFSET_MALAYALAM 0xd00
|
||||
#define OFFSET_KOREAN 0x1100
|
||||
|
||||
|
||||
@@ -711,6 +712,7 @@ SetLengthMods(tr,3); // all equal
|
||||
break;
|
||||
|
||||
case L('t','a'): // Tamil
|
||||
case L('m','l'): // Malayalam
|
||||
{
|
||||
static const short stress_lengths_ta[8] = {200, 200, 210, 210, 0, 0, 230, 230};
|
||||
static const unsigned char stress_amps_ta[8] = {18,18, 18,18, 20,20, 22,22 };
|
||||
@@ -722,6 +724,11 @@ SetLengthMods(tr,3); // all equal
|
||||
tr->langopts.stress_rule = 0;
|
||||
tr->langopts.stress_flags = 0x10004; // use 'diminished' for unstressed final syllable
|
||||
tr->letter_bits_offset = OFFSET_TAMIL;
|
||||
|
||||
if(name2 == L('m','l'))
|
||||
{
|
||||
tr->letter_bits_offset = OFFSET_MALAYALAM;
|
||||
}
|
||||
tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels betwen words
|
||||
|
||||
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
|
||||
|
||||
+25
-5
@@ -55,7 +55,7 @@ int option_sayas = 0;
|
||||
int option_sayas2 = 0; // used in translate_clause()
|
||||
int option_emphasis = 0; // 0=normal, 1=normal, 2=weak, 3=moderate, 4=strong
|
||||
int option_ssml = 0;
|
||||
int option_phoneme_input = 1; // allow [[phonemes]] in input
|
||||
int option_phoneme_input = 0; // allow [[phonemes]] in input
|
||||
int option_phoneme_variants = 0; // 0= don't display phoneme variant mnemonics
|
||||
int option_wordgap = 0;
|
||||
|
||||
@@ -367,6 +367,9 @@ int IsAlpha(unsigned int c)
|
||||
if((c >= 0xb81) && (c <= 0xbe5))
|
||||
return(1); // Tamil vowel signs and other signs
|
||||
|
||||
if((c >= 0xd01) && (c <= 0xd57))
|
||||
return(1); // Malayalam vowel signs and other signs
|
||||
|
||||
if((c >= 0x300) && (c <= 0x36f))
|
||||
return(1); // combining accents
|
||||
|
||||
@@ -1938,7 +1941,7 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i
|
||||
|
||||
if(!iswalpha(prev_in))
|
||||
{
|
||||
if((c == '\'') && (next_in == 'n'))
|
||||
if((c == '\'') && (next_in == 'n') && isspace(ptr[1]))
|
||||
{
|
||||
// n preceded by either apostrophe or U2019 "right single quotation mark"
|
||||
ptr[0] = ' '; // delete the n
|
||||
@@ -2010,6 +2013,7 @@ void *Translator::TranslateClause(FILE *f_text, const void *vp_input, int *tone_
|
||||
int letter_count = 0;
|
||||
int space_inserted = 0;
|
||||
int syllable_marked = 0;
|
||||
int decimal_sep_count = 0;
|
||||
char *word;
|
||||
char *p;
|
||||
int j, k;
|
||||
@@ -2030,6 +2034,7 @@ void *Translator::TranslateClause(FILE *f_text, const void *vp_input, int *tone_
|
||||
|
||||
embedded_ix = 0;
|
||||
embedded_read = 0;
|
||||
option_phoneme_input &= 1; // clear bit 1 (temporary indication)
|
||||
|
||||
if((clause_start_char = count_characters) < 0)
|
||||
clause_start_char = 0;
|
||||
@@ -2264,6 +2269,7 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(iswdigit(prev_out))
|
||||
{
|
||||
if(!iswdigit(c) && (c != '.') && (c != ','))
|
||||
@@ -2272,6 +2278,13 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
|
||||
space_inserted = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(prev_in != ',')
|
||||
{
|
||||
decimal_sep_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if((c == '[') && (next_in == '[') && option_phoneme_input)
|
||||
{
|
||||
@@ -2455,10 +2468,17 @@ if((c == '/') && (langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_ou
|
||||
{
|
||||
}
|
||||
else
|
||||
if((prev_out != ' ') && !iswdigit(prev_out) && (prev_out != langopts.decimal_sep)) // TEST2
|
||||
if((prev_out != ' ') && !iswdigit(prev_out))
|
||||
{
|
||||
c = ' ';
|
||||
space_inserted = 1;
|
||||
if((prev_out != langopts.decimal_sep) || ((decimal_sep_count > 0) && (langopts.decimal_sep == ',')))
|
||||
{
|
||||
c = ' ';
|
||||
space_inserted = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
decimal_sep_count = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if((prev_out == ' ') && IsAlpha(sbuf[ix-2]) && !IsAlpha(prev_in))
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@
|
||||
#define CLAUSE_VOICE 0 + 0x24000
|
||||
#define CLAUSE_PERIOD 35 + 0x80000
|
||||
#define CLAUSE_COMMA 20 + 0x41000
|
||||
#define CLAUSE_SHORTCOMMA 15 + 0x41000
|
||||
#define CLAUSE_SHORTCOMMA 5 + 0x41000
|
||||
#define CLAUSE_QUESTION 35 + 0x82000
|
||||
#define CLAUSE_EXCLAMATION 40 + 0x83000
|
||||
#define CLAUSE_COLON 30 + 0x40000
|
||||
|
||||
Reference in New Issue
Block a user