anchor.diff:  
   (defclass entry ()
     ((seq :reader seq :col-type integer :initarg :seq)
  -   (content :reader content :col-type string :initarg :content))
  +   (content :reader content :col-type string :initarg :content)
  +   (n-kanji :accessor n-kanji :col-type integer :initform 0)
  +   (n-kana :accessor n-kana :col-type integer :initform 0) 
  +   )
     (:metaclass dao-class)
     (:keys seq))
  +
  +(defmethod print-object ((obj entry) stream)
  +  (print-unreadable-object (obj stream :type t :identity nil)
  +    (format stream "~a ~a:~a" (seq obj) (n-kanji obj) (n-kana obj))))
   
   (deftable entry
     (!dao-def))
  
positive.code: (defclass kanji-text ()
    ((id :reader id :col-type serial)
     (seq :reader seq :col-type integer :initarg :seq)
     (text :reader text :col-type string :initarg :text))
    (:metaclass dao-class)
    (:keys id))
  
  (deftable kanji-text
    (!dao-def)
    (!index 'seq)
    (!index 'text)
    (!foreign 'entry 'seq))
  
  (defclass reading-text ()
    ((id :reader id :col-type serial)
     (seq :reader seq :col-type integer :initarg :seq)
     (text :reader text :col-type string :initarg :text))
    (:metaclass dao-class)
    (:keys id))
  
  (deftable reading-text
    (!dao-def)
    (!index 'seq)
    (!index 'text)
    (!foreign 'entry 'seq))
  
  (defun init-tables ()
    (with-connection *connection*
      (let ((tables '(entry kanji-text reading-text)))
        (loop for table in (reverse tables)
           do (query (:drop-table :if-exists table)))
        (loop for table in tables
           do (create-table table)))))
  
  (defun insert-readings (node-list tag table seq)
    (dom:do-node-list (node node-list)
      (let* ((reading-node (dom:item (dom:get-elements-by-tag-name node tag) 0))
             (reading-text (node-text reading-node)))
        (make-dao table :seq seq :text reading-text))))
  
  (defun load-entry (content)
    (let* ((parsed (cxml:parse content (cxml-dom:make-dom-builder)))
           (entseq-node (dom:item (dom:get-elements-by-tag-name parsed "ent_seq") 0))
           (seq (parse-integer (node-text entseq-node))))
      (make-dao 'entry :seq seq :content content)
      (let ((kana-nodes (dom:get-elements-by-tag-name parsed "r_ele"))
            (kanji-nodes (dom:get-elements-by-tag-name parsed "k_ele")))
        (insert-readings kana-nodes "reb" 'reading-text seq)
        (insert-readings kanji-nodes "keb" 'kanji-text seq))))
      
  (defun load-jmdict (&optional (path *jmdict-path*))
    (with-connection *connection*
      (klacks:with-open-source (source (cxml:make-source path))
        (loop for cnt from 1
           while (klacks:find-element source "entry")
           do
             (let ((content (klacks:serialize-element source (cxml:make-string-sink))))
  
negative.code: (in-package #:ichiran/dict)
  
  (defparameter *jmdict-path* #p"foobar")
  
  (defparameter *jmdict-data* #p"foobar")
  
  (defparameter *connection* '("jmdict" "postgres" "" "localhost"))
  
  