mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
[1.46.38]
Speak names of characters in non-native alphabets (eg. non-Latin). Language changes: en, nl, pt. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@304 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+25
-25
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2005 to 2011 by Jonathan Duddington *
|
||||
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
|
||||
* email: jonsd@users.sourceforge.net *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -58,7 +58,7 @@ static const char *ungot_word = NULL;
|
||||
static int end_of_input;
|
||||
|
||||
static int ignore_text=0; // set during <sub> ... </sub> to ignore text which has been replaced by an alias
|
||||
static int audio_text=0; // set during <audio> ... </audio>
|
||||
static int audio_text=0; // set during <audio> ... </audio>
|
||||
static int clear_skipping_text = 0; // next clause should clear the skipping_text flag
|
||||
int count_characters = 0;
|
||||
static int sayas_mode;
|
||||
@@ -110,7 +110,7 @@ static const unsigned short punct_chars[] = {',','.','?','!',':',';',
|
||||
0xff1a, // fullwidth colon
|
||||
0xff1b, // fullwidth semicolon
|
||||
0xff1f, // fullwidth question mark
|
||||
|
||||
|
||||
0};
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ static int GetC_get(void)
|
||||
end_of_input = 1;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
if(!end_of_input)
|
||||
{
|
||||
if(option_multibyte == espeakCHARS_16BIT)
|
||||
@@ -563,8 +563,8 @@ static void UngetC(int c)
|
||||
}
|
||||
|
||||
|
||||
static const char *WordToString2(unsigned int word)
|
||||
{//================================================
|
||||
const char *WordToString2(unsigned int word)
|
||||
{//============================================
|
||||
// Convert a language mnemonic word into a string
|
||||
int ix;
|
||||
static char buf[5];
|
||||
@@ -961,7 +961,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output
|
||||
|
||||
if(attributes & CLAUSE_BIT_SENTENCE)
|
||||
return(attributes);
|
||||
|
||||
|
||||
return(short_pause);
|
||||
} // end of AnnouncePunctuation
|
||||
|
||||
@@ -1078,7 +1078,7 @@ static const char *VoiceFromStack()
|
||||
}
|
||||
p += (strlen(p) + 1);
|
||||
}
|
||||
|
||||
|
||||
if(voice_name_specified == 0)
|
||||
voice_name[0] = 0; // forget a previous voice name if a language is specified
|
||||
}
|
||||
@@ -1248,7 +1248,7 @@ static wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name)
|
||||
static int attrcmp(const wchar_t *string1, const char *string2)
|
||||
{//============================================================
|
||||
int ix;
|
||||
|
||||
|
||||
if(string1 == NULL)
|
||||
return(1);
|
||||
|
||||
@@ -1334,7 +1334,7 @@ static int attr_prosody_value(int param_type, const wchar_t *pw, int *value_out)
|
||||
}
|
||||
if(*pw == '-')
|
||||
{
|
||||
pw++;
|
||||
pw++;
|
||||
sign = -1;
|
||||
}
|
||||
value = (double)wcstod(pw,&tail);
|
||||
@@ -1485,10 +1485,10 @@ static int GetVoiceAttributes(wchar_t *pw, int tag_type)
|
||||
age = GetSsmlAttribute(pw,"age");
|
||||
gender = GetSsmlAttribute(pw,"gender");
|
||||
}
|
||||
|
||||
|
||||
if((tag_type != SSML_VOICE) && (lang==NULL))
|
||||
return(0); // <s> or <p> without language spec, nothing to do
|
||||
|
||||
|
||||
ssml_sp = &ssml_stack[n_ssml_stack++];
|
||||
|
||||
attrcopy_utf8(ssml_sp->language,lang,sizeof(ssml_sp->language));
|
||||
@@ -1592,7 +1592,7 @@ static int ReplaceKeyName(char *outbuf, int index, int &outix)
|
||||
{"underscore ", 0xe05f},
|
||||
{"double-quote ", '"'},
|
||||
{NULL, 0}};
|
||||
|
||||
|
||||
int ix;
|
||||
int letter;
|
||||
char *p;
|
||||
@@ -1624,7 +1624,7 @@ static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int &outix, int n_outb
|
||||
int voice_change_flag;
|
||||
wchar_t *px;
|
||||
wchar_t *attr1;
|
||||
wchar_t *attr2;
|
||||
wchar_t *attr2;
|
||||
wchar_t *attr3;
|
||||
int terminator;
|
||||
char *uri;
|
||||
@@ -1688,7 +1688,7 @@ static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int &outix, int n_outb
|
||||
tag_name[ix] = 0;
|
||||
|
||||
px = &xml_buf[ix]; // the tag's attributes
|
||||
|
||||
|
||||
if(tag_name[0] == '/')
|
||||
{
|
||||
// closing tag
|
||||
@@ -2268,7 +2268,7 @@ f_input = f_in; // for GetC etc
|
||||
}
|
||||
xml_buf[n_xml_buf] = 0;
|
||||
c2 = ' ';
|
||||
|
||||
|
||||
self_closing = 0;
|
||||
if(xml_buf[n_xml_buf-1] == '/')
|
||||
{
|
||||
@@ -2276,9 +2276,9 @@ f_input = f_in; // for GetC etc
|
||||
xml_buf[n_xml_buf-1] = ' ';
|
||||
self_closing = 1;
|
||||
}
|
||||
|
||||
|
||||
terminator = ProcessSsmlTag(xml_buf,buf,ix,n_buf,self_closing);
|
||||
|
||||
|
||||
if(terminator != 0)
|
||||
{
|
||||
if(end_clause_after_tag)
|
||||
@@ -2286,7 +2286,7 @@ f_input = f_in; // for GetC etc
|
||||
|
||||
buf[ix] = ' ';
|
||||
buf[ix++] = 0;
|
||||
|
||||
|
||||
if(terminator & CLAUSE_BIT_VOICE)
|
||||
{
|
||||
strcpy(voice_change, current_voice_id);
|
||||
@@ -2397,7 +2397,7 @@ f_input = f_in; // for GetC etc
|
||||
if(iswspace(c1))
|
||||
{
|
||||
char *p_word;
|
||||
|
||||
|
||||
if(tr->translator_name == 0x6a626f)
|
||||
{
|
||||
// language jbo : lojban
|
||||
@@ -2514,7 +2514,7 @@ if(option_ssml) parag=1;
|
||||
// Because of an xml tag, we are waiting for the
|
||||
// next non-blank character to decide whether to end the clause
|
||||
// i.e. is dot followed by an upper-case letter?
|
||||
|
||||
|
||||
if(!iswspace(c1))
|
||||
{
|
||||
if(!IsAlpha(c1) || !iswlower(c1))
|
||||
@@ -2548,7 +2548,7 @@ if(option_ssml) parag=1;
|
||||
if((punct = lookupwchar(punct_chars,c1)) != 0)
|
||||
{
|
||||
punct_data = punct_attributes[punct];
|
||||
|
||||
|
||||
if(punct_data & PUNCT_IN_WORD)
|
||||
{
|
||||
// Armenian punctuation inside a word
|
||||
@@ -2579,7 +2579,7 @@ if(option_ssml) parag=1;
|
||||
announced_punctuation = c1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if((punct_data & PUNCT_SAY_NAME) && (announced_punctuation == 0))
|
||||
{
|
||||
// used for elipsis (and 3 dots) if a pronunciation for elipsis is given in *_list
|
||||
@@ -2626,7 +2626,7 @@ if(option_ssml) parag=1;
|
||||
|
||||
if(c1 == '.')
|
||||
{
|
||||
if((tr->langopts.numbers & NUM_ORDINAL_DOT) &&
|
||||
if((tr->langopts.numbers & NUM_ORDINAL_DOT) &&
|
||||
(iswdigit(cprev) || (IsRomanU(cprev) && (IsRomanU(cprev2) || iswspace(cprev2))))) // lang=hu
|
||||
{
|
||||
// dot after a number indicates an ordinal number
|
||||
@@ -2643,7 +2643,7 @@ if(option_ssml) parag=1;
|
||||
else
|
||||
if(c_next == '\'')
|
||||
{
|
||||
is_end_clause = 0; // eg. u.s.a.'s
|
||||
is_end_clause = 0; // eg. u.s.a.'s
|
||||
}
|
||||
if(iswlower(c_next))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user