anchor.diff:                        (cons (car x)
                               (/ (cdr x) sum)))
                     v)))
  -    (sort v #'< :key #'car)))
  +    (let ((r (sort v #'< :key #'car)))
  +      (if (eq kind :compacted-binary)
  +          (compact-binary-feature-vector r)
  +          r))))
  
positive.code: 
  ;;;; Encoding
  
  (defun encode/bag-of-words (document mapper feature->index &key (kind :binary))
    "Return a sparse vector that represents the encoded DOCUMENT. Get
  the features of DOCUMENT from MAPPER, convert each feature to an index
  
negative.code: within the vector and are in increasing order. Depending on KIND value
  is calculated differently: for :FREQUENCY it is the number of times
  the corresponding feature was found in DOCUMENT, for :BINARY it is
  always 1. :NORMALIZED-FREQUENCY and :NORMALIZED-BINARY are like the
  unnormalized counterparts except that as the final step values in the
  assembled sparse vector are normalized to sum to 1."
    (assert (member kind '(:binary :frequency
                           :normalized-binary :normalized-frequency
                           :compacted-binary)))
    (let ((v (make-array 20 :adjustable t :fill-pointer 0)))
      (funcall mapper
               (lambda (feature)
  