X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql-create.lisp;h=06c5a26cdd5415409471570eab2711722ae11cef;hb=4e62898eedb688c0a44bd257cbcdee07f11ac058;hp=af0dd994e73921240b466d3c69e61b10c560d64a;hpb=965b7cc5c174f0e0b82d1589978f734ea257ed78;p=umlisp.git diff --git a/sql-create.lisp b/sql-create.lisp index af0dd99..06c5a26 100644 --- a/sql-create.lisp +++ b/sql-create.lisp @@ -4,10 +4,10 @@ ;;;; ;;;; Name: sql-create ;;;; Purpose: Create SQL database for UMLisp -;;;; Programmer: Kevin M. Rosenberg +;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: sql-create.lisp,v 1.19 2003/05/06 07:17:35 kevin Exp $ +;;;; $Id: sql-create.lisp,v 1.20 2003/05/06 07:44:07 kevin Exp $ ;;;; ;;;; This file, part of UMLisp, is ;;;; Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D. @@ -34,7 +34,7 @@ (format nil "~a (~a)" sqltype (cmax c)) sqltype)))))) (format nil "CREATE TABLE ~a (~{~a~^,~})" (table file) - (mapcar col-func (ucols-for-umls-file file))))) + (mapcar col-func (ucols-for-ufile file))))) (defun create-custom-table-cmd (tablename sql-cmd) "Return SQL command to create a custom table" @@ -85,7 +85,6 @@ (find-if (lambda (x) (and (string-equal filename (car x)) (string-equal col (cadr x)))) +custom-cols+)) - (defun custom-colnames-for-filename (filename) (mapcar #'cadr (find-custom-cols-for-filename filename))) @@ -196,21 +195,22 @@ This is much faster that using create-umls-db-insert." (defun translate-umls-file (file extension) "Translate a umls file into a format suitable for sql copy cmd" - (translate-files (fil file) extension (list file))) + (translate-files file extension (list file))) (defun make-noneng-index-file (extension) "Make non-english index file" - (translate-files "MRXW.NONENG" extension (noneng-lang-index-files))) + (translate-files (find-ufile "MRXW.NONENG") + extension (noneng-lang-index-files))) -(defun translate-files (output-basename extension input-files) +(defun translate-files (out-ufile extension input-ufiles) "Translate a umls file into a format suitable for sql copy cmd" - (let ((output-path (umls-pathname output-basename extension))) + (let ((output-path (umls-pathname (fil out-ufile) extension))) (if (probe-file output-path) (format t "File ~A already exists: skipping~%" output-path) (with-open-file (ostream output-path :direction :output) - (dolist (input-file input-files) - (with-umls-file (line (fil input-file)) - (umls-translate input-file line ostream) + (dolist (input-ufile input-ufiles) + (with-umls-file (line (fil input-ufile)) + (umls-translate out-ufile line ostream) (princ #\newline ostream))))))) (defun pg-copy-cmd (file extension)