diff --git a/CHANGELOG.md b/CHANGELOG.md index 934891e..6de2adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ ## Changelog -### [2.1.0] - Unreleased +### [2.0.1] - 2022-02-11 #### Fixed - fix type hints +- Indel.normalized_similarity mistakenly used the implementation of Indel.normalized_distance -### [2.0.0] - 2022-01-09 +### [2.0.0] - 2022-02-09 #### Added - added C-Api which can be used to extend RapidFuzz from different Python modules using any programming language which allows the usage of C-Apis (C/C++/Rust) diff --git a/docs/conf.py b/docs/conf.py index 7c306f4..478f56f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ copyright = '2021, Max Bachmann' author = 'Max Bachmann' # The full version, including alpha/beta/rc tags -release = '2.0.0' +release = '2.0.1' # -- General configuration --------------------------------------------------- diff --git a/extern/rapidfuzz-cpp b/extern/rapidfuzz-cpp index 5083fb7..b2240f7 160000 --- a/extern/rapidfuzz-cpp +++ b/extern/rapidfuzz-cpp @@ -1 +1 @@ -Subproject commit 5083fb7b495072871d3c22af16e2d5ddd84c9cb7 +Subproject commit b2240f75cb0308cdf928ead4e1f6422a7a3c4efa diff --git a/setup.py b/setup.py index 278859b..0f1d860 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('README.md', 'rt', encoding="utf8") as f: setup( name="rapidfuzz", - version="2.0.0", + version="2.0.1", extras_require={'full': ['numpy']}, url="https://github.com/maxbachmann/RapidFuzz", author="Max Bachmann", diff --git a/src/cython/distance/Indel.pyx b/src/cython/distance/Indel.pyx index cd7d4d7..52adef6 100644 --- a/src/cython/distance/Indel.pyx +++ b/src/cython/distance/Indel.pyx @@ -234,7 +234,7 @@ def normalized_similarity(s1, s2, *, processor=None, score_cutoff=None): raise ValueError("score_cutoff has to be >= 0") preprocess_strings(s1, s2, processor, &s1_proc, &s2_proc) - return indel_normalized_distance_func(s1_proc.string, s2_proc.string, c_score_cutoff) + return indel_normalized_similarity_func(s1_proc.string, s2_proc.string, c_score_cutoff) def editops(s1, s2, *, processor=None): """ diff --git a/src/rapidfuzz/__init__.py b/src/rapidfuzz/__init__.py index 4b80127..307c62d 100644 --- a/src/rapidfuzz/__init__.py +++ b/src/rapidfuzz/__init__.py @@ -3,7 +3,7 @@ rapid string matching library """ __author__ = "Max Bachmann" __license__ = "MIT" -__version__ = "2.0.0" +__version__ = "2.0.1" from rapidfuzz import ( process, diff --git a/tests/distance/test_Indel.py b/tests/distance/test_Indel.py new file mode 100644 index 0000000..11af578 --- /dev/null +++ b/tests/distance/test_Indel.py @@ -0,0 +1,25 @@ +import unittest + +from rapidfuzz.distance import Indel + +def test_similar_strings(): + """ + Test similar strings + """ + assert Indel.distance("test", "test") == 0 + assert Indel.similarity("test", "test") == 8 + assert Indel.normalized_distance("test", "test") == 0 + assert Indel.normalized_similarity("test", "test") == 1.0 + +def test_different_strings(): + """ + Test completly different strings + """ + assert Indel.distance("aaaa", "bbbb") == 8 + assert Indel.similarity("aaaa", "bbbb") == 0 + assert Indel.normalized_distance("aaaa", "bbbb") == 1.0 + assert Indel.normalized_similarity("aaaa", "bbbb") == 0.0 + +if __name__ == '__main__': + unittest.main() +