diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-10-13 18:58:56 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-10-13 18:58:56 +0000 |
commit | 94911abf57ac2b00e4f628758bb9bb5c082d6c27 (patch) | |
tree | d2aa87bd03909550387889998705b3d930c0adf5 /scm/dictrans.scm | |
parent | df27356dc608f79869777ab61af9fc474b3be283 (diff) | |
download | ellinika-94911abf57ac2b00e4f628758bb9bb5c082d6c27.tar.gz ellinika-94911abf57ac2b00e4f628758bb9bb5c082d6c27.tar.bz2 |
#:topic was handled incorrectly. Improved --help output
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@238 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'scm/dictrans.scm')
-rw-r--r-- | scm/dictrans.scm | 72 |
1 files changed, 51 insertions, 21 deletions
diff --git a/scm/dictrans.scm b/scm/dictrans.scm index fb4064f..d0724b0 100644 --- a/scm/dictrans.scm +++ b/scm/dictrans.scm | |||
@@ -84,7 +84,7 @@ | |||
84 | 84 | ||
85 | ;;; Tailor this statement to your needs if necessary. | 85 | ;;; Tailor this statement to your needs if necessary. |
86 | ;=GUILE_COMMENT=;(set! %load-path (cons "=GUILE_SITE=" %load-path)) | 86 | ;=GUILE_COMMENT=;(set! %load-path (cons "=GUILE_SITE=" %load-path)) |
87 | 87 | (set! %load-path (cons "/home/gray/linguae/ellinika/" %load-path)) | |
88 | (use-modules (xmltools xmltrans) | 88 | (use-modules (xmltools xmltrans) |
89 | (gamma sql) | 89 | (gamma sql) |
90 | (ellinika xlat) | 90 | (ellinika xlat) |
@@ -212,32 +212,25 @@ | |||
212 | (mark-invalid))) | 212 | (mark-invalid))) |
213 | (vector-set! node 1 f))) | 213 | (vector-set! node 1 f))) |
214 | ((node-set #:xref node x) | 214 | ((node-set #:xref node x) |
215 | (cond | 215 | (vector-set! node 2 (append (node-get #:xref node) (list x)))) |
216 | ((node-get #:xref node) => | ||
217 | (lambda (xlist) | ||
218 | (vector-set! node 2 (append xlist (list x))))) | ||
219 | (else | ||
220 | (vector-set! node 2 (list x))))) | ||
221 | ((node-set #:p-article node p) | 216 | ((node-set #:p-article node p) |
222 | (cond | 217 | (vector-set! node 3 (append (node-get #:p-list node) (list p)))) |
223 | ((node-get #:p-list node) => | ||
224 | (lambda (plist) | ||
225 | (vector-set! node 3 (append plist (list p))))) | ||
226 | (else | ||
227 | (vector-set! node 3 (list p))))) | ||
228 | ((node-set #:topic node t) | 218 | ((node-set #:topic node t) |
229 | ;; FIXME: Scope of <T> is position-dependent relative to <P> | 219 | ;; FIXME: Scope of <T> is position-dependent relative to <P> |
230 | (for-each | 220 | (let ((pl (node-get #:p-list node))) |
231 | (lambda (p) | 221 | (if (null? pl) |
232 | (p-article-set #:topic p t)) | 222 | (current-article-set #:topic t) |
233 | (node-get #:p-list node))) | 223 | (for-each |
224 | (lambda (p) | ||
225 | (p-article-set #:topic p t)) | ||
226 | pl)))) | ||
234 | ((node-set #:locus node loc) | 227 | ((node-set #:locus node loc) |
235 | (vector-set! node 4 loc)))) | 228 | (vector-set! node 4 loc)))) |
236 | 229 | ||
230 | |||
237 | (define-macro (current-node-set key val) | 231 | (define-macro (current-node-set key val) |
238 | `(node-set ,key current-node ,val)) | 232 | `(node-set ,key current-node ,val)) |
239 | 233 | ||
240 | |||
241 | (define p-article #f) | 234 | (define p-article #f) |
242 | 235 | ||
243 | (define-syntax p-article-get | 236 | (define-syntax p-article-get |
@@ -280,9 +273,13 @@ | |||
280 | ((p-article-set #:topic article val) | 273 | ((p-article-set #:topic article val) |
281 | (p-set #:topic article 4 val)))) | 274 | (p-set #:topic article 4 val)))) |
282 | 275 | ||
283 | (define-macro (current-article-set key val) | 276 | ;(define-macro (current-article-set key val) |
284 | `(p-article-set ,key p-article ,val)) | 277 | ; `(p-article-set ,key p-article ,val)) |
285 | 278 | ||
279 | (define-syntax current-article-set | ||
280 | (syntax-rules () | ||
281 | ((current-article-set key val) | ||
282 | (p-article-set key p-article val)))) | ||
286 | 283 | ||
287 | ;;; Node list | 284 | ;;; Node list |
288 | (define node-list '()) | 285 | (define node-list '()) |
@@ -809,7 +806,40 @@ | |||
809 | (help))) | 806 | (help))) |
810 | 807 | ||
811 | (define (usage) | 808 | (define (usage) |
812 | (display "usage: dictrans OPTIONS FILES\n")) | 809 | (display "usage: dictrans OPTIONS FILES |
810 | dictrans parses XML dictionary files in Ellinika dictionary format | ||
811 | and stores them into SQL database. | ||
812 | |||
813 | General options: | ||
814 | |||
815 | --check Only check input syntax and consistency. Do not | ||
816 | update the database. This means that dictrans will | ||
817 | not access the database at all, so some errors | ||
818 | (mistyped parts of speech and the like) may slip in | ||
819 | unnoticed. | ||
820 | --verbose Verbosely display SQL queries and their results. | ||
821 | --debug NUMBER Set debugging level (0 < NUMBER <= 100) | ||
822 | |||
823 | SQL related options: | ||
824 | |||
825 | --interface STRING Select SQL interface to use. STRING may be | ||
826 | either \"mysql\" (the default) or \"postgres\". | ||
827 | --host HOST-OR-PATH Set name or IP address of the host running SQL | ||
828 | database, or path to the database I/O socket. | ||
829 | --database NAME Set name of the database to use. | ||
830 | --port NUMBER Set the SQL port number | ||
831 | --user USER-NAME Set SQL user name. | ||
832 | --password STRING Set the SQL password | ||
833 | |||
834 | --cleanup Clean up the database (delete all entries from all the | ||
835 | tables) before proceeding. Use this option with care. | ||
836 | --preserve Do not delete resolved entries from pending_links | ||
837 | table. This is intended mainly for debugging. | ||
838 | |||
839 | Informational options: | ||
840 | |||
841 | --help Output this help info | ||
842 | \n")) | ||
813 | 843 | ||
814 | (define (cons? p) | 844 | (define (cons? p) |
815 | (and (pair? p) (not (list? p)))) | 845 | (and (pair? p) (not (list? p)))) |