Skip to main content

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


Download files

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

Source Distribution

levenshtein-distance-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

levenshtein_distance-1.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for levenshtein-distance-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8b2c9ea8f7ae04524a584dc806672871c0e1354e623155a7cb11b2a5852e17cc
MD5 a6bcef103c22ca8006993de561ca4dac
BLAKE2b-256 f4a7b7cdd9c8861c021a9491fca5516caed8a9cb57c269ca0f8983c22015adb7

See more details on using hashes here.

File details

Details for the file levenshtein_distance-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for levenshtein_distance-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b84ff10a4ff919f170dfee0b90653ac5fd727b7542f98ba1fb9bdbee84f6b9e
MD5 24604005f3988d81a243dba1d8e56775
BLAKE2b-256 d1fbb45eb1ad667ece3c5844d52ab7eccfeb824a35fe587645d63894460fbac5

See more details on using hashes here.

Supported by

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