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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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