iast-czech: shorten 'á' on end of a word

This commit is contained in:
Vlasta Vesely 2018-04-30 19:22:35 +02:00
parent ff2e16891b
commit adf3bb9e24

View file

@ -137,6 +137,7 @@ static void nasal_consonants_filter(struct syllable *chain)
static void end_of_word_filter(struct syllable *chain)
{
struct syllable *syllable = chain;
unsigned int n;
while (syllable) {
if (syllable->next == NULL || isspace(syllable->next->data[0])) {
@ -144,6 +145,12 @@ static void end_of_word_filter(struct syllable *chain)
free(syllable->data);
syllable->data = strdup("");
}
n = strlen(syllable->data);
if (!strcmp(syllable->data + n - 2, "á")) {
syllable->data[n - 2] = 'a';
syllable->data[n - 1] = '\0';
}
}
syllable = syllable->next;