aboutsummaryrefslogtreecommitdiff
path: root/cgi-bin/dict.cgi.in
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-04-18 15:23:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-04-18 15:23:08 +0000
commitc3648e7262369770630270f01f1bd18ca13fa900 (patch)
tree68da4d7d266107c4e84610a91c88238ca853fb12 /cgi-bin/dict.cgi.in
parent721b78db0086ba839a178567ec9ec9f23adee7ca (diff)
downloadellinika-c3648e7262369770630270f01f1bd18ca13fa900.tar.gz
ellinika-c3648e7262369770630270f01f1bd18ca13fa900.tar.bz2
(display-results): Replace tilde in
dictionary articles. (dict-search): Make the first condition stricter. git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@86 941c8c0f-9102-463b-b60b-cd22ce0e6858
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.