diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-06-19 06:31:26 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-06-19 06:31:26 +0300 |
commit | 3b0729ca8599173a61b97d59513c32b8b8eb1ea4 (patch) | |
tree | fdd8c21bcc770b4b761205c3b5bdbb058228b3da /src | |
parent | b8f74f94f21826901ff303095c2b88caad4a695e (diff) | |
download | ellinika-3b0729ca8599173a61b97d59513c32b8b8eb1ea4.tar.gz ellinika-3b0729ca8599173a61b97d59513c32b8b8eb1ea4.tar.bz2 |
Conjugator: revamp handling of simple synthetic tenses (e.g. mellontas diarkeias).
* data/dbverb.struct: Rewrite definitions of simple compound
tenses.
* data/irregular-verbs.xml: Update.
* scm/verbop.scm (prop): New tag.
(p): New attribute "prop".
* src/ellinika/conjugator.scm (apply-flect): Use "flection"
property, if defined.
(conjugate): Handle simple synthetic tenses.
Diffstat (limited to 'src')
-rw-r--r-- | src/ellinika/conjugator.scm | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/src/ellinika/conjugator.scm b/src/ellinika/conjugator.scm index e73a1cc..2a6425c 100644 --- a/src/ellinika/conjugator.scm +++ b/src/ellinika/conjugator.scm @@ -371,8 +371,12 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold" ; (format #t "AUGMENT ~A ~A~%" vinfo (verb-get vinfo #:augment)) (let ((forms (map - (lambda (flect acc) + (lambda (flect acc person) (cond + ((verb-get vinfo (symbol->keyword + (string->symbol (number->string person)))) => + (lambda (personal-form) + personal-form)) ((not flect) #f) ((char=? acc #\0) (let* ((rs (force-elstr root)) @@ -421,7 +425,8 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold" (throw 'conjugator-error 'conjugator-error-db "invalid accent character ~A" (list acc))))) (conj-info #:flect conj) - accmap))) + accmap + '(1 2 3 4 5 6)))) (if (conj-info #:particle conj) (map (lambda (w) @@ -463,7 +468,7 @@ AND i.tense=\"~A\" AND i.ident=f.ident" (if (not conj-list) (list (list #f #f #f #f #f #f #f #f)) (map car - (fold-right + (fold (lambda (elt prev) ; (format #t "ELT ~A~%" elt) (if (null? prev) @@ -478,14 +483,16 @@ AND i.tense=\"~A\" AND i.ident=f.ident" (cdr prev)) (cons elt prev))))) '() - (map - (lambda (conj) -; (format #t "CONJ ~S~%" conj) + (fold + (lambda (conj prev) +; (format #t "CONJ ~A~%" conj) (if (member #:nopart rest) (conj-info-set! #:particle conj #f)) - (cons (cond - ((string=? (conj-info #:thema conj) "synt") + ((and (string=? (conj-info #:thema conj) "synt") + (conj-info #:aux conj)) + (cons + (cons (let* ((verb-conj (car (conjugate verb voice "sub" "Αόριστος" #:nopart))) @@ -512,20 +519,45 @@ AND i.tense=\"~A\" AND i.ident=f.ident" (list (verb-get vinfo #:conj) (conjugation:attested verb-conj)))) (else - #f)))) + #f))) + (conj-info #:fold conj)) + prev)) + ((and (string=? (conj-info #:thema conj) "synt") + (conj-info #:auxtense conj)) + (let ((part (conj-info #:particle conj))) + (fold-right + (lambda (tenses prev) + (cons + (cons + (append + (map + (lambda (t) + (elstr->string (elstr-append part " " t))) + (list-head tenses 6)) + (list-tail tenses 6)) + (conj-info #:fold conj)) + prev)) + prev + (conjugate verb voice "ind" + (conj-info #:auxtense conj))))) (else + (if (not (verb-get vinfo #:root)) (let ((thema (string-split (conj-info #:thema conj) #\:))) ; (format #t "THEMA ~A~%" thema) (complement-verb-info vinfo verb (if (null? (cdr thema)) voice (car (cdr thema))) - (car thema)) + (car thema)))) ; (format #t "VINFO ~A~%" vinfo) + (cons + (cons (append (apply-flect conj vinfo verb) (list (verb-get vinfo #:conj) - (verb-get vinfo #:attested)))))) - (conj-info #:fold conj))) + (verb-get vinfo #:attested))) + (conj-info #:fold conj)) + prev)))) + '() conj-list)))))))) (define-public (conjugator verb voice mood tense) |