Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

levenshtein-package-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

levenshtein_package-0.0.2-py2.py3-none-any.whl (4.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file levenshtein-package-0.0.2.tar.gz.

File metadata

  • Download URL: levenshtein-package-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for levenshtein-package-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8abf21f45f56abd8543dd1a521185f57768fb9fb4be1105d0cbf19087a066438
MD5 e1e11bb43f1cb2b2827a031c5e30d5d8
BLAKE2b-256 54926c675bd153daa12ed6371d0cd98b4468932c524457a5d74908c8ecf2deb9

See more details on using hashes here.

File details

Details for the file levenshtein_package-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: levenshtein_package-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for levenshtein_package-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a099fd731cb0bce9b8780ed988f034120ea5d33757e2d9046ca2d114c4d1e232
MD5 9dd6e839f573ca5d2c1a34f3d0265803
BLAKE2b-256 e6efcbc5b90f0500e3df07cf189904a0610d4809cc4f31650b05c402c5f4f0d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page