aboutsummaryrefslogtreecommitdiff
path: root/scm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-11 13:45:35 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-06-11 13:45:35 +0300
commit169d0e2887a40e4d845efcaa1e46ec49d02421b7 (patch)
treec15cbf4bd8b94bd86b4da7253acd1a43e96f57e0 /scm
parenta1a5b7ddd6c3c0532c37551b24fd573a554ac181 (diff)
downloadellinika-169d0e2887a40e4d845efcaa1e46ec49d02421b7.tar.gz
ellinika-169d0e2887a40e4d845efcaa1e46ec49d02421b7.tar.bz2
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) <elmorph:iota>: 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.
Diffstat (limited to 'scm')
-rw-r--r--scm/conjugator.scm61
1 files changed, 48 insertions, 13 deletions
diff --git a/scm/conjugator.scm b/scm/conjugator.scm
index c2c2171..7783d3a 100644
--- a/scm/conjugator.scm
+++ b/scm/conjugator.scm
@@ -1,6 +1,7 @@
(use-modules (ellinika elmorph)
(ellinika i18n)
(ellinika cgi)
+ (ellinika tenses)
(xmltools dict)
(gamma sql))
@@ -170,6 +171,16 @@ WHERE verb='" verb "' AND voice='" voice "' AND thema='" thema "'")))
(thema-aoristoy-mesapathitikis root)))
(else
#f))))
+ ((string=? (verb-info #:conj vinfo) "A-depon")
+ (let ((root (verb-A-root elverb)))
+ (cond
+ ((string=? thema "pres")
+ (verb-info-set! #:attested vinfo 'root)
+ root)
+ ((or (string=? thema "aor") (string=? thema "sub"))
+ #f) ; FIXME
+ (else
+ #f))))
((string=? (verb-info #:conj vinfo) "B1")
(let ((root (if (elstr-suffix? elverb "άω")
(elstr-trim elverb -2)
@@ -295,6 +306,7 @@ WHERE c.conj='" conj "' AND c.voice='" voice "' AND c.mood='" mood
(+ (- len syl) 1))))
(define (apply-flect conj vinfo verb)
+; (format #t "VINFO ~A~%" vinfo)
(let ((root (verb-info #:root vinfo))
(suffix (let ((s (conj-info #:suffix conj)))
(if s
@@ -344,12 +356,17 @@ WHERE c.conj='" conj "' AND c.voice='" voice "' AND c.mood='" mood
#f)
((char-numeric? acc)
(let ((num (- (char->integer acc) (char->integer #\0))))
- (let ((obj (elstr-append root suffix flect)))
+ (let ((obj (elstr-append
+ root suffix flect)))
(if (and augment (= (+ (elstr-number-of-syllables obj) 1)
num))
(set! obj (elstr-append augment obj)))
- (elstr-set-accent! obj num)
- obj)))
+ (let ((nsyl (elstr-number-of-syllables obj)))
+ (elstr-set-accent! obj (cond
+ ((< num nsyl) num)
+ ((< nsyl 3) nsyl)
+ (else 3)))
+ obj))))
(else
(error "invalid accent character" acc))))
(conj-info #:flect conj)
@@ -392,7 +409,7 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
(conj-info-set! #:particle conj #f))
(cond
((string=? (conj-info #:thema conj) "synt")
- (let* ((verb-conj (conjugate verb "act" "sub" "Αόριστος" #:nopart))
+ (let* ((verb-conj (conjugate verb voice "sub" "Αόριστος" #:nopart))
(form (list-ref verb-conj 2))
(part (conj-info #:particle conj)))
(cond
@@ -400,13 +417,18 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
; (format #t "FORM ~A FROM ~A~%" form verb-conj);;FIXME
(append
(map
- (lambda (aux)
- (elstr->string
- (if part
- (elstr-append part " " aux " " form)
- (elstr-append aux " " form))))
+ (lambda (aux flag)
+ (if (char=? flag #\-)
+ #f
+ (elstr->string
+ (if part
+ (elstr-append part " " aux " " form)
+ (elstr-append aux " " form)))))
(conjugation:table (conjugate (conj-info #:aux conj) "act" "ind"
- (conj-info #:auxtense conj))))
+ (conj-info #:auxtense conj)))
+ (string->list (or (verb-info #:accmap vinfo)
+ (conj-info #:accmap conj)
+ "000000")))
(list (verb-info #:conj vinfo)
(conjugation:attested verb-conj))))
(else
@@ -485,6 +507,17 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
(newline)
(gc))
+(define (test-voice voice verb)
+ (for-each
+ (lambda (mood-tenses)
+ (let ((mood (car mood-tenses)))
+ (for-each
+ (lambda (tense)
+ (test-conjugation verb voice mood tense))
+ (cdr mood-tenses))))
+ ellinika-tense-list))
+
+;(test-conjugation "διαβάζω" "act" "imp" "Αόριστος")
;; (test-conjugation "είμαι" "act" "ind" "Ενεστώτας")
;; (test-conjugation "είμαι" "act" "ind" "Παρατατίκος")
;; (test-conjugation "είμαι" "act" "ind" "Μέλλοντας διαρκείας")
@@ -546,12 +579,14 @@ WHERE i.verb='" verb "' AND i.voice='" voice "' AND i.mood='" mood
;; (test-conjugation "πίνω" "act" "sub" "Αόριστος")
;; (test-conjugation "πίνω" "act" "imp" "Αόριστος")
-(test-conjugation "έρχομαι" "pas" "ind" "Παρατατικός")
-(test-conjugation "έρχομαι" "pas" "ind" "Αόριστος")
-(test-conjugation "έρχομαι" "pas" "sub" "Αόριστος")
+;(test-conjugation "έρχομαι" "pas" "ind" "Παρατατικός")
+;(test-conjugation "έρχομαι" "pas" "ind" "Αόριστος")
+;(test-conjugation "έρχομαι" "pas" "sub" "Αόριστος")
;; (test-conjugation "έρχομαι" "pas" "ind" "Συντελεσμένος Μέλλοντας")
;; (test-conjugation "έρχομαι" "act" "sub" "Αόριστος" )
;; (test-conjugation "έρχομαι" "pas" "sub" "Αόριστος" )
;; (test-conjugation "έρχομαι" "pas" "ind" "Ενεστώτας");FIXME!
;; (test-conjugation "έρχομαι" "pas" "ind" "Υπερσυντέλικος")
+
+(test-voice "pas" "ντύνω")
(newline)

Return to:

Send suggestions and report system problems to the System administrator.