aboutsummaryrefslogtreecommitdiff
path: root/cgi-bin/dict.cgi.in
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/dict.cgi.in')
-rw-r--r--cgi-bin/dict.cgi.in27
1 files changed, 23 insertions, 4 deletions
diff --git a/cgi-bin/dict.cgi.in b/cgi-bin/dict.cgi.in
index cfe2f64..8251f88 100644
--- a/cgi-bin/dict.cgi.in
+++ b/cgi-bin/dict.cgi.in
@@ -118,7 +118,8 @@
(cons "επίθετο" "dict.pos=\"επίθ.\"")
(cons "επίρρημα" "dict.pos=\"επίρρ.\"")
(cons "επιφώνημα" "dict.pos=\"επιφ.\"")
- (cons "μετοχή" "dict.pos=\"μετοχή\"")
+ (cons "μετοχή" "dict.pos=\"μετοχή\"")
+ (cons "μόριο" "dict.pos=\"μόριο\"")
(cons "πρόθεση" "dict.pos=\"πρόθ.\"")
(cons "σύνδεσμος" "dict.pos=\"σύνδ.\"")
(cons "ουσιαστικό" "(dict.pos=\"ο\" OR dict.pos=\"η\" OR dict.pos=\"το\")")))
@@ -413,7 +414,6 @@
;; Translate the input string to UTF-8 if necessary.
-;; FIXME: currently does nothing
(define (translate-input input)
(if (< (char->integer (string-ref input 0)) 127)
(translate-kbd input)
@@ -568,6 +568,22 @@
c))
sl)))))
+;;
+(define (replace-tilde word sentence)
+ (apply
+ string-append
+ (let loop ((lst '())
+ (str sentence))
+ (cond
+ ((string-index str #\~) =>
+ (lambda (x)
+ (loop
+ (append lst (list (substring str 0 x) word))
+ (substring str (1+ x)))))
+ ((string-null? str)
+ lst)
+ (else
+ (append lst (list str)))))))
;;
(define (display-results rlist)
@@ -605,7 +621,7 @@
(display "<TR><TD>")
(display (1+ (string->number (list-ref x 4))))
(display "</TD><TD>")
- (display (list-ref x 5))
+ (display (replace-tilde (car x) (list-ref x 5)))
(display ";</TD></TR>"))
rlist)
(display "</TABLE>")
@@ -713,7 +729,10 @@
(theme (or (cgi:value "TOPIC") "0"))
(pos (or (cgi:value "POS") "0")))
(cond
- ((and keyval (not (string-null? keyval)))
+ ((and keyval
+ (not (string-null? keyval))
+ (= (string->number theme) 0)
+ (= (string->number pos) 0))
(let ((conn (sql-connect
sql-iface sql-host sql-port sql-database
sql-username sql-password)))

Return to:

Send suggestions and report system problems to the System administrator.