From b56552e3260023593a3bf80315edf0f069eebac1 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 19 Jun 2011 07:15:04 +0300 Subject: Conjugator: bugfix * data/irregular-verbs.xml: Update. * src/ellinika/conjugator.scm (conjugate): Create a copy of vinfo prior to complementing it to avoid side effects on subsequent iterations. --- src/ellinika/conjugator.scm | 32 +++++++++++++++++--------------- src/ellinika/tests/conj/blepv.scm | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'src/ellinika') diff --git a/src/ellinika/conjugator.scm b/src/ellinika/conjugator.scm index 2a6425c..0abec8d 100644 --- a/src/ellinika/conjugator.scm +++ b/src/ellinika/conjugator.scm @@ -541,22 +541,24 @@ AND i.tense=\"~A\" AND i.ident=f.ident" (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)))) + (let ((vinfo (copy-tree vinfo))) + (if (verb-get vinfo #:root) + (verb-set! vinfo #:attested '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)))) ; (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)) - prev)))) + (cons + (cons + (append (apply-flect conj vinfo verb) + (list (verb-get vinfo #:conj) + (verb-get vinfo #:attested))) + (conj-info #:fold conj)) + prev))))) '() conj-list)))))))) diff --git a/src/ellinika/tests/conj/blepv.scm b/src/ellinika/tests/conj/blepv.scm index 7e54734..6c0ac99 100644 --- a/src/ellinika/tests/conj/blepv.scm +++ b/src/ellinika/tests/conj/blepv.scm @@ -1,4 +1,4 @@ (use-modules ((ellinika test-conjugation))) (test-conjugation:verb "βλέπω") -;(test-conjugation:tense "βλέπω" "pas" "sub" "Αόριστος") +;(test-conjugation:tense "βλέπω" "pas" "imp" "Αόριστος") -- cgit v1.2.1