aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/dbverb.struct4
-rw-r--r--data/irregular-verbs.xml85
-rw-r--r--src/cgi-bin/conj.scm42
-rw-r--r--src/ellinika/conjugator.scm354
-rwxr-xr-xsrc/ellinika/tests/conj-test39
-rw-r--r--src/ellinika/tests/conj/anoigv.scm1
-rw-r--r--src/ellinika/tests/conj/bastav.scm3
-rw-r--r--src/ellinika/tests/conj/lev.scm10
-rw-r--r--src/ellinika/tests/conj/milav.scm5
-rw-r--r--src/ellinika/tests/conj/ntynv.scm1
-rw-r--r--src/ellinika/tests/conj/pav.scm7
-rw-r--r--src/ellinika/tests/samples/aggelv28
-rw-r--r--src/ellinika/tests/samples/agv28
-rw-r--r--src/ellinika/tests/samples/anebainv28
-rw-r--r--src/ellinika/tests/samples/anoigv28
-rw-r--r--src/ellinika/tests/samples/apomenv28
-rw-r--r--src/ellinika/tests/samples/aresv28
-rw-r--r--src/ellinika/tests/samples/ballv28
-rw-r--r--src/ellinika/tests/samples/bastav49
-rw-r--r--src/ellinika/tests/samples/bastv49
-rw-r--r--src/ellinika/tests/samples/bgainv28
-rw-r--r--src/ellinika/tests/samples/blepv28
-rw-r--r--src/ellinika/tests/samples/briskv28
-rw-r--r--src/ellinika/tests/samples/denv28
-rw-r--r--src/ellinika/tests/samples/diabazv28
-rw-r--r--src/ellinika/tests/samples/eimai28
-rw-r--r--src/ellinika/tests/samples/erxomai37
-rw-r--r--src/ellinika/tests/samples/exv28
-rw-r--r--src/ellinika/tests/samples/kauomai28
-rw-r--r--src/ellinika/tests/samples/kremav32
-rw-r--r--src/ellinika/tests/samples/lev36
-rw-r--r--src/ellinika/tests/samples/milav32
-rw-r--r--src/ellinika/tests/samples/nikav32
-rw-r--r--src/ellinika/tests/samples/nikv32
-rw-r--r--src/ellinika/tests/samples/ntynv28
-rw-r--r--src/ellinika/tests/samples/pav2
-rw-r--r--src/ellinika/tests/samples/phgainv28
-rw-r--r--src/ellinika/tests/samples/pinv28
-rw-r--r--src/ellinika/tests/samples/trabav49
-rw-r--r--src/ellinika/tests/samples/uelv28
-rw-r--r--xml/pl/rhmata.xml2
-rw-r--r--xml/ru/rhmata.xml2
42 files changed, 1223 insertions, 174 deletions
diff --git a/data/dbverb.struct b/data/dbverb.struct
index ce19fd3..718e348 100644
--- a/data/dbverb.struct
+++ b/data/dbverb.struct
@@ -77,5 +77,5 @@ INSERT INTO verbflect VALUES
(28, "ιέμαι", "ιέσαι", "ιέται", "ιόμαστε", "ιέστε", "ιούνται"),
(29, "ιόμουν", "ιόσουν", "ιόταν", "ιόμαστε", "ιόσαστε", "ιόνταν"),
-(30, NULL, "ιέσαι", NULL, NULL, "ιέσται", NULL),
+(30, NULL, "ιέσαι", NULL, NULL, "ιέστε", NULL),
(31, NULL, "ου", NULL, NULL, NULL, NULL),
(32, NULL, NULL, NULL, NULL, "είτε", NULL),
@@ -146,5 +146,5 @@ INSERT INTO conjugation VALUES
("B1", "act", "sub", "Παρακείμενος", 'synt', NULL, 0, NULL, "να", "έχω", "Ενεστώτας", NULL),
-- Προστακτική
-("B1", "act", "imp", "Ενεστώτας", 'pres', NULL, 25, "-0--2-", NULL, NULL, NULL, NULL),
+("B1", "act", "imp", "Ενεστώτας", 'pres', NULL, 25, "-2--2-", NULL, NULL, NULL, NULL),
("B1", "act", "imp", "Αόριστος", 'aor', "ησ", 9, "-3--2-", NULL, NULL, NULL, NULL),
("B1", "act", "imp", "Παρακείμενος", 'synt', NULL, 0, "-0--0-", "να", "έχω", "Ενεστώτας", NULL),
diff --git a/data/irregular-verbs.xml b/data/irregular-verbs.xml
index 312987e..89587f8 100644
--- a/data/irregular-verbs.xml
+++ b/data/irregular-verbs.xml
@@ -181,4 +181,33 @@
<stem theme="aor">αρεσ</stem>
</act>
+ <!--
+ 1. http://www.foundalis.com/lan/grkmore1.htm
+ αρέσει : likes. Verb, third person singular, present tense,
+ appearing only in 2nd and 3rd person. (The first person of this
+ verb, αρέσω, has the meaning "I am liked by somebody"; see note
+ for more). Imperfect: άρεζε. Past: άρεσε. Future: θα
+ αρέσει. Perfect: έχει αρέσει. Appears only in active voice. (The
+ middle form αρέσομαι or αρέσκομαι exists, but it has the meaning
+ of "I have the habit of...")
+ 2. http://lexilogia.gr/forum/showthread.php?5231-%CE%94%CE%B5%CE%BD-%CF%83%CE%B1%CF%82-%CE%B1%CF%81%CE%AD%CF%83%CE%B5%CE%B9-%CE%B5-%CE%95%CE%BC%CE%AD%CE%BD%CE%B1-%CF%8C%CE%BC%CF%89%CF%82-%CE%B8%CE%B1-%CE%BC-%CE%AC%CF%81%CE%B5%CE%B6%CE%B5!
+ Οι τύποι άρεζε και άρεζαν είναι διαλεκτικοί των βόρειων ιδιωμάτων
+ στην ελληνική, για τον παρατατικό τού ρ. αρέσω (που, η επίσημη
+ γραμματική λέει, ταυτίζεται με τον αόρ.: άρεσα). Οι υπόλοιποι
+ τσινάνε όταν τ' ακούνε, τα λεξικά (πλην ΛΚΝ, το οποίο με συνέπεια
+ καταγράφει και το βορειοελλαδικό ιδίωμα, και Μεσαιωνικού -
+ Γεωργακά, τα οποία αποδελτίωσαν και καταγράφουν και τύπο
+ ενεστ. αρέζω) δεν το αναφέρουν (ούτε το Λεξισκόπιο), αλλά πάρτε
+ το απόφαση ότι το λέμε κι έτσι. Βέβαια στον προσεγμένο γραπτό
+ λόγο, ιδίως αν δεν αναπαράγει προφορικό λόγο, καλό είναι να
+ αποφεύγονται (εκτός κι αν γράφετε για τα Σπορ του Βορρά).
+ Τουλάχιστον μέχρι να τ' αποδεχθούν κι οι νότιοι.
+
+ Δεν είναι χωρίς αξία η διάκριση παρατατικού-αορίστου (άρεζα vs
+ άρεσα)· μην λησμονείτε άλλωστε ότι τα βόρεια ιδιώματα εισήγαγαν
+ (ευτυχώς!) και τη διάκριση με την κατάληξη -αν στον παρατατικό
+ (καθόμασταν vs καθόμαστε, που ταυτίζεται με τον ενεστ.:
+ καθόμαστε).
+ -->
+ <pas/>
</v>
@@ -189,4 +218,7 @@
<stem theme="aor">βαλ</stem>
</act>
+ <pas>
+ <stem theme="aor">βληθ</stem>
+ </pas>
</v>
@@ -217,9 +249,29 @@
<a>βγαίνω</a>
<c>A</c>
- <accmap>000000</accmap>
<act>
<stem theme="aor">βγήκ</stem>
<stem theme="sub">βγ</stem>
+ <ind>
+ <t name="Αόριστος">
+ <accmap>000000</accmap>
+ </t>
+ <t name="Μέλλοντας στιγμιαίος">
+ <p n="p" p="2" prop="true">βγείτε</p>
+ </t>
+ </ind>
+ <sub>
+ <t name="Αόριστος">
+ <p n="p" p="2" prop="true">βγείτε</p>
+ </t>
+ </sub>
+ <imp>
+ <t name="Αόριστος">
+ <p n="s" p="2">βγες</p>
+<!-- FIXME: + <p n="s" p="2">έβγε</p> -->
+ <p n="p" p="2">βγείτε</p>
+ </t>
+ </imp>
</act>
+ <pas/>
</v>
@@ -392,5 +444,5 @@
<t name="Αόριστος">
<p n="s" p="2">κάθισε</p>
- <p n="p" p="2">κάθιστε</p>
+ <p n="p" p="2">καθίστε</p>
</t>
</imp>
@@ -547,17 +599,42 @@
<suffix/>
</t>
+ <t name="Μέλλοντας στιγμιαίος">
+ <prop name="class">A</prop>
+ <prop name="stem">πά</prop>
+ <p n="s" p="1" prop="true">πάω</p>
+ <p n="s" p="2" prop="true">πας</p>
+ <p n="s" p="3" prop="true">πάει</p>
+ <p n="p" p="1" prop="true">πάμε</p>
+ <p n="p" p="2" prop="true">πάτε</p>
+ <p n="p" p="3" prop="true">πάνε,παν</p>
+ </t>
</ind>
<sub>
<t name="Ενεστώτας">
- <prop name="stem">πήγαιν</prop>
+ <prop name="stem">πηγαίν</prop>
<prop name="class">A</prop>
</t>
<t name="Αόριστος">
<prop name="stem">πά</prop>
- <prop name="class">A</prop>
+ <p n="s" p="1" prop="true">πάω</p>
+ <p n="s" p="2" prop="true">πας</p>
+ <p n="s" p="3" prop="true">πάει</p>
+ <p n="p" p="1" prop="true">πάμε</p>
+ <p n="p" p="2" prop="true">πάτε</p>
+ <p n="p" p="3" prop="true">πάνε,παν</p>
<suffix/>
</t>
</sub>
<stem theme="aor">πηγ</stem>
+ <imp>
+ <t name="Ενεστώτας">
+ <prop name="class">A</prop>
+ <prop name="stem">πήγαιν</prop>
+ </t>
+ <t name="Αόριστος">
+ <p n="s" p="2">πήγαινε</p>
+ <p n="p" p="2">πάτε,πηγαίνετε,πηγαίντε</p>
+ </t>
+ </imp>
</act>
<pas/>
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4
index a8d84f1..83fb846 100644
--- a/src/cgi-bin/conj.scm4
+++ b/src/cgi-bin/conj.scm4
@@ -385,5 +385,5 @@ ifelse(IFACE,[CGI],(cgi:init))
(print-footnote "class-na" "*"
"Conjugation class of this verb is not attested"))
- ((root)
+ ((stem)
(print-footnote "stem-na" "?"
(_ "Το θέμα αυτού του χρόνου δεν επιβεβαιώνεται από τη βάση δεδοµένων")))))
diff --git a/src/ellinika/conjugator.scm b/src/ellinika/conjugator.scm
index bffc6be..eae4ad0 100644
--- a/src/ellinika/conjugator.scm
+++ b/src/ellinika/conjugator.scm
@@ -38,5 +38,5 @@
;; attested
-(define (verb-set! verb key value)
+(define (vinfo-set! verb key value)
; (format #t "VERB ~A KEY ~A VALUE ~A~%" verb key value)
(case key
@@ -61,5 +61,5 @@
-(define (verb-get verb key)
+(define (vinfo-get verb key)
(case key
((#:conj)
@@ -104,6 +104,6 @@
"SELECT property,value FROM verbtense WHERE \
verb=\"~A\" AND voice=\"~A\" AND mood=\"~A\" AND tense=\"~A\""
- (verb-get vinfo #:verb) voice mood tense)))
- (verb-set!
+ (vinfo-get vinfo #:verb) voice mood tense)))
+ (vinfo-set!
vinfo #:proplist
(let loop ((inlist (if (null? verbprop)
@@ -195,4 +195,9 @@ verb=\"~A\" AND voice=\"~A\" AND mood=\"~A\" AND tense=\"~A\""
(elstr-append stem "ηθ")))))
+(define (thema-aoristou-prostaktikhs stem)
+ (if (elstr-suffix? stem "β" "γ" "θ" "ν")
+ (elstr-append stem "ε")
+ stem))
+
(define (lookup-verb-info verb voice thema)
(ellinika:sql-query
@@ -211,4 +216,5 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
"cannot handle ~A" (list (force-string verb))))))
+;; FIXME: Use vinfo #:verb instead of the verb argument.
(define (complement-verb-info vinfo verb voice thema)
; (format #t "COMPLEMENT ~A~%" vinfo)
@@ -218,26 +224,31 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
(lookup-verb-info verb voice "aor")
tmpres))))
- (verb-set! vinfo #:stem
+ (vinfo-set! vinfo #:stem
(cond
((not (null? result))
- (verb-set! vinfo #:attested 'stem)
+ (vinfo-set! vinfo #:attested 'stem)
(map car result))
- ((string=? (verb-get vinfo #:conj) "A")
+ ((string=? (vinfo-get vinfo #:conj) "A")
(let ((stem (verb-A-stem elverb)))
(cond
((string=? thema "pres")
- (verb-set! vinfo #:attested 'stem)
+ (vinfo-set! vinfo #:attested 'stem)
stem)
((or (string=? thema "aor") (string=? thema "sub"))
- (if (string=? voice "act")
- (elstr-thema-aoristoy stem)
- (thema-aoristoy-mesapathitikis-A stem)))
+ (cond
+ ((string=? voice "act")
+ (elstr-thema-aoristoy stem))
+ ((string=? voice "pas")
+ (thema-aoristoy-mesapathitikis-A stem))
+ (else
+ (throw 'conjugator-error 'conjugator-error-db
+ "invalid voice ~A" (list voice)))))
(else
#f))))
- ((string=? (verb-get vinfo #:conj) "A-depon")
+ ((string=? (vinfo-get vinfo #:conj) "A-depon")
(let ((stem (verb-A-stem elverb)))
(cond
((string=? thema "pres")
- (verb-set! vinfo #:attested 'stem)
+ (vinfo-set! vinfo #:attested 'stem)
stem)
((or (string=? thema "aor") (string=? thema "sub"))
@@ -245,5 +256,5 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
(else
#f))))
- ((string=? (verb-get vinfo #:conj) "B1")
+ ((string=? (vinfo-get vinfo #:conj) "B1")
(let ((stem (if (elstr-suffix? elverb "άω")
(elstr-trim elverb -2)
@@ -251,5 +262,5 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
(cond
((or (string=? voice "act") (string=? thema "pres"))
- (verb-set! vinfo #:attested 'stem)
+ (vinfo-set! vinfo #:attested 'stem)
stem)
((or (string=? thema "aor") (string=? thema "sub"))
@@ -257,12 +268,12 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
(lambda (aor)
(thema-aoristoy-mesapathitikis-B stem aor))
- (conjugate verb "act" "ind" "Αόριστος")))
+ (conjugate vinfo "act" "ind" "Αόριστος")))
(else
#f))))
- ((string=? (verb-get vinfo #:conj) "B2")
+ ((string=? (vinfo-get vinfo #:conj) "B2")
(let ((stem (elstr-trim elverb -1)))
(cond
((or (string=? voice "act") (string=? thema "pres"))
- (verb-set! vinfo #:attested 'stem)
+ (vinfo-set! vinfo #:attested 'stem)
stem)
((or (string=? thema "aor") (string=? thema "sub"))
@@ -344,5 +355,5 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
;; (define (get-property conj vinfo key default)
-;; (if ((override (verb-get vinfo
+;; (if ((override (vinfo-get vinfo
;; (symbol->keyword
;; (string->symbol
@@ -353,7 +364,7 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
;; (let ((t (conj-info key conj)))
;; (if t
-;; (or (verb-get vinfo key)
+;; (or (vinfo-get vinfo key)
;; t)
-;; (or (verb-get vinfo key)
+;; (or (vinfo-get vinfo key)
;; (conj-info key conj)
;; default))))))
@@ -361,13 +372,13 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
(define (get-suffix conj vinfo)
- (let ((ret (let ((override (verb-get vinfo #:override)))
+ (let ((ret (let ((override (vinfo-get vinfo #:override)))
(if (and override
(member "suffix" override))
(let ((t (conj-info #:suffix conj)))
(if t
- (or (verb-get vinfo #:suffix)
+ (or (vinfo-get vinfo #:suffix)
t)
""))
- (or (verb-get vinfo #:suffix)
+ (or (vinfo-get vinfo #:suffix)
(conj-info #:suffix conj)
"")))))
@@ -376,12 +387,12 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
(define (get-accmap conj vinfo)
- (let ((override (verb-get vinfo #:override)))
+ (let ((override (vinfo-get vinfo #:override)))
(if (and override
(member "accmap" override))
(let ((t (conj-info #:accmap conj)))
(if t
- (or (verb-get vinfo #:accmap)
+ (or (vinfo-get vinfo #:accmap)
t)))
- (or (verb-get vinfo #:accmap)
+ (or (vinfo-get vinfo #:accmap)
(conj-info #:accmap conj)
"000000"))))
@@ -395,11 +406,11 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
((> (length accmap) 6)
(set! accmap (list-head accmap 6))
- (set! augment (or (verb-get vinfo #:augment) "ε"))))
-; (format #t "AUGMENT ~A ~A~%" vinfo (verb-get vinfo #:augment))
+ (set! augment (or (vinfo-get vinfo #:augment) "ε"))))
+; (format #t "AUGMENT ~A ~A~%" vinfo (vinfo-get vinfo #:augment))
(let ((forms
(map
(lambda (flect acc person)
(cond
- ((verb-get vinfo (symbol->keyword
+ ((vinfo-get vinfo (symbol->keyword
(string->symbol
(number->string person)))) =>
@@ -469,5 +480,5 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
(map force-string forms)))))
-(define (individual-verb verb voice mood tense)
+(define (individual-verb vinfo voice mood tense)
(let ((res (ellinika:sql-query
"SELECT f.sing1,f.sing2,f.sing3,f.plur1,f.plur2,f.plur3\
@@ -475,10 +486,14 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
WHERE i.verb=\"~A\" AND i.voice=\"~A\" AND i.mood=\"~A\"\
AND i.tense=\"~A\" AND i.ident=f.ident"
- verb voice mood tense)))
- (if (not (null? res))
- (append (car res)
- (list "I"
- '(class stem)))
- #f)))
+ (vinfo-get vinfo #:verb) voice mood tense)))
+ (if (null? res)
+ #f
+ (map
+ (lambda (elt)
+ (append
+ elt
+ (list "I"
+ '(class stem))))
+ res))))
(define (merge-conjugated-forms lista listb)
@@ -488,139 +503,148 @@ AND c.tense=\"~A\" AND c.flect = f.ident ORDER by fold"
lista listb))
-(define (conjugate verb voice mood tense . rest)
+(define (conjugate vinfo voice mood tense . rest)
(cond
- ((individual-verb verb voice mood tense) =>
+ ((individual-verb vinfo voice mood tense) =>
(lambda (res)
- (list res)))
+ res))
(else
- (let* ((vinfo (load-verb-info verb voice mood tense))
- (conj-list (get-conj-info (or
- (verb-get vinfo #:class)
- (verb-get vinfo #:conj))
- voice mood tense))
- (verb (force-string (verb-get vinfo #:verb))))
- (format #t "VINFO ~A~%" vinfo)
- (if (not conj-list)
- (list (list #f #f #f #f #f #f #f #f))
- (map car
- (fold
- (lambda (elt prev)
-; (format #t "ELT ~A~%" elt)
- (if (null? prev)
- (list elt)
- (let ((top (car prev)))
- (if (let ((a (cdr elt))
- (b (cdr top)))
- (and (string? a) (string? b) (string=? a b)))
- (cons (cons
- (merge-conjugated-forms (car top) (car elt))
- (cdr top))
- (cdr prev))
- (cons elt prev)))))
- '()
- (fold
- (lambda (conj prev)
+ (let ((vinfo (copy-tree vinfo)))
+ (if (not (member #:noload rest))
+ (load-proplist vinfo voice mood tense))
+; (format #t "VINFO ~A~%" vinfo)
+ (let ((conj-list (get-conj-info (or
+ (vinfo-get vinfo #:class)
+ (vinfo-get vinfo #:conj))
+ voice mood tense))
+ (verb (force-string (vinfo-get vinfo #:verb))))
+; (format #t "VINFO ~A~%" vinfo)
+ (if (not conj-list)
+ (list (list #f #f #f #f #f #f #f #f))
+ (map car
+ (fold
+ (lambda (elt prev)
+; (format #t "ELT ~A~%" elt)
+ (if (null? prev)
+ (list elt)
+ (let ((top (car prev)))
+ (if (let ((a (cdr elt))
+ (b (cdr top)))
+ (and (string? a) (string? b) (string=? a b)))
+ (cons (cons
+ (merge-conjugated-forms (car top) (car elt))
+ (cdr top))
+ (cdr prev))
+ (cons elt prev)))))
+ '()
+ (fold
+ (lambda (conj prev)
; (format #t "CONJ ~A~%" conj)
- (if (member #:nopart rest)
- (conj-info-set! #:particle conj #f))
- (cond
- ((and (string=? (conj-info #:thema conj) "synt")
- (conj-info #:aux conj))
- (let ((aparemfato-list
- (map
- (lambda (x)
- (let ((t (conjugation:table x)))
- (if t
+ (if (member #:nopart rest)
+ (conj-info-set! #:particle conj #f))
+ (cond
+ ((and (string=? (conj-info #:thema conj) "synt")
+ (conj-info #:aux conj))
+ (let ((aparemfato-list
+ (map
+ (lambda (x)
+ (let ((t (conjugation:table x)))
+ (if t
+ (cons
+ (list-ref t 2)
+ (conjugation:attested x))
+ #f)))
+ (conjugate vinfo voice "sub" "Αόριστος"
+ #:nopart)))
+ (part (conj-info #:particle conj))
+ (fold-id (conj-info #:fold conj)))
+ (fold
+ (lambda (param prev)
+ (if (not param)
+ prev
+ (let ((aparemfato (car param))
+ (attested (cdr param)))
+ (cons
(cons
- (list-ref t 2)
- (conjugation:attested x))
- #f)))
- (conjugate verb voice "sub" "Αόριστος"
- #:nopart)))
- (part (conj-info #:particle conj))
- (fold-id (conj-info #:fold conj)))
- (fold
- (lambda (param prev)
- (if (not param)
- prev
- (let ((aparemfato (car param))
- (attested (cdr param)))
- (cons
- (cons
- (append
- (map
- (lambda (aux flag)
- (if (char=? flag #\-)
- #f
- (elstr->string
- (if part
- (elstr-append part " " aux " "
- aparemfato)
- (elstr-append aux " " aparemfato)))))
- (conjugation:table
- (car (conjugate (conj-info #:aux conj)
- "act" "ind"
- (conj-info #:auxtense conj))))
- (string->list (or (verb-get vinfo #:accmap)
- (conj-info #:accmap conj)
- "000000")))
- (list (verb-get vinfo #:conj)
- attested))
- fold-id)
- prev))))
- prev
- aparemfato-list)))
- ((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
- (let ((vinfo (copy-tree vinfo)))
- (if (verb-get vinfo #:stem)
- (verb-set! vinfo #:attested 'stem)
- (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))))
-
- (fold
- (lambda (suffix prev)
- (append
- (fold
- (lambda (stem prev)
- (cons
- (cons
- (append (apply-flect conj vinfo verb stem suffix)
- (list (verb-get vinfo #:conj)
- (verb-get vinfo #:attested)))
- (conj-info #:fold conj))
- prev))
- '()
- (verb-get vinfo #:stem))
- prev))
- prev
- (get-suffix conj vinfo))))))
- '()
- conj-list))))))))
+ (append
+ (map
+ (lambda (aux flag)
+ (if (char=? flag #\-)
+ #f
+ (elstr->string
+ (if part
+ (elstr-append part " " aux " "
+ aparemfato)
+ (elstr-append aux " " aparemfato)))))
+ (conjugation:table
+ (car (conjugate
+ (conjugator:open-verb
+ (conj-info #:aux conj))
+ "act" "ind"
+ (conj-info #:auxtense conj))))
+ (string->list (or (vinfo-get vinfo #:accmap)
+ (conj-info #:accmap conj)
+ "000000")))
+ (list (vinfo-get vinfo #:conj)
+ attested))
+ fold-id)
+ prev))))
+ prev
+ aparemfato-list)))
+ ((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 vinfo voice "ind"
+ (conj-info #:auxtense conj) #:noload))))
+ (else
+ (let ((vinfo (copy-tree vinfo)))
+ (if (vinfo-get vinfo #:stem)
+ (vinfo-set! vinfo #:attested 'stem)
+ (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))))
+
+ (fold
+ (lambda (suffix prev)
+ (append
+ (fold
+ (lambda (stem prev)
+ (cons
+ (cons
+ (append (apply-flect conj vinfo verb stem suffix)
+ (list (vinfo-get vinfo #:conj)
+ (vinfo-get vinfo #:attested)))
+ (conj-info #:fold conj))
+ prev))
+ '()
+ (vinfo-get vinfo #:stem))
+ prev))
+ prev
+ (get-suffix conj vinfo))))))
+ '()
+ conj-list)))))))))
+
+(define-public (conjugator:open-verb verb)
+ (create-basic-verb-info verb))
(define-public (conjugator verb voice mood tense)
- (conjugate verb voice mood tense))
+ (conjugate (conjugator:open-verb verb) voice mood tense))
(define-public (conjugation:table conj)
diff --git a/src/ellinika/tests/conj-test b/src/ellinika/tests/conj-test
new file mode 100755
index 0000000..fbacae1
--- /dev/null
+++ b/src/ellinika/tests/conj-test
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+testdir=conj.dir
+failures=0
+
+testcon() {
+ if guile -s conj/$1.scm | diff -pu samples/$1 - > $testdir/$1.diff
+ then
+ status=PASS
+ rm $testdir/$1.diff
+ else
+ status=FAIL
+ failures=1
+ fi
+ echo "$1: $status"
+}
+
+if ! test -d $testdir; then
+ mkdir $testdir || exit 2
+fi
+
+if test $# -gt 0; then
+ for verb in $*
+ do
+ testcon $verb
+ done
+else
+ find samples -type f -printf '%f\n' |
+ while read verb
+ do
+ testcon $verb
+ done
+fi
+
+if test $failures -eq 0; then
+ rmdir $testdir
+fi
+
+exit $failures
diff --git a/src/ellinika/tests/conj/anoigv.scm b/src/ellinika/tests/conj/anoigv.scm
index 4ba6e12..cb42dba 100644
--- a/src/ellinika/tests/conj/anoigv.scm
+++ b/src/ellinika/tests/conj/anoigv.scm
@@ -2,2 +2,3 @@
(test-conjugation:verb "ανοίγω")
+;(test-conjugation:tense "ανοίγω" "pas" "imp" "Αόριστος")
diff --git a/src/ellinika/tests/conj/bastav.scm b/src/ellinika/tests/conj/bastav.scm
new file mode 100644
index 0000000..bdf5a5d
--- /dev/null
+++ b/src/ellinika/tests/conj/bastav.scm
@@ -0,0 +1,3 @@
+(use-modules ((ellinika test-conjugation)))
+
+(test-conjugation:verb "βαστάω")
diff --git a/src/ellinika/tests/conj/lev.scm b/src/ellinika/tests/conj/lev.scm
new file mode 100644
index 0000000..c42ad93
--- /dev/null
+++ b/src/ellinika/tests/conj/lev.scm
@@ -0,0 +1,10 @@
+(use-modules ((ellinika test-conjugation)))
+
+(test-conjugation:verb "λέω")
+;(test-conjugation:tense "λέω" "pas" "ind" "Αόριστος")
+;(test-conjugation:tense "λέω" "act" "ind" "Ενεστώτας")
+;(test-conjugation:tense "λέω" "act" "ind" "Παρακείμενος")
+;(test-conjugation:tense "λέω" "act" "ind" "Μέλλοντας διαρκείας")
+;(test-conjugation:tense "λέω" "act" "ind" "Παρατατικός")
+;(test-conjugation:tense "λέω" "pas" "ind" "Μέλλοντας στιγμιαίος")
+;(test-conjugation:tense "λέω" "pas" "imp" "Αόριστος") \ No newline at end of file
diff --git a/src/ellinika/tests/conj/milav.scm b/src/ellinika/tests/conj/milav.scm
new file mode 100644
index 0000000..413dd72
--- /dev/null
+++ b/src/ellinika/tests/conj/milav.scm
@@ -0,0 +1,5 @@
+(use-modules ((ellinika test-conjugation)))
+
+(test-conjugation:verb "μιλάω")
+;(test-conjugation:tense "μιλάω" "act" "ind" "Μέλλοντας διαρκείας")
+;(test-conjugation:tense "μιλάω" "act" "ind" "Ενεστώτας")
diff --git a/src/ellinika/tests/conj/ntynv.scm b/src/ellinika/tests/conj/ntynv.scm
index 1fd1545..42b