From 169d0e2887a40e4d845efcaa1e46ec49d02421b7 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sat, 11 Jun 2011 13:45:35 +0300 Subject: Fixes in conjugator * data/dbverb.struct: Expand conj to char(32). Fix several bugs in conjugation table. Introduce a new pseudo-conjugation A-depon, for verba deponentia. * data/irregular-verbs.xml: Update. * scm/conjugator.scm (complement-verb-info): Handle A-depon. (apply-flect): Don't try to set accent outside of a word, even if so required by accmap. (conjugate): For synthetic tenses, look up for aoristoy ypotaktikis of the same voice as the requested tense. Use accmap to decide whether a particular person exists in that tense. Fixes in syllabificator. * src/ellinika/elmorph.c (_elstr_set_accent): Fix setting accents on diphthongs. (deftab) : New flag. * src/ellinika/elmorph.h (CHF_IOTA): New flag. * src/ellinika/syllabificator.c (SYL_FLAG_MASK): Add more bits. (next_syllable): Mark syllables with iota with CHF_DIPHTHONG|CHF_IOTA. --- src/ellinika/elmorph.c | 18 ++++++++++-------- src/ellinika/elmorph.h | 1 + src/ellinika/syllabificator.c | 4 +++- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src') 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", diff --git a/src/ellinika/elmorph.h b/src/ellinika/elmorph.h index 2399b8a..c0df60f 100644 --- a/src/ellinika/elmorph.h +++ b/src/ellinika/elmorph.h @@ -34,6 +34,7 @@ #define CHF_NUMERIC 0x04000 #define CHF_DIPHTHONG 0x08000 +#define CHF_IOTA 0x10000 /* Phonemes */ #define PHON_A 1 /* α */ diff --git a/src/ellinika/syllabificator.c b/src/ellinika/syllabificator.c index c4105ec..e034163 100644 --- a/src/ellinika/syllabificator.c +++ b/src/ellinika/syllabificator.c @@ -32,7 +32,7 @@ struct syllabificator { int err; }; -#define SYL_FLAG_MASK (CHF_ACCENT_MASK) +#define SYL_FLAG_MASK (CHF_ACCENT_MASK|CHF_DIPHTHONG|CHF_IOTA) #define ISIOTA(ph) \ ((ph).code == PHON_I && (ph).count == 1 && \ @@ -94,6 +94,8 @@ next_syllable(struct syllabificator *sp) syl->char_count += sp->phon[sp->phon_cur].count; syl->phoneme_count++; sp->phon_cur++; + if (sp->phon[sp->phon_cur].flags & CHF_VOWEL) + syl->flags |= CHF_DIPHTHONG|CHF_IOTA; } if (sp->phon[sp->phon_cur].flags & CHF_VOWEL) -- cgit v1.2.1