mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-01 13:54:20 +00:00
[1.29.11] Move character substitution feature to language *_rules files.
git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@93 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+13
-3
@@ -205,9 +205,9 @@ void Translator::InitGroups(void)
|
||||
int ix;
|
||||
char *p;
|
||||
char *p_name;
|
||||
unsigned int *pw;
|
||||
unsigned char c, c2;
|
||||
int len;
|
||||
int rule_count;
|
||||
|
||||
n_groups2 = 0;
|
||||
for(ix=0; ix<256; ix++)
|
||||
@@ -228,6 +228,18 @@ void Translator::InitGroups(void)
|
||||
}
|
||||
p++;
|
||||
|
||||
if(p[0] == RULE_REPLACEMENTS)
|
||||
{
|
||||
pw = (unsigned int *)(((int)p+4) & ~3); // advance to next word boundary
|
||||
langopts.replace_chars = pw;
|
||||
while(pw[0] != 0)
|
||||
{
|
||||
pw += 2; // find the end of the replacement list, each entry is 2 words.
|
||||
}
|
||||
p = (char *)(pw+1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(p[0] == RULE_LETTERGP2)
|
||||
{
|
||||
ix = p[1] - 'A';
|
||||
@@ -266,11 +278,9 @@ void Translator::InitGroups(void)
|
||||
}
|
||||
|
||||
// skip over all the rules in this group
|
||||
rule_count = 0;
|
||||
while(*p != RULE_GROUP_END)
|
||||
{
|
||||
p += (strlen(p) + 1);
|
||||
rule_count++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user