From 82a503792ab1bc3c65ba238406e70056a63af3d7 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 8 Oct 2023 01:45:22 +0100 Subject: [PATCH] =?UTF-8?q?Update=20thefuzz=200.19.0=20(c2cd4f4)=20?= =?UTF-8?q?=E2=86=92=200.21.0=20(0b49e4a).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + lib/thefuzz/__init__.py | 2 +- lib/thefuzz/process.py | 10 +++++++--- lib/thefuzz/py.typed | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 lib/thefuzz/py.typed diff --git a/CHANGES.md b/CHANGES.md index b4b074f1..f139e92b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ * Update Pytvmaze library 2.0.8 (81888a5) to 2.0.8 (b451391) * Update Rarfile 4.1a1 (8a72967) to 4.1 (c9140d8) * Update soupsieve 2.4.1 (2e66beb) to 2.5.0 (dc71495) +* Update thefuzz 0.19.0 (c2cd4f4) to 0.21.0 (0b49e4a) ### 3.30.1 (2023-10-02 22:50:00 UTC) diff --git a/lib/thefuzz/__init__.py b/lib/thefuzz/__init__.py index 482e4a19..e4533712 100644 --- a/lib/thefuzz/__init__.py +++ b/lib/thefuzz/__init__.py @@ -1 +1 @@ -__version__ = '0.19.0' +__version__ = '0.21.0' diff --git a/lib/thefuzz/process.py b/lib/thefuzz/process.py index f6b15eaa..bdfe900e 100644 --- a/lib/thefuzz/process.py +++ b/lib/thefuzz/process.py @@ -4,6 +4,7 @@ from . import utils import logging from rapidfuzz import fuzz as rfuzz from rapidfuzz import process as rprocess +from functools import partial _logger = logging.getLogger(__name__) @@ -23,11 +24,14 @@ def _get_processor(processor, scorer): fuzz.UWRatio, fuzz.UQRatio): return processor - if not processor: - return utils.full_process + force_ascii = scorer not in [fuzz.UWRatio, fuzz.UQRatio] + pre_processor = partial(utils.full_process, force_ascii=force_ascii) + + if not processor or processor == utils.full_process: + return pre_processor def wrapper(s): - return utils.full_process(processor(s)) + return pre_processor(processor(s)) return wrapper diff --git a/lib/thefuzz/py.typed b/lib/thefuzz/py.typed new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/thefuzz/py.typed @@ -0,0 +1 @@ +