Fix incorrect editops results
This commit is contained in:
parent
c8bf132121
commit
2422d8abba
14
CITATION.bib
14
CITATION.bib
|
@ -1,10 +1,10 @@
|
||||||
@software{max_bachmann_2021_5501155,
|
@software{max_bachmann_2021_5584996,
|
||||||
author = {Max Bachmann},
|
author = {Max Bachmann},
|
||||||
title = {maxbachmann/RapidFuzz: Release 1.6.1},
|
title = {maxbachmann/RapidFuzz: Release 1.8.0},
|
||||||
month = sep,
|
month = oct,
|
||||||
year = 2021,
|
year = 2021,
|
||||||
publisher = {Zenodo},
|
publisher = {Zenodo},
|
||||||
version = {v1.6.1},
|
version = {v1.8.0},
|
||||||
doi = {10.5281/zenodo.5501155},
|
doi = {10.5281/zenodo.5584996},
|
||||||
url = {https://doi.org/10.5281/zenodo.5501155}
|
url = {https://doi.org/10.5281/zenodo.5584996}
|
||||||
}
|
}
|
|
@ -22,7 +22,7 @@ copyright = '2021, Max Bachmann'
|
||||||
author = 'Max Bachmann'
|
author = 'Max Bachmann'
|
||||||
|
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
release = '1.8.0'
|
release = '1.8.1'
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f40ee4a6c11fb3763b90d664c17ab4982bae061b
|
Subproject commit a96ce1a833b7f3c8f921f09e86b1ac0fd86482f5
|
|
@ -3,6 +3,6 @@ rapid string matching library
|
||||||
"""
|
"""
|
||||||
__author__ = "Max Bachmann"
|
__author__ = "Max Bachmann"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__version__ = "1.8.0"
|
__version__ = "1.8.1"
|
||||||
|
|
||||||
from rapidfuzz import process, fuzz, utils, levenshtein, string_metric
|
from rapidfuzz import process, fuzz, utils, levenshtein, string_metric
|
||||||
|
|
|
@ -57,10 +57,15 @@ def test_levenshtein_editops():
|
||||||
"""
|
"""
|
||||||
basic test for levenshtein_editops
|
basic test for levenshtein_editops
|
||||||
"""
|
"""
|
||||||
assert string_metric.levenshtein_editops("0", "") == [("delete", 1, 0)]
|
assert string_metric.levenshtein_editops("0", "") == [("delete", 0, 0)]
|
||||||
assert string_metric.levenshtein_editops("", "0") == [("insert", 0, 1)]
|
assert string_metric.levenshtein_editops("", "0") == [("insert", 0, 0)]
|
||||||
assert string_metric.levenshtein_editops("qabxcd", "abycdf") == [
|
assert string_metric.levenshtein_editops("qabxcd", "abycdf") == [
|
||||||
("delete", 1, 0), ("replace", 4, 3), ("insert", 6, 6)
|
("delete", 0, 0), ("replace", 3, 2), ("insert", 6, 5)
|
||||||
|
]
|
||||||
|
assert string_metric.levenshtein_editops("Lorem ipsum.", "XYZLorem ABC iPsum") == [
|
||||||
|
("insert", 0, 0), ("insert", 0, 1), ("insert", 0, 2), ("insert", 5, 8),
|
||||||
|
("insert", 5, 9), ("insert", 5, 10), ("insert", 5, 11), ("replace", 7, 14),
|
||||||
|
("delete", 11, 18)
|
||||||
]
|
]
|
||||||
|
|
||||||
def test_help():
|
def test_help():
|
||||||
|
|
Loading…
Reference in New Issue