diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7033cf8..c05faa7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index 99f057c..20da3f8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="strsimpy", - version="0.1.9", + version="0.2.1", description="A library implementing different string similarity and distance measures", long_description=long_description, long_description_content_type="text/markdown", @@ -22,6 +22,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ) diff --git a/strsimpy/__init__.py b/strsimpy/__init__.py index 1e10460..1b1792f 100644 --- a/strsimpy/__init__.py +++ b/strsimpy/__init__.py @@ -37,4 +37,4 @@ from .sift4 import SIFT4Options, SIFT4 __name__ = 'strsimpy' -__version__ = '0.1.9' +__version__ = '0.2.1' diff --git a/strsimpy/ngram.py b/strsimpy/ngram.py index c3860b7..27d4ae1 100644 --- a/strsimpy/ngram.py +++ b/strsimpy/ngram.py @@ -46,7 +46,7 @@ def distance(self, s0, s1): for i in range(min(sl, tl)): if s0[i] == s1[i]: cost += 1 - return 1.0 * cost / max(sl, tl) + return 1.0 - cost / max(sl, tl) sa = [''] * (sl + self.n - 1) diff --git a/strsimpy/sift4_test.py b/strsimpy/sift4_test.py index 039d8b5..1960e7b 100644 --- a/strsimpy/sift4_test.py +++ b/strsimpy/sift4_test.py @@ -14,7 +14,7 @@ def testSIFT4(self): ] for a, b, offset, res in results: - self.assertEquals(res, s.distance(a, b, maxoffset=offset)) + self.assertEqual(res, s.distance(a, b, maxoffset=offset)) if __name__ == "__main__":