mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-09 07:52:27 +00:00
tokenizer.c: Support semicolon tokens.
This commit is contained in:
@@ -97,9 +97,10 @@ typedef enum {
|
||||
ESPEAKNG_CTYPE_EXCLAMATION_MARK,
|
||||
ESPEAKNG_CTYPE_COMMA,
|
||||
ESPEAKNG_CTYPE_COLON,
|
||||
ESPEAKNG_CTYPE_SEMICOLON,
|
||||
} espeakng_CTYPE;
|
||||
|
||||
#define ESPEAKNG_CTYPE_PROPERTY_MASK 0xF80000000000C001ull
|
||||
#define ESPEAKNG_CTYPE_PROPERTY_MASK 0xFC0000000000C001ull
|
||||
|
||||
// Reference: http://www.unicode.org/reports/tr14/tr14-32.html -- Unicode Line Breaking Algorithm
|
||||
static espeakng_CTYPE codepoint_type(uint32_t c)
|
||||
@@ -148,6 +149,8 @@ static espeakng_CTYPE codepoint_type(uint32_t c)
|
||||
return ESPEAKNG_CTYPE_COMMA;
|
||||
case ESPEAKNG_PROPERTY_COLON:
|
||||
return ESPEAKNG_CTYPE_COLON;
|
||||
case ESPEAKNG_PROPERTY_SEMI_COLON:
|
||||
return ESPEAKNG_CTYPE_SEMICOLON;
|
||||
}
|
||||
|
||||
// 4. Classify the remaining codepoints.
|
||||
@@ -299,6 +302,10 @@ tokenizer_state_default(espeak_ng_TOKENIZER *tokenizer)
|
||||
current += utf8_out(c, current);
|
||||
*current = '\0';
|
||||
return ESPEAKNG_TOKEN_COLON;
|
||||
case ESPEAKNG_CTYPE_SEMICOLON:
|
||||
current += utf8_out(c, current);
|
||||
*current = '\0';
|
||||
return ESPEAKNG_TOKEN_SEMICOLON;
|
||||
default:
|
||||
current += utf8_out(c, current);
|
||||
*current = '\0';
|
||||
|
||||
@@ -56,6 +56,7 @@ typedef enum
|
||||
ESPEAKNG_TOKEN_EXCLAMATION_MARK,
|
||||
ESPEAKNG_TOKEN_COMMA,
|
||||
ESPEAKNG_TOKEN_COLON,
|
||||
ESPEAKNG_TOKEN_SEMICOLON,
|
||||
} espeak_ng_TOKEN_TYPE;
|
||||
|
||||
espeak_ng_TOKEN_TYPE
|
||||
|
||||
Reference in New Issue
Block a user