r11485: more use of vff
[umlisp.git] / create-sql.lisp
index fc8fc8425353c8ab3b844f78c512aec736172299..9ed31c5cfcbcf7c3928d8b38999ad78817f846a5 100644 (file)
@@ -277,7 +277,7 @@ This is much faster that using create-umls-db-insert."
 
 (defun translate-all-files (&key (extension "-trans") verbose force)
   "Translate all *umls-files* to optimized import format."
-  (make-noneng-index-file extension)
+  (make-noneng-index-file extension :force force)
   (dolist (f (remove "MRXW_NONENG.RRF" *umls-files* :test #'string= :key #'fil))
     (when verbose (format t "UMLS Import: Translating file ~A.~%" (fil f)))
     (translate-umls-file f extension :force force)))
@@ -421,9 +421,9 @@ This is much faster that using create-umls-db-insert."
   (declare (optimize (speed 3) (space 0)))
   (ensure-ucols+ufiles)
   (let ((max 0))
-    (declare (fixnum max))
+    (declare (type (integer 0 1000000) max))
     (dolist (ucol *umls-cols*)
-      (when (> (cmax ucol) max)
+      (when (> (the (integer 0 1000000) (cmax ucol)) max)
        (setq max (cmax ucol))))
     max))
 
@@ -434,7 +434,11 @@ This is much faster that using create-umls-db-insert."
   (let ((rowsizes '()))
     (dolist (file *umls-files*)
       (let ((row 0))
+        (declare (type (integer 0 1000000) row))
        (dolist (ucol (ucols file))
-         (incf row (1+ (cmax ucol))))
+          (let* ((col-max (cmax ucol))
+                 (max-with-delim (1+ col-max)))
+            (declare (type (integer 0 1000000) col-max max-with-delim))
+            (incf row max-with-delim)))
        (push row rowsizes)))
     (car (sort rowsizes #'>))))