This project has been archived by its maintainers, and is no longer receiving any updates.
editdistancek
This library calculates the Levenshtein edit distance between two strings. The edit distance represents the minimum number of edits required to transform one string into the other.
Our method is inspired by the algorithms of Ukkonen and Landau, Myers, and Schmidt. These strategies offer efficient ways of calculating the edit distance.
The algorithm operates with a running time of O(d*min(n,m)) and O(d^2 + n) in expectation. Here, 'd' stands for the edit distance between the two strings, while 'n' and 'm' denote the lengths of these strings, respectively. This efficient running time ensures the algorithm remains performant even for larger strings.
Motivation
The primary objective of this library is to devise a quick solution for the bounded version of the edit distance problem. Specifically, it aims to handle scenarios where, given a threshold 'k', it returns the edit distance 'd' if 'd' is less than or equal to 'k'. Otherwise, it indicates that the distance exceeds 'k'. This approach addresses the typical shortcoming of the classic edit distance algorithm, which tends to be inefficient in these cases.
The 'bounded' aspect of this library makes it particularly useful in scenarios where there's a predefined threshold of acceptable dissimilarity. This might be beneficial in time-sensitive applications or when working with very large strings, where calculating the full Levenshtein distance would be computationally prohibitive.
P.S. The 'k' in editdistancek refers to the upper bound for the algorithm. In practical terms, this means that the algorithm only computes the Levenshtein edit distance up to this 'k' value.
Installation
pip install editdistancek-rs
License
MIT License
Metadata
Release files for editdistancek-rs 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| editdistancek_rs-1.0.0.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| editdistancek_rs-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 195.1 kB
Release files / editdistancek_rs-1.0.0.tar.gz
| Download URL | editdistancek_rs-1.0.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca63927e2331c2b4cdb510ef51821e8fe6d3b54ed12d51e3bfad69b040a943b1
|
|
BLAKE2b-256 checksum How to use checksums |
d237efb811b0085c67a471b50862bb6c059ec5cc1c95e5551d1fccf8eb00fc20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / editdistancek_rs-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | editdistancek_rs-1.0.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 177.7 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3e6c2c4229ce7e274861a12a45a1968736759afa2110ce5b1d86e2e810e108cc
|
|
BLAKE2b-256 checksum How to use checksums |
1df9ac65454748e7fef42defdc1389784c9360a5fae07a1e133d1fb47e43a166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|