diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-06-01 19:04:44 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-06-01 19:04:44 +0000 |
commit | aa16df5101636cc3d64da716c824d65559b3615d (patch) | |
tree | eb1a611ce23d923797db6fdd10eb5e6bfe25ff0a /cgi-bin | |
parent | 435bc4a93a5a8318619e66d0cfaf5a6e7eb9d465 (diff) | |
download | ellinika-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
Diffstat (limited to 'cgi-bin')
-rw-r--r-- | cgi-bin/dico-ellinika.scm4 | 25 |
1 files changed, 15 insertions, 10 deletions
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 |