r11473: improve verbose status msgs
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 8 Jan 2007 06:39:54 +0000 (06:39 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 8 Jan 2007 06:39:54 +0000 (06:39 +0000)
classes.lisp
create-sql.lisp
parse-rrf.lisp
sql-classes.lisp

index d965e92baa8febf1120eca4306e2982e405e2d3c..d054bdd382cb09953b0ca0eb09b5db205867817c 100644 (file)
    (stt :value-type string :initarg :stt :reader stt)
    (suppress :value-type string :initarg :suppress :reader suppress)
    (s#so :reader s#so :subobject (find-uso-cuisui cui sui))
-   (s#sat :reader s#sat :subobject (find-usat-ui cui lui sui)))
+   (s#sat :reader s#sat :subobject (find-usat-ui cui :lui lui :sui sui)))
   (:metaclass hyperobject-class)
   (:user-name "String")
   (:default-print-slots sui stt lrl str suppress))
    (ts :value-type string  :initarg :ts :reader ts)
    (lrl :value-type fixnum :initarg :lrl :reader lrl)
    (s#str :reader s#str :subobject (find-ustr-cuilui cui lui))
-   (s#sat :reader s#sat :subobject (find-usat-ui cui lui)))
+   (s#sat :reader s#sat :subobject (find-usat-ui cui :lui lui)))
   (:metaclass hyperobject-class)
   (:user-name "Term")
   (:default-print-slots lui lat ts lrl))
index 9311a820bc3980804a7e94ca9faf11677c23f1e0..805cbcd8c234a98253192868830370b77015d0ae 100644 (file)
@@ -279,7 +279,7 @@ This is much faster that using create-umls-db-insert."
   "Translate all *umls-files* to optimized import format."
   (make-noneng-index-file extension)
   (dolist (f (remove "MRXW_NONENG.RRF" *umls-files* :test #'string= :key #'fil))
-    (when verbose (format t "UMLS Import: translating file ~S.~%" f))
+    (when verbose (format t "UMLS Import: translating file ~S.~%" (fil f)))
     (translate-umls-file f extension)))
 
 (defun translate-umls-file (file extension)
index 90ddc78c5c887f479108c6c5ee0a49de45f23b24..84a4b4b168d114b1eaae3b70ec8549d2c8ac00e6 100644 (file)
           (clrhash cuisui-lrl-hash)
           (clrhash sab-srl-hash))
       (setf
-         pfstr-hash (make-hash-table :size 1300000)
-         cui-lrl-hash (make-hash-table :size 1300000)
-         lui-lrl-hash (make-hash-table :size 4600000)
-         sui-lrl-hash (make-hash-table :size 5100000)
-         cuisui-lrl-hash (make-hash-table :size 2000000)
-         sab-srl-hash (make-hash-table :size 100 :test 'equal))))
+         pfstr-hash (make-hash-table :size 1500000)
+         cui-lrl-hash (make-hash-table :size 1500000)
+         lui-lrl-hash (make-hash-table :size 5000000)
+         sui-lrl-hash (make-hash-table :size 6000000)
+         cuisui-lrl-hash (make-hash-table :size 6000000)
+         sab-srl-hash (make-hash-table :size 200 :test 'equal))))
 
   (defun ensure-preparse (&optional (force-read nil))
     (when (and *preparse-hash-init?* (not force-read))
 
 
 (defun gen-ufiles-generic (files-filename dir)
-"Initialize all LEX file structures"
+"Initialize generic UMLS file structures"
   (let ((files '()))
     (with-umls-file (line files-filename)
       (destructuring-bind (fil des fmt cls rws bts) line
index 5983f7c9cecfc80fccc308be45ac1acc64284a7c..8d8be13f98c0750ee05255367156a13d676d4065 100644 (file)
@@ -25,7 +25,7 @@
 (defun current-srl! (srl)
   (setq *current-srl* srl))
 
-(defmacro query-string (table fields &optional srl where-name where-value
+(defmacro query-string (table fields srl where-name where-value
                        &key (lrl "KCUILRL") single distinct order like limit
                         filter)
   (let* ((%%fields (format nil "SELECT ~A~{~:@(~A~)~^,~} FROM ~:@(~A~)"
@@ -73,7 +73,7 @@
          (t
           ""))))))
 
-(defun query-string-eval (table fields &optional srl where-name where-value
+(defun query-string-eval (table fields srl where-name where-value
                          &key (lrl "KCUILRL") single distinct order like limit filter)
   (when single (setq limit 1))
   (concatenate
@@ -228,7 +228,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (ensure-cui-integer cui)
   (when cui
     (make-instance 'ucon :cui cui)))
-  
+
 (defun find-ucon-cui (cui &key (srl *current-srl*) without-pfstr)
   "Find ucon for a cui. If set SAB, the without-pfstr is on by default"
   (ensure-cui-integer cui)
@@ -252,11 +252,11 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (unless cui (return-from find-uconso-cui nil))
 
   (collect-umlisp-query (mrconso (lat ts lui stt sui ispref aui saui scui sdui sab tty code str
-                                      srl suppress cvf kpfeng kcuisui kcuilui kcuilrl 
+                                      srl suppress cvf kpfeng kcuisui kcuilui kcuilrl
                                       kluilrl ksuilrl) srl cui cui)
-    (make-instance 'uconso :cui cui :lat lat :ts ts :lui lui :stt stt :sui sui :ispref ispref 
+    (make-instance 'uconso :cui cui :lat lat :ts ts :lui lui :stt stt :sui sui :ispref ispref
                    :aui aui :saui saui :scui scui :sdui sdui :sab sab :tty tty :code code
-                   :str str :srl srl :suppress suppress :cvf cvf :kpfeng kpfeng 
+                   :str str :srl srl :suppress suppress :cvf cvf :kpfeng kpfeng
                    :kcuisui kcuisui :kcuilui kcuilui :kcuilrl kcuilrl :kluilrl kluilrl
                    :ksuilrl ksuilrl)))
 
@@ -407,7 +407,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (ensure-cui-integer cui)
   (collect-umlisp-query (mrrel (aui1 rel stype1 cui2 aui2 stype2 rela rui srui sab sl rg dir suppress cvf)
                               srl cui1 cui :lrl "KSRL" :filter filter)
-    (let ((rel                        
+    (let ((rel
       (make-instance 'urel :cui1 cui :aui1 (ensure-integer aui1) :stype1 stype1 :rel rel
                      :cui2 (ensure-integer cui2) :aui2 (ensure-integer aui2) :stype2 stype2
                      :rui (ensure-integer rui) :srui srui :rela rela :sab sab :sl sl :rg rg :dir dir
@@ -615,7 +615,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                   :paui (ensure-integer paui)
                   :sab sab :rela rela :ptr ptr :hcd hcd :cvf cvf)))
 
-(defun find-usat-ui (cui &optional (lui nil) (sui nil) &key (srl *current-srl*))
+(defun find-usat-ui (cui &key lui sui (srl *current-srl*))
   (ensure-cui-integer cui)
   (ensure-lui-integer lui)
   (ensure-sui-integer sui)
@@ -734,7 +734,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                        (if like "LIKE" "=")
                        (clsql-sys::sql-escape-quotes word)
                        (etypecase sab
-                         (string 
+                         (string
                           (format nil " c.sab='~A'" (clsql-sys::sql-escape-quotes sab)))
                          (cons
                           (format nil " c.sab IN (~{'~A'~^,~})"
@@ -752,7 +752,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                        (clsql-sys::sql-escape-quotes word)
                        (typecase sab
                          (string
-                          (format nil " c.sab='" (clsql-sys::sql-escape-quotes sab)))
+                          (format nil " c.sab='~A'" (clsql-sys::sql-escape-quotes sab)))
                          (cons
                           (format nil " c.sab IN (~('~A'~^,~))"
                                   (mapcar 'clsql-sys::sql-escape-quotes sab)))
@@ -763,7 +763,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
           collect (destructuring-bind (sui cui lui str lrl stt suppress cuisui) tuple
                     (make-instance 'ustr :sui sui :cui cui :lui lui :str str :lrl lrl
                                    :stt stt :suppress suppress :cuisui cuisui)))))
-           
+
 
 (defun find-ucon-normalized-word (word &key (srl *current-srl*) (like nil))
   "Return list of ucons that match word, optionally use SQL's LIKE syntax"