r11412: warn on empty files -- occurs when subsetting UMLS
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 30 Dec 2006 06:09:34 +0000 (06:09 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 30 Dec 2006 06:09:34 +0000 (06:09 +0000)
create-sql.lisp

index ab7d64a553fbaa8077fef3442f258ad3679a4974..d145ad9255f8c08c8c60d593800cb6c2ec5cc1ab 100644 (file)
@@ -295,13 +295,10 @@ This is much faster that using create-umls-db-insert."
             (incf translated-lines)))
         (dolist (input-ufile input-ufiles)
           (with-umls-ufile (line input-ufile)
-            (incf input-lines)
-            (when (> input-lines translated-lines)
-              (throw 'done-counting 'incomplete)))))
+                           (incf input-lines)
+                           (when (> input-lines translated-lines)
+                             (throw 'done-counting 'incomplete)))))
       (cond
-        ((eql input-lines 0)
-          (error "Input lines is 0")
-          nil)
         ((< input-lines translated-lines)
           (format t "Translated file ~A incomplete, deleting...~%" output-path)
           (delete-file output-path)
@@ -309,6 +306,9 @@ This is much faster that using create-umls-db-insert."
         ((eql input-lines translated-lines)
           (format t "Translated file ~A already exists: skipping...~%" output-path)
           t)
+        ((eql input-lines 0)
+          (warn "The number of input lines is 0 for output file ~A." output-path)
+          nil)
         ((> translated-lines input-lines)
           (error "Shouldn't happen. Translated lines of ~A is ~D, greater than input lines ~D"
                  output-path translated-lines input-lines)