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
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eea464e279c38e684a1227b6e2743b4a2af08ed7e06dd1c24bc4821d5b5c8e55 |
|
MD5 | 04e86f0bda83a3936a5be1fb2641cedd |
|
BLAKE2b-256 | f0175a2492ae38f5d45d7e463a609a54640f3e6cd05a8141c8fb18c788d737ac |
Close
Hashes for levenshtein_package-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08565f696719185d404c25e25c3cfb02a3620f1c8db1a2f7f9c7cc62b9a85a3c |
|
MD5 | c47d5371d1f971b6a312663f98d967c9 |
|
BLAKE2b-256 | 495dfc4f8a4686b68dc1496a3b4ed7de6d60ae6d1a5906a7f45bd2681875d995 |