Implementation of bounded Levenshtein distance (Ukkonen)
Project Links
Meta
Author: Anthony Sottile
Requires Python: >=3.10
Classifiers
Programming Language
- Python :: 3
- Python :: 3 :: Only
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
ukkonen
Implementation of bounded Levenshtein distance (Ukkonen)
port
this is a port of ukkonen from javascript to c++ / python via cffi.
installation
pip install ukkonen
- wheels should be available on pypi in most cases
api
distance(s1: str, s2: str, k: int) -> int
compute the edit distance, bounded by k
>>> import ukkonen
>>> ukkonen.distance('hello', 'world', 5)
4
>>> ukkonen.distance('hello', 'world', 2)
2
Wheel compatibility matrix
| Platform | CPython >=3.10 (abi3) |
|---|---|
| macosx_11_0_arm64 | |
| macosx_13_0_x86_64 | |
| manylinux1_x86_64 | |
| manylinux2014_x86_64 | |
| manylinux_2_17_x86_64 | |
| manylinux_2_5_x86_64 | |
| win32 | |
| win_amd64 |
Files in release
ukkonen-1.1.0-cp310-abi3-macosx_11_0_arm64.whl (7.6KiB)
ukkonen-1.1.0-cp310-abi3-macosx_13_0_x86_64.whl (7.2KiB)
ukkonen-1.1.0-cp310-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (29.1KiB)
ukkonen-1.1.0-cp310-abi3-win32.whl (11.0KiB)
ukkonen-1.1.0-cp310-abi3-win_amd64.whl (11.3KiB)
ukkonen-1.1.0.tar.gz (4.0KiB)
Extras:
None
Dependencies:
cffi
(>=1)