r11099: add error checking
[umlisp.git] / parse-rrf.lisp
index 4f54fb2de63755dcb8571479610d84e8435d9e8a..0842d97135ebc174d7bf9b67be8a384a26816745 100644 (file)
   (defun make-preparse-hash-table ()
     (if sui-lrl-hash
        (progn
-         (clrhash pfstr-hash)
-         (clrhash cui-lrl-hash)
-         (clrhash lui-lrl-hash)
-         (clrhash sui-lrl-hash)
-         (clrhash cuisui-lrl-hash)
-         (clrhash sab-srl-hash))
+          (clrhash pfstr-hash)
+          (clrhash cui-lrl-hash)
+          (clrhash lui-lrl-hash)
+          (clrhash sui-lrl-hash)
+          (clrhash cuisui-lrl-hash)
+          (clrhash sab-srl-hash))
       (setf
          pfstr-hash (make-hash-table :size 800000)
          cui-lrl-hash (make-hash-table :size 800000)
@@ -49,8 +49,7 @@
     
   (defun ensure-preparse (&optional (force-read nil))
     (when (or force-read (not *preparse-hash-init?*))
-      (make-preparse-hash-table)
-      (setq *preparse-hash-init?* t))
+      (make-preparse-hash-table))
     (with-umls-file (line "MRCONSO.RRF")
       (let ((cui (parse-ui (nth 0 line)))
            (lui (parse-ui (nth 3 line)))
@@ -69,7 +68,8 @@
         (multiple-value-bind (val found) (gethash sab sab-srl-hash)
           (declare (ignore val))
           (unless found
-            (setf (gethash sab sab-srl-hash) srl))))))
+            (setf (gethash sab sab-srl-hash) srl)))))
+    (setq *preparse-hash-init?* t))
   
   (defun pfstr-hash (cui) (gethash cui pfstr-hash))
   (defun cui-lrl (cui)    (gethash cui cui-lrl-hash))