Browse Source

Extend compile_line to include pronunciation data after a space (e.g. multi-word pronunciation replacements).

master
Reece H. Dunn 8 years ago
parent
commit
05cab4f2dc
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      src/libespeak-ng/compiledict.c

+ 9
- 3
src/libespeak-ng/compiledict.c View File

LINE_PARSER_MULTIPLE_WORDS = 2, LINE_PARSER_MULTIPLE_WORDS = 2,
LINE_PARSER_END_OF_WORDS = 3, LINE_PARSER_END_OF_WORDS = 3,
LINE_PARSER_PRONUNCIATION = 4, LINE_PARSER_PRONUNCIATION = 4,
LINE_PARSER_END = 5,
LINE_PARSER_END_OF_PRONUNCIATION = 5,
} LINE_PARSER_STATES; } LINE_PARSER_STATES;


static int compile_line(char *linebuf, char *dict_line, int *hash) static int compile_line(char *linebuf, char *dict_line, int *hash)
char *p; char *p;
char *word; char *word;
char *phonetic; char *phonetic;
char *phonetic_end;
unsigned int ix; unsigned int ix;
LINE_PARSER_STATES step; LINE_PARSER_STATES step;
unsigned int n_flag_codes = 0; unsigned int n_flag_codes = 0;
break; break;
case LINE_PARSER_PRONUNCIATION: case LINE_PARSER_PRONUNCIATION:
if (isspace2(c)) { if (isspace2(c)) {
phonetic_end = p;
p[0] = 0; // terminate phonetic p[0] = 0; // terminate phonetic
step = LINE_PARSER_END;
step = LINE_PARSER_END_OF_PRONUNCIATION;
} }
break; break;
case LINE_PARSER_END:
case LINE_PARSER_END_OF_PRONUNCIATION:
if (!isspace2(c)) {
*phonetic_end = ' ';
step = LINE_PARSER_PRONUNCIATION;
}
break; break;
} }
p++; p++;

Loading…
Cancel
Save