aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgi-bin/conj.scm42
-rw-r--r--src/ellinika/conjugator.scm142
-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
38 files changed, 1032 insertions, 60 deletions
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
@@ -384,7 +384,7 @@ ifelse(IFACE,[CGI],(cgi:init))
384 ((class) 384 ((class)
385 (print-footnote "class-na" "*" 385 (print-footnote "class-na" "*"
386 "Conjugation class of this verb is not attested")) 386 "Conjugation class of this verb is not attested"))
387 ((root) 387 ((stem)
388 (print-footnote "stem-na" "?" 388 (print-footnote "stem-na" "?"
389 (_ "Το θέμα αυτού του χρόνου δεν επιβεβαιώνεται από τη βάση δεδοµένων"))))) 389 (_ "Το θέμα αυτού του χρόνου δεν επιβεβαιώνεται από τη βάση δεδοµένων")))))
390 unattested) 390 unattested)
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
@@ -37,7 +37,7 @@
37;; properties - associative list of properties 37;; properties - associative list of properties
38;; attested 38;; attested
39 39
40(define (verb-set! verb key value) 40(define (vinfo-set! verb key value)
41; (format #t "VERB ~A KEY ~A VALUE ~A~%" verb key value) 41; (format #t "VERB ~A KEY ~A VALUE ~A~%" verb key value)
42 (case key 42 (case key
43 ((#:conj) 43 ((#:conj)
@@ -60,7 +60,7 @@
60 (cons key value))))))))) 60 (cons key value)))))))))
61 61
62 62
63(define (verb-get verb key) 63(define (vinfo-get verb key)
64 (case key 64 (case key
65 ((#:conj) 65 ((#:conj)
66 (list-ref verb 0)) 66 (list-ref verb 0))
@@ -103,8 +103,8 @@
103 (let ((verbprop (ellinika:sql-query 103 (let ((verbprop (ellinika:sql-query
104 "SELECT property,value FROM verbtense WHERE \ 104 "SELECT property,value FROM verbtense WHERE \
105verb=\"~A\" AND voice=\"~A\" AND mood=\"~A\" AND tense=\"~A\"" 105verb=\"~A\" AND voice=\"~A\" AND mood=\"~A\" AND tense=\"~A\""
106 (verb-get vinfo #:verb) voice mood tense))) 106 (vinfo-get vinfo #:verb) voice mood tense)))
107 (verb-set! 107 (vinfo-set!
108 vinfo #:proplist 108 vinfo #:proplist
109 (let loop ((inlist (if (null? verbprop) 109 (let loop ((inlist (if (null? verbprop)
110 '() 110 '()
@@ -194,6 +194,11 @@ verb=\"~A\" AND voice=\"~A\" AND mood=\"~A\" AND tense=\"~A\""
194 (else 194 (else
195 (elstr-append stem "ηθ"))))) 195 (elstr-append stem "ηθ")))))
196 196
197(define (thema-aoristou-prostaktikhs stem)
198 (if (elstr-suffix? stem "β" "γ" "θ" "ν")
199 (elstr-append stem "ε")
200 stem))
201
197(define (lookup-verb-info verb voice thema) 202(define (lookup-verb-info verb voice thema)
198 (ellinika:sql-query 203 (ellinika:sql-query
199 "SELECT stem FROM irregular_stem \ 204 "SELECT stem FROM irregular_stem \
@@ -210,6 +215,7 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
210 (throw 'conjugator-error 'conjugator-error-input 215 (throw 'conjugator-error 'conjugator-error-input
211 "cannot handle ~A" (list (force-string verb)))))) 216 "cannot handle ~A" (list (force-string verb))))))
212 217
218;; FIXME: Use vinfo #:verb instead of the verb argument.
213(define (complement-verb-info vinfo verb voice thema) 219(define (complement-verb-info vinfo verb voice thema)
214; (format #t "COMPLEMENT ~A~%" vinfo) 220; (format #t "COMPLEMENT ~A~%" vinfo)
215 (let ((elverb (string->elstr verb)) 221 (let ((elverb (string->elstr verb))
@@ -217,53 +223,58 @@ WHERE verb=\"~A\" AND voice=\"~A\" AND thema=\"~A\""
217 (if (and (null? tmpres) (string=? thema "sub")) 223 (if (and (null? tmpres) (string=? thema "sub"))
218 (lookup-verb-info verb voice "aor") 224 (lookup-verb-info verb voice "aor")
219 tmpres)))) 225 tmpres))))
220 (verb-set! vinfo #:stem 226 (vinfo-set! vinfo #:stem
221 (cond 227 (cond
222 ((not (null? result)) 228 ((not (null? result))
223 (verb-set! vinfo #:attested 'stem) 229 (vinfo-set! vinfo #:attested 'stem)
224 (map car result)) 230 (map car result))
225 ((string=? (verb-get vinfo #:conj) "A") 231 ((string=? (vinfo-get vinfo #:conj) "A")
226 (let ((stem (verb-A-stem elverb))) 232 (let ((stem (verb-A-stem elverb)))
227 (cond 233 (cond
228 ((string=? thema "pres") 234 ((string=? thema "pres")
229 (verb-set! vinfo #:attested 'stem) 235 (vinfo-set! vinfo #:attested 'stem)
230 stem) 236 stem)
231 ((or (string=? thema "aor") (string=? thema "sub")) 237 ((or (string=? thema "aor") (string=? thema "sub"))
232 (if (string=? voice "act") 238 (cond
233 (elstr-thema-aoristoy stem) 239 ((string=? voice "act")
234 (thema-aoristoy-mesapathitikis-A stem))) 240 (elstr-thema-aoristoy stem))
241 ((string=? voice "pas")
242 (thema-aoristoy-mesapathitikis-A stem))
243 (else
244 (throw 'conjugator-error 'conjugator-error-db
245 "invalid voice ~A" (list voice)))))
235 (else 246 (else
236 #f)))) 247 #f))))
237 ((string=? (verb-get vinfo #:conj) "A-depon") 248 ((string=? (vinfo-get vinfo #:conj) "A-depon")
238 (let ((stem (verb-A-stem elverb))) 249 (let ((stem (verb-A-stem elverb)))
239 (cond 250 (cond
240 ((string=? thema "pres") 251 ((string=? thema "pres")
241 (verb-set! vinfo #:attested 'stem) 252 (vinfo-set! vinfo #:attested 'stem)
242 stem) 253 stem)
243 ((or (string=? thema "aor") (string=? thema "sub")) 254 ((or (string=? thema "aor") (string=? thema "sub"))
244 #f) ; FIXME 255 #f) ; FIXME
245 (else 256 (else
246 #f)))) 257 #f))))
247 ((string=? (verb-get vinfo #:conj) "B1") 258 ((string=? (vinfo-get vinfo #:conj) "B1")
248 (let ((stem (if (elstr-suffix? elverb "άω") 259 (let ((stem (if (elstr-suffix? elverb "άω")
249 (elstr-trim elverb -2) 260 (elstr-trim elverb -2)
250 (elstr-trim elverb -1)))) 261 (elstr-trim elverb -1))))
251 (cond 262 (cond
252 ((or (string=? voice "act") (string=? thema "pres")) 263 ((or (string=? voice "act") (string=? thema "pres"))
253 (verb-set! vinfo #:attested 'stem) 264 (vinfo-set! vinfo #:attested 'stem)
254 stem) 265 stem)
255 ((or (string=? thema "aor") (string=? thema "sub")) 266 ((or (string=? thema "aor") (string=? thema "sub"))
256 (map 267 (map
257 (lambda (aor) 268 (lambda (aor)
258 (thema-aoristoy-mesapathitikis-B stem aor)) 269 (thema-aoristoy-mesapathitikis-B stem aor))
259 (conjugate verb "act" "ind" "Αόριστος"))) 270 (conjugate vinfo "act" "ind" "Αόριστος")))
260 (else 271 (else
261 #f)))) 272 #f))))
262 ((string=? (verb-get vinfo #:conj) "B2") 273 ((string=? (vinfo-get vinfo #:conj) "B2")
263 (let ((stem (elstr-trim elverb -1))) 274 (let ((stem (elstr-trim elverb -1)))
264 (cond 275 (cond
265 ((or (st