[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:
jonsd
2007-10-23 13:14:49 +00:00
parent e5f2d6f4c6
commit 5bdf9d63ab
30 changed files with 583 additions and 212 deletions
+13 -3
View File
@@ -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++;
}