editdistance-s 1.0.0


pip install editdistance-s

  Latest version

Released: Mar 20, 2021

Project Links

Meta
Author: Anthony Sottile
Requires Python: >=3.6.1

Classifiers

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.6
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: Implementation :: CPython
  • Python :: Implementation :: PyPy

Build Status Azure DevOps coverage pre-commit.ci status

editdistance-s

Fast implementation of the edit distance (Levenshtein distance).

fork

this is a fork of editdistance with the following changes:

  • __hash__ based support is removed as it makes incorrect assumptions
  • only strings (type str) are supported
  • cffi replaces cython (so abi3 wheels can be produced)
  • the module is renamed to editdistance_s
  • the public api does not contain eval (only distance)

installation

pip install editdistance-s
  • wheels should be available on pypi in most cases

api

distance(s1: str, s2: str) -> int

compute the edit distance

>>> import editdistance_s
>>> editdistance_s.distance('hello', 'hell☃')
1
Extras: None
Dependencies:
cffi (>=1)