aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-06-01 19:04:44 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-06-01 19:04:44 +0000
commitaa16df5101636cc3d64da716c824d65559b3615d (patch)
treeeb1a611ce23d923797db6fdd10eb5e6bfe25ff0a
parent435bc4a93a5a8318619e66d0cfaf5a6e7eb9d465 (diff)
downloadellinika-aa16df5101636cc3d64da716c824d65559b3615d.tar.gz
ellinika-aa16df5101636cc3d64da716c824d65559b3615d.tar.bz2
* cgi-bin/dico-ellinika.scm4
(match-exact,match-prefix,match-suffix,match-extnd-regex) (match-default): Show only entries that have articles in the required target language. git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@513 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rw-r--r--ChangeLog3
-rw-r--r--cgi-bin/dico-ellinika.scm425
2 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 5efe941..fa7665a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
* cgi-bin/dico-ellinika.scm4 (target-language): Remove global.
Store target language in the database handler.
+ (match-exact,match-prefix,match-suffix,match-extnd-regex)
+ (match-default): Show only entries that have articles in the
+ required target language.
* scm/dictrans.scm (insert-node): Fix inserts into links table.
diff --git a/cgi-bin/dico-ellinika.scm4 b/cgi-bin/dico-ellinika.scm4
index a30e33d..9bb92e4 100644
--- a/cgi-bin/dico-ellinika.scm4
+++ b/cgi-bin/dico-ellinika.scm4
@@ -174,30 +174,34 @@ Invariant Sections, no Front-Cover and Back-Cover Texts"))
(define (match-exact dbh strat word)
(my-sql-query
(dbh:conn dbh)
- (string-append "SELECT DISTINCT word FROM dict WHERE word=\""
+ (string-append "SELECT DISTINCT dict.word FROM dict, articles WHERE dict.word=\""
(ellinika:translate-input word)
- "\" ORDER BY 1")))
+ "\" AND dict.ident=articles.ident "
+ "AND articles.lang='" (dbh:lang dbh) "' ORDER BY 1")))
(define (match-prefix dbh strat word)
(my-sql-query
(dbh:conn dbh)
- (string-append "SELECT DISTINCT word FROM dict WHERE word LIKE \""
+ (string-append "SELECT DISTINCT dict.word FROM dict, articles WHERE dict.word LIKE \""
(ellinika:translate-input word)
- "%\" ORDER BY 1")))
+ "%\" AND dict.ident=articles.ident "
+ "AND articles.lang='" (dbh:lang dbh) "' ORDER BY 1")))
(define (match-suffix dbh strat word)
(my-sql-query
(dbh:conn dbh)
- (string-append "SELECT DISTINCT word FROM dict WHERE word LIKE \"%"
+ (string-append "SELECT DISTINCT dict.word FROM dict, articles WHERE dict.word LIKE \"%"
(ellinika:translate-input word)
- "\" ORDER BY 1")))
+ "\" AND dict.ident=articles.ident "
+ "AND articles.lang='" (dbh:lang dbh) "' ORDER BY 1")))
(define (match-extnd-regex dbh strat word)
(my-sql-query
(dbh:conn dbh)
- (string-append "SELECT DISTINCT word FROM dict WHERE word regexp \""
+ (string-append "SELECT DISTINCT dict.word FROM dict, articles WHERE dict.word regexp \""
(ellinika:translate-input word)
- "\" ORDER BY 1")))
+ "\" AND dict.ident=articles.ident "
+ "AND articles.lang='" (dbh:lang dbh) "' ORDER BY 1")))
(define (match-basic-regex dbh strat word)
#f) ;FIXME
@@ -205,9 +209,10 @@ Invariant Sections, no Front-Cover and Back-Cover Texts"))
(define (match-default dbh strat word)
(my-sql-query
(dbh:conn dbh)
- (string-append "SELECT DISTINCT word FROM dict WHERE sound LIKE \""
+ (string-append "SELECT DISTINCT dict.word FROM dict,articles WHERE dict.sound LIKE \""
(ellinika:sounds-like word)
- "%\"")))
+ "%\" AND dict.ident=articles.ident "
+ "AND articles.lang='" (dbh:lang dbh) "' ORDER BY 1")))
(define strategy-list

Return to:

Send suggestions and report system problems to the System administrator.