Skip to content

Commit

Permalink
fix broken matching_blocks conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann authored Jul 23, 2022
1 parent d252234 commit aa4711f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### v0.20.1
#### Fixed
- fix broken matching_blocks conversion

### v0.20.0
#### Changed
- use `matching_blocks`/`apply`/`remove_subsequence`/`inverse` implementation from RapidFuzz
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Max Bachmann'

# The full version, including alpha/beta/rc tags
release = '0.20.0'
release = '0.20.1'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="Levenshtein",
version="0.20.0",
version="0.20.1",
url="https://github.com/maxbachmann/Levenshtein",
author="Max Bachmann",
install_requires=["rapidfuzz >= 2.3.0, < 3.0.0"],
Expand Down
6 changes: 3 additions & 3 deletions src/Levenshtein/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

__author__: str = "Max Bachmann"
__license__: str = "GPL"
__version__: str = "0.20.0"
__version__: str = "0.20.1"

from rapidfuzz.distance.Levenshtein import distance
from rapidfuzz.distance.Indel import normalized_similarity as ratio
Expand Down Expand Up @@ -161,9 +161,9 @@ def matching_blocks(edit_operations, source_string, destination_string):
len2 = destination_string if isinstance(destination_string, int) else len(destination_string)

if len(edit_operations[0]) == 3:
return _Editops(edit_operations, len1, len2).as_matching_blocks().as_list()
return _Editops(edit_operations, len1, len2).as_matching_blocks()

return _Opcodes(edit_operations, len1, len2).as_matching_blocks().as_list()
return _Opcodes(edit_operations, len1, len2).as_matching_blocks()


def apply_edit(edit_operations, source_string, destination_string):
Expand Down

0 comments on commit aa4711f

Please sign in to comment.