anchor.diff:    (let ((table (make-hash-table :test #'equal))
           (clusters nil))
       (loop for (value count) in values
  -       do (let* ((trimmed-value (trim value))
  -                 (pattern (funcall simplifier trimmed-value))
  -                 (cluster (gethash pattern table (make-cluster :key pattern))))
  -            (add-sample cluster trimmed-value count)
  -            (setf (gethash pattern table) cluster)))
  +       do (funcall simplifier (trim value)
  +                   #'(lambda (value pattern)
  +                       (let ((cluster (gethash pattern table (make-cluster :key pattern))))
  +                         (add-sample cluster value count)
  +                         (setf (gethash pattern table) cluster)))))
       (maphash #'(lambda (pattern cluster)
                    (declare (ignore pattern))
                    (push cluster clusters))
  
positive.code:               :phone ,(make-type-settings :pattern-simplifier #'get-phone-or-flat-pattern
                                            :field-name "contact:phone")
                :flat ,(make-type-settings :pattern-simplifier #'get-phone-or-flat-pattern
                                           :field-name "addr:flats")))
  
  (defstruct cluster
    "A cluster of values with the same pattern, i.e.  all six-digits
  
negative.code:   (or (and (char>= char #\a) (char<= char #\z))
        (and (char>= char #\A) (char<= char #\Z))))
  
  (defun starts-with (text prefix)
    "Returns non-nil if text starts with prefix."
    (let ((pos (search prefix text)))
      (and pos (= 0 pos))))
  
  (defun get-postcode-pattern (postcode fn)
    "Simplifies postcode in the following way:
     * all latin letters are replaced by 'A'
     * all digits are replaced by 'N'
  