# The mk-string-metrics Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

# The mk-string-metrics Reference Manual

This is the mk-string-metrics Reference Manual, version 0.1.2, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:17:32 2018 GMT+0.

Next: , Previous: , Up: Top   [Contents][Index]

# mk-string-metrics

This library implements efficient algorithms that calculate various string metrics in Common Lisp:

## Installation

Copy files of this library in any place where ASDF can find them. Then you can use it in system definitions and ASDF will take care of the rest.

Via Quicklisp (recommended):

``````(ql:quickload "mk-string-metrics")
``````

## Documentation

``````damerau-levenshtein x y
``````

Calculate Damerau-Levenshtein distance between two given strings `x` and `y`.

``````hamming x y
``````

Calculate Hamming distance between two given strings `x` and `y`, they have to be of the same length.

``````jaccard x y
``````

Calculate Jaccard similarity coefficient for two strings `x` and `y`. Returned value is in range from `0` (no similarity) to `1` (exact match).

``````jaro x y
``````

Calculate Jaro distance between two strings `x` and `y`. Returned value is in range from `0` (no similarity) to `1` (exact match).

``````jaro-winkler x y
``````

Calculate Jaro-Winkler distance between two strings `x` and `y`. Returned value is in range from `0` (no similarity) to `1` (exact match).

``````levenshtein x y
``````

Calculate Levenshtein distance between two given strings `x` and `y`.

``````norm-damerau-levenshtein x y
``````

Return 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.

``````norm-levenshtein x y
``````

Return 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.

``````overlap x y
``````

This function calculates overlap coefficient between two given strings `x` and `y`. Returned value is in range from `0` (no similarity) to `1` (exact match).

Next: , Previous: , Up: Top   [Contents][Index]

## 2 Systems

The main system appears first, followed by any subsystem dependency.

Previous: , Up: Systems   [Contents][Index]

### 2.1 mk-string-metrics

Author

Mark Karpov

MIT

Description

efficient implementations of various string metric algorithms

Version

0.1.2

Source

mk-string-metrics.asd (file)

Component

mk-string-metrics.lisp (file)

Next: , Previous: , Up: Top   [Contents][Index]

## 3 Files

Files are sorted by type and then listed depth-first from the systems components trees.

Previous: , Up: Files   [Contents][Index]

### 3.1 Lisp

Next: , Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.1 mk-string-metrics.asd

Location

mk-string-metrics.asd

Systems

mk-string-metrics (system)

Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.2 mk-string-metrics/mk-string-metrics.lisp

Parent

mk-string-metrics (system)

Location

mk-string-metrics.lisp

Packages
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

## 4 Packages

Packages are listed by definition order.

Previous: , Up: Packages   [Contents][Index]

### 4.1 mk-string-metrics

Source

mk-string-metrics.lisp (file)

Nickname

mksm

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

## 5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.

Next: , Previous: , Up: Definitions   [Contents][Index]

### 5.1 Exported definitions

Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.1 Functions

Function: damerau-levenshtein X Y

Calculate Damerau-Levenshtein distance between two given strings X and Y.

Package
Source

mk-string-metrics.lisp (file)

Function: hamming X Y

Calculate Hamming distance between two given strings X and Y, they have to be of the same length.

Package
Source

mk-string-metrics.lisp (file)

Function: jaccard X Y

Calculate Jaccard similarity coefficient for two strings X and
Y. Returned value is in range from 0 (no similarity) to 1 (exact match).

Package
Source

mk-string-metrics.lisp (file)

Function: jaro X Y

Calculate Jaro distance between two strings X and Y. Returned value is in range from 0 (no similarity) to 1 (exact match).

Package
Source

mk-string-metrics.lisp (file)

Function: jaro-winkler X Y

Calculate Jaro-Winkler distance between two strings X and Y. Returned value is in range from 0 (no similarity) to 1 (exact match).

Package
Source

mk-string-metrics.lisp (file)

Function: levenshtein X Y

Calculate Levenshtein distance between two given strings X and Y.

Package
Source

mk-string-metrics.lisp (file)

Function: norm-damerau-levenshtein X Y

Return 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.

Package
Source

mk-string-metrics.lisp (file)

Function: norm-levenshtein X Y

Return 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.

Package
Source

mk-string-metrics.lisp (file)

Function: overlap X Y

This function calculates overlap coefficient between two given strings X and Y. Returned value is in range from 0 (no similarity) to 1 (exact match).

Package
Source

mk-string-metrics.lisp (file)

Previous: , Up: Definitions   [Contents][Index]

### 5.2 Internal definitions

Next: , Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.1 Functions

Function: fast-find CHAR STR STR-LEN &optional START

Check if CHAR is in STR. This function is supposed to be inlined.

Package
Source

mk-string-metrics.lisp (file)

Function: intersection-length X Y

Returns length of intersection of two strings X and Y. This function is supposed to be inlined.

Package
Source

mk-string-metrics.lisp (file)

Function: prefix-length X Y

Calculate length of common prefix for strings X and Y.

Package
Source

mk-string-metrics.lisp (file)

Function: string-to-set STR

Convert string STR into a set. This function is supposed to be inlined.

Package
Source

mk-string-metrics.lisp (file)

Function: union-length X Y

Returns length of union of two strings X and Y. This function is supposed to be inlined.

Package
Source

mk-string-metrics.lisp (file)

Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.2 Types

Type: array-index &optional LENGTH
Package
Source

mk-string-metrics.lisp (file)

Previous: , Up: Top   [Contents][Index]

## Appendix A Indexes

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.1 Concepts

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.2 Functions

Jump to: D   F   H   I   J   L   N   O   P   S   U
Jump to: D   F   H   I   J   L   N   O   P   S   U

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.3 Variables

Previous: , Up: Indexes   [Contents][Index]