anchor.diff:      (values readings (mapcar #'ichiran:romanize-word readings))))
   
   (defstruct segment
  -  start end word (score nil) (top nil)) ;; (accum 0) (path nil)
  +  start end word (score nil) (info nil) (top nil)) ;; (accum 0) (path nil)
   
   (defun calc-score (reading &optional final)
     (let* ((score 1)
  
positive.code:   (:method ((obj top-array))
      (with-slots (array count) obj
        (if (>= count (length array)) array (subseq array 0 count)))))
  
  
  (defun find-best-path (segments &key (limit 5))
    ;;assume segments are sorted by (start, end) (as is the result of find-substring-words)
  
negative.code:                                    (= end (length str))))
                        (find-word (subseq str start end))))))
  
  (defparameter *identical-word-score-cutoff* 1/2)
  
  (defun cull-segments (segments)
    (when segments
      (let* ((segments (stable-sort segments #'> :key #'segment-score))
             (max-score (segment-score (car segments)))
             (cutoff (* max-score *identical-word-score-cutoff*)))
        (loop for seg in segments
             while (>= (segment-score seg) cutoff)
             collect seg))))
  
  (defstruct segment-list segments start end (top nil))
  
  (defgeneric get-segment-score (seg)
    (:documentation "Like segment-score but also works for segment-list and synergies")
    (:method ((seg segment))
      (segment-score seg))
    (:method ((seg-list segment-list))
      (let ((seg (car (segment-list-segments seg-list))))
        (if seg (segment-score seg) 0)))
    (:method ((syn synergy))
      (synergy-score syn)))
  
  (defun join-substring-words (str)
    (loop with sticky = (find-sticky-positions str)
         for start from 0 below (length str)
         unless (member start sticky)
         nconcing 
         (loop for end from (1+ start) upto (length str)
              unless (member end sticky)
              nconcing 
              (let ((segments (mapcar 
                               (lambda (word)
                                 (gen-score (make-segment :start start :end end :word word)
                                            (= end (length str))))
                               (find-word (subseq str start end)))))
                (when segments
                  (list (make-segment-list :segments (cull-segments segments)
                                           :start start :end end)))))))
  
  
  (defstruct (top-array-item (:conc-name tai-)) score payload)
  
  