Browse Source

PRE jump rule e.g. 'xyJ)' implemented

master
Valdis Vitolins 8 years ago
parent
commit
b2057635c4
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      src/libespeak-ng/dictionary.c

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

else else
failed = 1; failed = 1;
break; break;

case RULE_SKIPCHARS: {
// 'xyJ)' means 'skip characters backwards until xy'
char *p = pre_ptr; // pointer to current character in word
char *p2 = p; // pointer to previous character in word

while ((*p != *rule) && (*p != RULE_SPACE) && (*p != 0)) {
p2 = p;
p--;
}

// if succeed, set pre_ptr to next character after 'xy' and remaining
// 'xy' part is checked as usual in following cycles of PRE rule characters
if (*p == *rule)
pre_ptr = p2;
}
break;

default: default:
if (letter == rb) { if (letter == rb) {
if (letter == RULE_SPACE) if (letter == RULE_SPACE)

Loading…
Cancel
Save