Compute operational differences between two sequences/texts using the Levenshtein algorithm
Project description
levenshtein-distance
Compute operational differences between two sequences/texts using the Levenshtein algorithm
Installation:
pip install levenshtein-distance
Usage:
Regular Usage:
from levenshtein_distance import Levenshtein
lev_object = Levenshtein('test', 'text')
distance = lev_object.distance()
ratio = lev_object.ratio()
array = lev_object.sequence_array()
With replace operation cost of 2:
lev_object = Levenshtein('test', 'text').set_replace_cost(2)
distance = lev_object.distance()
ratio = lev_object.ratio()
array = lev_object.sequence_array()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file levenshtein-distance-1.0.1.tar.gz.
File metadata
- Download URL: levenshtein-distance-1.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b2c9ea8f7ae04524a584dc806672871c0e1354e623155a7cb11b2a5852e17cc
|
|
| MD5 |
a6bcef103c22ca8006993de561ca4dac
|
|
| BLAKE2b-256 |
f4a7b7cdd9c8861c021a9491fca5516caed8a9cb57c269ca0f8983c22015adb7
|
File details
Details for the file levenshtein_distance-1.0.1-py3-none-any.whl.
File metadata
- Download URL: levenshtein_distance-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b84ff10a4ff919f170dfee0b90653ac5fd727b7542f98ba1fb9bdbee84f6b9e
|
|
| MD5 |
24604005f3988d81a243dba1d8e56775
|
|
| BLAKE2b-256 |
d1fbb45eb1ad667ece3c5844d52ab7eccfeb824a35fe587645d63894460fbac5
|