Package for calculating Levenshtein distance and similarity
Project description
The Levenshtein distance is a string metric for measuring the difference between two strings. With this package you can calculate the Levenshtein distance and ratio between two words, or get the most similar word in a list of words.
More info at https://en.wikipedia.org/wiki/Levenshtein_distance
Installation
pip install levenshtein-package
Available methods
calculate_distance
calculate_similarity
get_most_similar_in_list
Examples
>>> from levenshtein import calculate_distance, calculate_similarity, get_most_similar_in_list
>>> calculate_distance("apple", "pear")
4
>>> calculate_similarity("apple", "pear")
0.4444444444444444
>>> get_most_similar_in_list("apple", ["pear", "peach", "apricot", "banana"])
'pear'
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
Close
Hashes for levenshtein-package-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8abf21f45f56abd8543dd1a521185f57768fb9fb4be1105d0cbf19087a066438 |
|
MD5 | e1e11bb43f1cb2b2827a031c5e30d5d8 |
|
BLAKE2b-256 | 54926c675bd153daa12ed6371d0cd98b4468932c524457a5d74908c8ecf2deb9 |
Close
Hashes for levenshtein_package-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a099fd731cb0bce9b8780ed988f034120ea5d33757e2d9046ca2d114c4d1e232 |
|
MD5 | 9dd6e839f573ca5d2c1a34f3d0265803 |
|
BLAKE2b-256 | e6efcbc5b90f0500e3df07cf189904a0610d4809cc4f31650b05c402c5f4f0d4 |