mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
move ReplaceKeyName()
This commit is contained in:
@@ -669,31 +669,6 @@ static void SetProsodyParameter(int param_type, wchar_t *attr1, PARAM_STACK *sp)
|
||||
}
|
||||
}
|
||||
|
||||
static int ReplaceKeyName(char *outbuf, int index, int *outix)
|
||||
{
|
||||
// Replace some key-names by single characters, so they can be pronounced in different languages
|
||||
static MNEM_TAB keynames[] = {
|
||||
{ "space ", 0xe020 },
|
||||
{ "tab ", 0xe009 },
|
||||
{ "underscore ", 0xe05f },
|
||||
{ "double-quote ", '"' },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
int ix;
|
||||
int letter;
|
||||
char *p;
|
||||
|
||||
p = &outbuf[index];
|
||||
|
||||
if ((letter = LookupMnem(keynames, p)) != 0) {
|
||||
ix = utf8_out(letter, p);
|
||||
*outix = index + ix;
|
||||
return letter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outbuf, bool self_closing)
|
||||
{
|
||||
// xml_buf is the tag and attributes with a zero terminator in place of the original '>'
|
||||
|
||||
@@ -414,3 +414,28 @@ wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ReplaceKeyName(char *outbuf, int index, int *outix)
|
||||
{
|
||||
// Replace some key-names by single characters, so they can be pronounced in different languages
|
||||
static MNEM_TAB keynames[] = {
|
||||
{ "space ", 0xe020 },
|
||||
{ "tab ", 0xe009 },
|
||||
{ "underscore ", 0xe05f },
|
||||
{ "double-quote ", '"' },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
int ix;
|
||||
int letter;
|
||||
char *p;
|
||||
|
||||
p = &outbuf[index];
|
||||
|
||||
if ((letter = LookupMnem(keynames, p)) != 0) {
|
||||
ix = utf8_out(letter, p);
|
||||
*outix = index + ix;
|
||||
return letter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,3 +81,4 @@ void ProcessParamStack(char *outbuf, int *outix, int n_param_stack, PARAM_STACK
|
||||
PARAM_STACK *PushParamStack(int tag_type, int *n_param_stack, PARAM_STACK *param_stack);
|
||||
const char *VoiceFromStack(SSML_STACK *ssml_stack, int n_ssml_stack, espeak_VOICE *base_voice, char base_voice_variant_name[40]);
|
||||
void PopParamStack(int tag_type, char *outbuf, int *outix, int *n_param_stack, PARAM_STACK *param_stack, int *speech_parameters);
|
||||
int ReplaceKeyName(char *outbuf, int index, int *outix);
|
||||
|
||||
Reference in New Issue
Block a user