14
0
forked from pool/python-pylev

Accepting request 1008634 from home:yarunachalam:branches:devel:languages:python

- Update to v1.4.0 
  Bumped to 1.4.0!

OBS-URL: https://build.opensuse.org/request/show/1008634
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylev?expand=0&rev=5
This commit is contained in:
2022-10-07 07:53:47 +00:00
committed by Git OBS Bridge
parent c87dc2677f
commit cc93967ecd
5 changed files with 22 additions and 15 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:063910098161199b81e453025653ec53556c1be7165a9b7c50be2f4d57eae1c3
size 3193

3
pylev-1.4.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e77e941042ad3a4cc305dcdf2b2dec1aec2fbe3dd9015d2698ad02b173006d1
size 4710

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 5 00:20:54 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to v1.4.0
Bumped to 1.4.0!
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 28 07:09:16 UTC 2021 - pgajdos@suse.com Fri May 28 07:09:16 UTC 2021 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pylev # spec file for package python-pylev
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pylev Name: python-pylev
Version: 1.3.0 Version: 1.4.0
Release: 0 Release: 0
Summary: A pure Python Levenshtein implementation Summary: A pure Python Levenshtein implementation
License: BSD-3-Clause License: BSD-3-Clause

View File

@@ -2,25 +2,26 @@ import itertools
import unittest import unittest
import pylev import pylev
test_data = [ test_data = [
('classic', "kitten", "sitting", 3), ("classic", "kitten", "sitting", 3),
('same', "kitten", "kitten", 0), ("same", "kitten", "kitten", 0),
('empty', "", "", 0), ("empty", "", "", 0),
('a', "meilenstein", "levenshtein", 4), ("a", "meilenstein", "levenshtein", 4),
('b', "levenshtein", "frankenstein", 6), ("b", "levenshtein", "frankenstein", 6),
('c', "confide", "deceit", 6), ("c", "confide", "deceit", 6),
('d', "CUNsperrICY", "conspiracy", 8), ("d", "CUNsperrICY", "conspiracy", 8),
] ]
test_functions = [ test_functions = [
# pylev.classic_levenshtein, # disabled because it is so slow # pylev.classic_levenshtein, # disabled because it is so slow
pylev.recursive_levenshtein, pylev.recursive_levenshtein,
pylev.wf_levenshtein, pylev.wf_levenshtein,
pylev.wfi_levenshtein pylev.wfi_levenshtein,
] ]
class Tests(unittest.TestCase):
class Tests(unittest.TestCase):
def test_damerau_levenshtein(seld): def test_damerau_levenshtein(seld):
assert pylev.damerau_levenshtein("ba", "abc") == 2 assert pylev.damerau_levenshtein("ba", "abc") == 2
assert pylev.damerau_levenshtein("foobar", "foobra") == 1 assert pylev.damerau_levenshtein("foobar", "foobra") == 1
@@ -41,5 +42,5 @@ for lev_fn, data in itertools.product(test_functions, test_data):
setattr(Tests, "test_%s_%s" % (name, lev_fn.__name__), test_fn) setattr(Tests, "test_%s_%s" % (name, lev_fn.__name__), test_fn)
if __name__ == '__main__': if __name__ == "__main__":
unittest.main() unittest.main()