aboutsummaryrefslogtreecommitdiff
path: root/scm/verbop.scm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-21 12:13:02 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-06-21 12:13:02 +0300
commit119c79bd50659612a9126f6793bd57b48792cb11 (patch)
tree2c282cd1010fd9c913a3aade777f8c9dd8c8ed3b /scm/verbop.scm
parentcc53aa452ef0caca75931a126860500d3bd67f04 (diff)
downloadellinika-119c79bd50659612a9126f6793bd57b48792cb11.tar.gz
ellinika-119c79bd50659612a9126f6793bd57b48792cb11.tar.bz2
Accept multiple suffixes.
* data/irregular-verbs.xml: Update. * scm/verbop.scm: Allow for multiple suffixes. * src/ellinika/conjugator.scm: Accept multiple suffixes. Fix accent settings. * src/cgi-bin/conj.scm4: Minor changes.
Diffstat (limited to 'scm/verbop.scm')
-rw-r--r--scm/verbop.scm57
1 files changed, 32 insertions, 25 deletions
diff --git a/scm/verbop.scm b/scm/verbop.scm
index 464c384..0ad0f90 100644
--- a/scm/verbop.scm
+++ b/scm/verbop.scm
@@ -175,7 +175,15 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (command-line))" "$@"
(define (verb-set what val)
(if (null? verbdef)
(verb-init))
- (list-set! verbdef (verbdef:index what) val))
+ (let ((val (cond
+ ((not (eq? what #:suffix))
+ val)
+ ((list-ref verbdef (verbdef:index what)) =>
+ (lambda (entry)
+ (cons val entry)))
+ (else
+ (list val)))))
+ (list-set! verbdef (verbdef:index what) val)))
(define (verb-init)
(set! verbdef (make-list 9 #f))
@@ -331,27 +339,31 @@ VALUES (~Q,~Q,~Q,~Q)"
; (format #t "MOOD ~A~%" mood-ref)
(for-each
(lambda (tense-name)
- (let* ((tense (or (assoc tense-name (cdr mood-ref))
- (begin
- (append!
- mood-ref
- (list
- (cons tense-name
- (append
- (make-list 6 #f)
- (list
- (cons "default" #t))))))
-; (format #t "NM ~A~%" mood-ref)
- (assoc tense-name
- (cdr mood-ref)))))
+ (let* ((tense
+ (or (assoc tense-name (cdr mood-ref))
+ (begin
+ (append!
+ mood-ref
+ (list
+ (cons tense-name
+ (append
+ (make-list 6 #f)
+ (list
+ (cons "default" #t))))))
+; (format #t "NM ~A~%" mood-ref)
+ (assoc tense-name
+ (cdr mood-ref)))))
(prop (begin
-; (format #t "TENSE ~A~%" tense)
+; (format #t "TENSE ~A~%" tense)
(list-tail tense 7))))
-; (format #t "PROP ~A ~A~%" tense prop)
+; (format #t "PROP ~A ~A~%" tense prop)
(if (not (assoc attr prop))
- (append! tense
- (list
- (cons attr value))))))
+ (for-each
+ (lambda (value)
+ (append! tense
+ (list
+ (cons attr value))))
+ (if (list? value) value (list value))))))
(cdr mood-tenses))))
mtlist)))))
attrlist))
@@ -506,12 +518,7 @@ VALUES (~Q,~Q,~Q,~Q)"
(tag attr text)
(cond
((xmltrans:parent? "v")
- (cond
- ((verb-get #:suffix)
- (xmltrans:parse-error #f "Suffix was already defined")
- (mark-invalid))
- (else
- (verb-set #:suffix text))))
+ (verb-set #:suffix text))
((xmltrans:parent? "t")
(set! tense-prop (cons (cons "suffix" text) tense-prop)))
(else

Return to:

Send suggestions and report system problems to the System administrator.