X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=composite.lisp;h=b49eec4867e2bd1443d57622f9fb66773af6050f;hb=5a80d916816131a1d56a60790cd1e4b5e9c88810;hp=611dfd18668101f5e869b7636d5f081e74c464d0;hpb=f513e7b50135115f3c56b840c2cb0d1c9c8ffa82;p=umlisp.git diff --git a/composite.lisp b/composite.lisp index 611dfd1..b49eec4 100644 --- a/composite.lisp +++ b/composite.lisp @@ -1,6 +1,23 @@ -;;;; $Id: composite.lisp,v 1.2 2002/10/09 00:34:47 kevin Exp $ +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: umlisp -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: composite.lisp +;;;; Purpose: Composite Classes for UMLisp +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Apr 2000 +;;;; +;;;; $Id: composite.lisp,v 1.4 2002/10/14 09:25:20 kevin Exp $ +;;;; +;;;; This file, part of UMLisp, is +;;;; Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D. +;;;; +;;;; UMLisp users are granted the rights to distribute and use this software +;;;; as governed by the terms of the GNU General Public License. +;;;; ************************************************************************* (in-package :umlisp) +(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))) ;;; Semantic type constants @@ -51,7 +68,7 @@ (defclass ucon_freq (umlsclass) ((ucon :type ucon :initarg :ucon :reader ucon) (freq :type fixnum :initarg :freq :accessor freq)) - (:metaclass ml-class) + (:metaclass kmrcl:ml-class) (:default-initargs :cui nil :pfstr nil :freq nil) (:title "Concept and Count") (:fields (cui :string fmt-cui) (freq :fixnum) (pfstr :cdata)) @@ -67,7 +84,7 @@ (defclass ustr_freq (umlsclass) ((ustr :type ustr :initarg :ustr :reader ustr) (freq :type fixnum :initarg :freq :accessor freq)) - (:metaclass ml-class) + (:metaclass kmrcl:ml-class) (:default-initargs :cui nil :pfstr nil :freq nil) (:title "String and Count") (:fields (sui :string fmt-sui) (freq :fixnum) (stt :string) (lrl :fixnum) (str :cdata)) @@ -89,13 +106,23 @@ (defclass usty_freq (umlsclass) ((usty :type usty :initarg :usty :reader usty) (freq :type fixnum :initarg :freq :accessor freq)) - (:metaclass ml-class) + (:metaclass kmrcl:ml-class) (:default-initargs :usty nil :freq nil) (:title "Semantic Type and Count") (:ref-fields (tui find-ucon-tui "subobjects=no")) (:fields (tui :string fmt-tui) (freq :fixnum) (sty :string)) (:documentation "Composite object of usty/freq")) +(defun find-usty_freq-all () + (let ((usty_freqs '())) + (dolist (tuple (mutex-sql-query "select distinct TUI from MRSTY")) + (let* ((tui (car tuple)) + (freq (ensure-integer + (caar (mutex-sql-query + (format nil "select count(*) from MRSTY where TUI=~a" tui)))))) + (push (make-instance 'usty_freq :usty (find-usty-tui tui) :freq freq) usty_freqs))) + (sort usty_freqs #'> :key #'freq))) + (defun usty_freq-tui (s) (tui (usty s))) @@ -105,7 +132,7 @@ (defclass usrl_freq (umlsclass) ((usrl :type usrl :initarg :usrl :reader usrl) (freq :type fixnum :initarg :freq :accessor freq)) - (:metaclass ml-class) + (:metaclass kmrcl:ml-class) (:default-initargs :usrl nil :freq nil) (:title "Source and Count") (:ref-fields (sab find-ustr-sab)) @@ -175,3 +202,8 @@ (defun find-ucon2_freq-coc-tui-all (tui) (find-ucon2_freq-tui-all tui #'find-ucon2-coc-tui)) +(dolist (c '(ucon_freq ustr_freq usty_freq usrl_freq)) + (let ((cl #+cmu (pcl:find-class c) + #+sbcl (sb-pcl:find-class c))) + #+cmu (pcl:finalize-inheritance cl) + #+sbcl (sb-pcl:finalize-inheritance cl)))