- Remove
max_distanceparameter fromnormalized_damerau_levenshtein_distanceandnormalized_damerau_levenshtein_distance_seqs. The parameter was a leaky abstraction: the return value when the threshold was exceeded was neither a consistent sentinel nor the true normalized distance, and varied with sequence length.
- Add
max_distanceparameter to all four functions. When provided, computation terminates early andmax_distance + 1(or a value greater thanmax_distancefor normalized functions) is returned if the true distance exceeds the threshold. Closes #16. - Note: normalized distance functions now return a 64-bit
float(Python's nativefloat) instead of a 32-bit C float. Return values are now more precise (e.g.,0.2instead of0.20000000298023224). Code that relies on exact float32 values may need to be updated. - Raise
TypeErrorwith a clear message whenNoneis passed as an input sequence; previously,Noneinputs were not explicitly handled. - Update type stubs (
__init__.pyi) with modern typing syntax andmax_distanceparameters. - Migrate CI from Travis CI to GitHub Actions.
- Modernize
pyproject.tomlwith full PEP 621 metadata. - Add Python 3.14 support.
- Add Python wheel support (#8). (courtesy @jianlins)
- Drop Python 3.8 support.
- Add Cython to the build process to reduce the likelihood of incompatabilities between the Cython-generated C code and CPython (#38). (courtesy @tacaswell)
- Drop Python 3.7 support.
- Add Python 3.11-3.13 support.
- Drop Python 3.6 support (EOL).
- Add Python 3.10 support.
- Compiled with Cython 0.29.32.
- Updating project URL (moved from @gfairchild's personal namespace to @lanl's namespace).
- Remove NumPy dependency to simplify build process. Rather than relying on
np.ndarray, we'll now use native iterables likelistortuple.- This is a breaking change if you currently rely on either of the
*_ndarraymethods.damerau_levenshtein_distance_ndarrayrefactored todamerau_levenshtein_distance_seqs, and the return value is now alistrather thannp.arraynormalized_damerau_levenshtein_distance_ndarrayrefactored tonormalized_damerau_levenshtein_distance_seqs, and the return value is now alistrather thannp.array
- The simplest way to migrate to these new methods is to switch to using a native Python
list. For example:damerau_levenshtein_distance_ndarray('test', np.array(['test1', 't1', 'test']))is nowdamerau_levenshtein_distance_seqs('test', ['test1', 't1', 'test'])normalized_damerau_levenshtein_distance_ndarray('test', np.array(['test1', 't1', 'test']))is nownormalized_damerau_levenshtein_distance_seqs('test', ['test1', 't1', 'test'])- If you need the return value to be an
np.array, then you can simply wrap the return value (alist) withnp.arraylike so:np.array(damerau_levenshtein_distance_seqs('test', ['test1', 't1', 'test']))
- This is a breaking change if you currently rely on either of the
- Compiled with Cython 0.29.21.
- Remove Python 2 and 3.5 support (they are EOL).
- Bump minimum NumPy version to 1.19.5.
- Add Python 3.9 support in
setup.py. - Compiled with Cython 0.29.21.
- Fixed bug when first string is longer than the second string (#22). (courtesy @svenski)
- Compiled with Cython 0.29.21.
- Dropping Python 3.4 support from Travis.
- Allow
np.ndarraysas input. - Add support for Python 3.8 to
setup.py. - Compiled with Cython 0.29.17.
- Specifying minimum version numbers in
pyproject.tomlandsetup.py. - Compiled with Cython 0.29.5.
- Using the
pyproject.tomlstandard set forth in PEP 518, NumPy will now be correctly installed as a dependency prior to runningsetup.py.
- Fixing NumPy-related install error. (courtesy @simobasso)
- Enabling Python 3.7 unit tests in Travis.
- Compiled with Cython 0.29.2.
- Allow tuples and lists as input. (courtesy @internaut)
- Dropped support of EOL Python versions (2.6, 3.2, and 3.3). (courtesy @internaut)
- Fixed a possible division-by-zero exception. (courtesy @internaut)
- Fixed a formatting error in an exception message. (courtesy @internaut)
- Compiled with Cython 0.27.3.
- Clarified that this implementation is of the optimal string alignment distance algorithm (see this issue for more information).
- Renamed
damerau_levenshtein_distance_withNPArraytodamerau_levenshtein_distance_ndarrayandnormalized_damerau_levenshtein_distance_withNPArraytonormalized_damerau_levenshtein_distance_ndarray. - Cleaned up
np.ndarraytype and dimension checks. - Simplified NumPy functions using
np.vectorize. - Hardened unicode conversion using Cython's recommendations.
- Compiled with Cython 0.24.1.
- @mittagessen fixed a bug in
setup.pythat assumed NumPy was installed in this PR.
- @ovarene added the ability to compute the edit distance between a string and each string in a NumPy array in this PR.
- Compiled with Cython 0.22.
- Changed
xrangetorangein pyx code. - Compiled with Cython 0.20.1.
- Moving to setuptools (using ez_setup.py to manage it).
- Performance improvement for short-circuit.
- Changed
unsigned inttoPy_ssize_t(for 64-bit compatability). - Improved readability (defined offset indices for
storage).
- Fixed Python 3 unicode issue (thanks to Stefan Behnel - https://groups.google.com/d/msg/cython-users/ofT3fo48ohs/rrf3dtbHkm4J).
- Fixed a possible memory leak (thanks to Stefan Behnel).
- Examples are now Python 3-compatible.
- Initial release.