aboutsummaryrefslogtreecommitdiff
path: root/src/cgi-bin/conj.scm4
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgi-bin/conj.scm4')
-rw-r--r--src/cgi-bin/conj.scm453
1 files changed, 40 insertions, 13 deletions
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4
index 7f7d347..72da00e 100644
--- a/src/cgi-bin/conj.scm4
+++ b/src/cgi-bin/conj.scm4
@@ -105,11 +105,6 @@ ifelse(IFACE,[CGI],(cgi:init))
(cdr tense))))
(display "<th>")
(cond
- ((not (member 'class att))
- (display "<a href=\"#class-na\">*</a>&nbsp;")
- (if (not (member 'class unattested))
- (set! unattested (cons 'class unattested)))))
- (cond
((not (member 'root att))
(display "<a href=\"#root-na\">?</a>&nbsp;")
(if (not (member 'root unattested))
@@ -230,6 +225,31 @@ ifelse(IFACE,[CGI],(cgi:init))
(apply format #t fmtstr fmtargs)
(display "</h2>"))
+(define (class-attested? result)
+ (call-with-current-continuation
+ (lambda (return)
+ (for-each
+ (lambda (voice)
+ (for-each
+ (lambda (mood)
+ (for-each
+ (lambda (tense-list)
+ (for-each
+ (lambda (tense)
+ (if (and (not (empty-conjugation? tense))
+ (conjugation:attested tense))
+ (return (member 'class (conjugation:attested tense)))))
+ (cdr tense-list)))
+ (cdr mood)))
+ (cdr voice)))
+ result)
+ (return #f))))
+
+(define (dict-cgi-name)
+ (let* ((my-name cgi-script-name)
+ (slpos (string-rindex my-name #\/)))
+ (string-append (substring my-name 0 slpos) "/dict.SCRIPT_SUFFIX")))
+
(define (show-conjugation verb)
(catch #t
(lambda ()
@@ -244,17 +264,24 @@ ifelse(IFACE,[CGI],(cgi:init))
(language-code target-language))))
(cond
((and descr (not (null? descr)))
- (format #t "<h2 class=\"verb\">~A - ~A</h2>"
+ (format #t "<h2 class=\"verb\"><a href=\"~A\">~A - ~A</a></h2>"
+ (make-cgi-name
+ (dict-cgi-name) "ident" (dict:encode-string verb))
verb (caar descr)))
(else
- (format #t "<h2 class=\"verb\">~A - (~A)</h2>"
+ (format #t
+ "<h2 class=\"verb\">~A - <span class=\"error\">(~A)</span></h2>"
verb
(_ "δεν βρέθηκε στο λέξικο")))))
-
- (for-each
- (lambda (voice)
- (show-conjugation:voice voice))
- (conjugate-all verb)))
+ (let ((result (conjugate-all verb)))
+ (if (not (class-attested? result))
+ (format #t
+ "<div class=\"unattested\"><p>~A</p></div>"
+ (_ "Η συζυγία αυτό του ρήματος δεν επιβεβαιώνεται από τη βάση δεδοµένων")))
+ (for-each
+ (lambda (voice)
+ (show-conjugation:voice voice))
+ result)))
(lambda (key . args)
(case key
((conjugator-error)
@@ -362,7 +389,7 @@ ifelse(IFACE,[CGI],(cgi:init))
"Conjugation class of this verb is not attested"))
((root)
(print-footnote "root-na" "?"
- "Stem of this verb is not attested"))))
+ (_ "Το θέμα αυτού του χρόνου δεν επιβεβαιώνεται από τη βάση δεδοµένων")))))
unattested)
(display "</div>"))

Return to:

Send suggestions and report system problems to the System administrator.