anchor.diff:                 (char= (char x i)
                         (char y i)))
             (incf result)
  -          (return-from prefix-length result)))))
  -  
  +          (return-from prefix-length result)))
  +    result))
  +
   (defun jaro-winkler (x y)
     "Calculates Jaro-Winkler distance between two strings. Returned value is
   in range from 0 (no similarity) to 1 (exact match)."
  
positive.code:     (declare (type array-index i))
      (when (char= char (char str i))
        (return-from fast-find i))))
  
  (defun intersection-length (x y x-len y-len)
    "Returns length of intersection of two strings. This function is supposed
  to be inlined."
    (declare (type (simple-array character) x y)
             (type array-index x-len y-len)
             (inline fast-find)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((result 0))
      (declare (type array-index result))
      (dotimes (i x-len)
        (when (fast-find (char x i) y y-len)
          (incf result)))
      result))
  
  (defun overlap (x y)
    "This function calculates overlap coefficient between two given
  strings. Returned value is in range from 0 (no similarity) to 1 (exact match)."
    (declare (type (simple-array character) x y)
             (inline length intersection-length)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((x-len (length x))
          (y-len (length y)))
      (/ (the array-index (intersection-length x y x-len y-len))
         (max x-len y-len))))
  
  (defun jaccard (x y)
    "Calculates Jaccard distance between two strings. Returned value is in
  range from 0 (no similarity) to 1 (exact match)."
    (declare (type (simple-array character) x y)
             (inline length intersection-length)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((x-len (length x))
          (y-len (length y)))
      (if (and (zerop x-len)
               (zerop y-len))
          1
          (/ (the array-index (intersection-length x y x-len y-len))
             (the array-index (+ x-len y-len))))))
  
  (defun jaro (x y)
    "Calculates Jaro distance between two strings. Returned value is in range
  
negative.code:   "Returns normalized Levenshtein distance between X and Y. Result is a real
  number from 0 to 1, where 0 signifies no similarity between the strings,
  while 1 means exact match."
    (let ((r (levenshtein x y)))
      (if (zerop r)
          1
          (- 1 (/ r
                  (max (length x)
                       (length y)))))))
  
  (defun norm-damerau-levenshtein (x y)
    "Returns normalized Damerau-Levenshtein distance between X and Y. Result
  is a real number from 0 to 1, where 0 signifies no similarity between the
  strings, while 1 means exact match."
    (let ((r (damerau-levenshtein x y)))
      (if (zerop r)
          1
          (- 1 (/ r
                  (max (length x)
                       (length y)))))))
  
  (defun string-to-set (str)
    "Converts string into a set. This function is supposed to be inlined."
    (declare (type (simple-array character) str)
             (inline length)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((result (make-hash-table)))
      (dotimes (i (length str))
        (setf (gethash (char str i) result) t))
      result))
  
  (defun intersection-length (x y)
    "Returns length of intersection of two strings. This function is supposed
  to be inlined."
    (let ((result 0))
      (declare (type array-index result)
               (optimize (safety 0) (speed 3) (space 3)))
    (maphash (lambda (k v)
               (declare (ignore v))
               (when (gethash k y)
                 (incf result)))
             x)
    result))
  
  (defun union-length (x y)
    "Returns length of union of two strings. This function is supposed to be
  inlined."
    (let ((temp (make-hash-table)))
      (flet ((extract (h)
               (maphash (lambda (k v)
                          (declare (ignore v))
                          (setf (gethash k temp) t))
                        h)))
        (extract x)
        (extract y)
        (hash-table-count temp))))
  
  (defun overlap (x y)
    "This function calculates overlap coefficient between two given
  strings. Returned value is in range from 0 (no similarity) to 1 (exact match)."
    (declare (type (simple-array character) x y)
             (inline string-to-set intersection-length)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((x (string-to-set x))
          (y (string-to-set y)))
      (/ (the array-index (intersection-length x y))
         (min (hash-table-count x)
              (hash-table-count y)))))
  
  (defun jaccard (x y)
    "Calculates Jaccard similarity coefficient for two strings. Returned value
  is in range from 0 (no similarity) to 1 (exact match)."
    (declare (type (simple-array character) x y)
             (inline string-to-set intersection-length)
             (optimize (safety 0) (speed 3) (space 3)))
    (let ((x (string-to-set x))
          (y (string-to-set y)))
      (if (and (zerop (hash-table-count x))
               (zerop (hash-table-count y)))
          1
          (/ (the array-index (intersection-length x y))
             (the array-index (union-length x y))))))
  
  (defun fast-find (char str str-len &optional (start 0))
    "Checks if CHAR is in STR. This function is supposed to be inlined."
  