diff options
Diffstat (limited to 'src/ellinika/elmorph.c')
-rw-r--r-- | src/ellinika/elmorph.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ellinika/elmorph.c b/src/ellinika/elmorph.c index 5a8acdf..6d6a69a 100644 --- a/src/ellinika/elmorph.c +++ b/src/ellinika/elmorph.c @@ -595,17 +595,13 @@ _elstr_set_accent(SCM el, SCM n, int destructive, const char *func_name) start = elstr->sylmap[acc_num].phoneme_start; pos = 0; - for (i = 0; i < elstr->sylmap[acc_num].phoneme_count; i++) { - struct phoneme *ph = elstr->phoneme + start + i; + + for (i = elstr->sylmap[acc_num].phoneme_count; i > 0; i--) { + struct phoneme *ph = elstr->phoneme + start + i - 1; if (ph->flags & CHF_CONSONANT) /* skip */ ; - else if (ph->flags & CHF_DIPHTHONG) { - phoneme = ph; - pos = ph->start + 1; - break; - } else if (ph->flags & CHF_VOWEL) { + else if (ph->flags & CHF_VOWEL) { phoneme = ph; - pos = ph->start; break; } } @@ -614,6 +610,11 @@ _elstr_set_accent(SCM el, SCM n, int destructive, const char *func_name) "cannot set accent on syllable #~S of ~S: " "INTERNAL ERROR", scm_list_2(n, el)); + else if (phoneme->flags & CHF_DIPHTHONG) + pos = phoneme->start + phoneme->count - 1; + else + pos = phoneme->start; + phoneme->flags |= CHF_OXEIA; elstr->sylmap[acc_num].flags |= CHF_OXEIA; elstr->str[pos] = elchr_accent(elstr->str[pos], CHF_OXEIA); @@ -743,6 +744,7 @@ static struct deftab { { CHF_UPPER, "elmorph:upper" }, { CHF_NUMERIC, "elmorph:numeric" }, { CHF_DIPHTHONG, "elmorph:diphthong" }, + { CHF_IOTA, "elmorph:iota" }, }; SCM_DEFINE_PUBLIC(scm_elstr_char_phoneme, "elstr-char-phoneme", |