mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Updates for issue #103 Maximum group number which works is actually 62
This commit is contained in:
@@ -321,6 +321,8 @@ char *DecodeRule(const char *group_chars, int group_length, char *rule, int cont
|
||||
c = symbols_lg[*rule++ - 'A'];
|
||||
else if (rb == RULE_LETTERGP2) {
|
||||
value = *rule++ - 'A';
|
||||
if (value < 0)
|
||||
value += 256;
|
||||
p[0] = 'L';
|
||||
p[1] = (value / 10) + '0';
|
||||
c = (value % 10) + '0';
|
||||
|
||||
@@ -164,7 +164,7 @@ static void InitGroups(Translator *tr)
|
||||
|
||||
if (p[0] == RULE_LETTERGP2) {
|
||||
ix = p[1] - 'A';
|
||||
if (ix < 0) // Issue #103, if gets negative, fix it
|
||||
if (ix < 0)
|
||||
ix += 256;
|
||||
p += 2;
|
||||
if ((ix >= 0) && (ix < N_LETTER_GROUPS))
|
||||
@@ -1708,8 +1708,6 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
|
||||
{
|
||||
case RULE_LETTERGP:
|
||||
letter_group = *rule++ - 'A';
|
||||
if (letter_group < 0) // Issue #103, if gets negative, fix it
|
||||
letter_group += 256;
|
||||
if (IsLetter(tr, letter_w, letter_group)) {
|
||||
lg_pts = 20;
|
||||
if (letter_group == 2)
|
||||
@@ -1721,7 +1719,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
|
||||
break;
|
||||
case RULE_LETTERGP2: // match against a list of utf-8 strings
|
||||
letter_group = *rule++ - 'A';
|
||||
if (letter_group < 0) // Issue #103, if gets negative, fix it
|
||||
if (letter_group < 0)
|
||||
letter_group += 256;
|
||||
if ((n_bytes = IsLetterGroup(tr, post_ptr-1, letter_group, 0)) > 0) {
|
||||
add_points = (20-distance_right);
|
||||
@@ -1927,7 +1925,9 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
|
||||
failed = 1;
|
||||
break;
|
||||
case RULE_LETTERGP2: // match against a list of utf-8 strings
|
||||
letter_group = *rule++ - 'A';
|
||||
letter_group = *rule++ - 'A'; // substracting 'A' makes letter_group equal to number in .Lxx definition
|
||||
if(letter_group<0)
|
||||
letter_group += 256;
|
||||
if ((n_bytes = IsLetterGroup(tr, pre_ptr, letter_group, 1)) > 0) {
|
||||
add_points = (20-distance_right);
|
||||
pre_ptr -= (n_bytes-1);
|
||||
|
||||
Reference in New Issue
Block a user