pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance.
Maintained. Last release 5 weeks ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install pyxdameraulevenshteinpyxDamerauLevenshtein
LICENSE
This software is licensed under the BSD 3-Clause License. Please refer to the separate LICENSE file for the exact text of the license. You are obligated to give attribution if you use this code.
ABOUT
pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance. Courtesy Wikipedia:
In information theory and computer science, the Damerau-Levenshtein distance (named after Frederick J. Damerau and Vladimir I. Levenshtein) is a "distance" (string metric) between two strings, i.e., finite sequence of symbols, given by counting the minimum number of operations needed to transform one string into the other, where an operation is defined as an insertion, deletion, or substitution of a single character, or a transposition of two adjacent characters.
This implementation is based on Michael Homer's pure Python implementation, which implements the optimal string alignment distance algorithm. It runs in O(N*M) time using O(M) space. It supports unicode characters.
REQUIREMENTS
This code requires Python 3.11+. Prebuilt wheels are published to PyPI for Linux (x86_64 and aarch64), macOS (x86_64 and arm64), and Windows (x86_64), so most users don't need anything else. Building from source requires a C compiler such as GCC; Cython is installed automatically as a build dependency.
INSTALL
pyxDamerauLevenshtein is available on PyPI at https://pypi.org/project/pyxDamerauLevenshtein/.
Install using pip:
pip install pyxDamerauLevenshtein
USING THIS CODE
The following methods are available: