Browse Source

Fix for issue #103 Maximum group number which works is actually 62

master
Valdis Vitolins 9 years ago
parent
commit
dde9872eb7
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/libespeak-ng/dictionary.c

+ 6
- 0
src/libespeak-ng/dictionary.c View File



if (p[0] == RULE_LETTERGP2) { if (p[0] == RULE_LETTERGP2) {
ix = p[1] - 'A'; ix = p[1] - 'A';
if (ix < 0) // Issue #103, if gets negative, fix it
ix += 256;
p += 2; p += 2;
if ((ix >= 0) && (ix < N_LETTER_GROUPS)) if ((ix >= 0) && (ix < N_LETTER_GROUPS))
tr->letterGroups[ix] = p; tr->letterGroups[ix] = p;
{ {
case RULE_LETTERGP: case RULE_LETTERGP:
letter_group = *rule++ - 'A'; 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)) { if (IsLetter(tr, letter_w, letter_group)) {
lg_pts = 20; lg_pts = 20;
if (letter_group == 2) if (letter_group == 2)
break; break;
case RULE_LETTERGP2: // match against a list of utf-8 strings case RULE_LETTERGP2: // match against a list of utf-8 strings
letter_group = *rule++ - 'A'; letter_group = *rule++ - 'A';
if (letter_group < 0) // Issue #103, if gets negative, fix it
letter_group += 256;
if ((n_bytes = IsLetterGroup(tr, post_ptr-1, letter_group, 0)) > 0) { if ((n_bytes = IsLetterGroup(tr, post_ptr-1, letter_group, 0)) > 0) {
add_points = (20-distance_right); add_points = (20-distance_right);
post_ptr += (n_bytes-1); post_ptr += (n_bytes-1);

Loading…
Cancel
Save