Skip to content

Commit 8638ab2

Browse files
committed
fixed WRatio for a length ratio of exactly 8.0
1 parent 8bda2f0 commit 8638ab2

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/branchbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
git clone https://github.com/rapidfuzz/rapidfuzz-cpp.git
6262
cd rapidfuzz-cpp
63-
git checkout v3.3.2
63+
git checkout v3.3.3
6464
mkdir build && cd build
6565
cmake .. -DCMAKE_BUILD_TYPE=Release
6666
cmake --build .
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
git clone https://github.com/rapidfuzz/rapidfuzz-cpp.git
106106
cd rapidfuzz-cpp
107-
git checkout v3.3.2
107+
git checkout v3.3.3
108108
mkdir build && cd build
109109
cmake .. -DCMAKE_BUILD_TYPE=Release
110110
cmake --build .

CHANGELOG.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
Changelog
22
---------
33

4-
[3.14.0] - 2025-
4+
[3.14.0] - 2025-08-27
55
^^^^^^^^^^^^^^^^^^^^^
66
Changed
77
~~~~~~~
88
* upgrade to ``Cython==3.1.1``. This enables compilation with free threaded python.
99
* add python 3.14 wheels
1010
* add wheels for freethreaded Python
11+
* upgrade to ``rapidfuzz-cpp==3.3.3``
1112

1213
Fixed
1314
~~~~~
1415
* remove unused hook-dirs from pyinstaller config to fix a warning
16+
* fixed WRatio for a length ratio of exactly 8.0
1517

1618
[3.13.0] - 2025-04-03
1719
^^^^^^^^^^^^^^^^^^^^^

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ else()
121121
add_library(Taskflow::Taskflow ALIAS Taskflow)
122122
endif()
123123

124-
find_package(rapidfuzz 3.3.2 QUIET)
124+
find_package(rapidfuzz 3.3.3 QUIET)
125125
if(rapidfuzz_FOUND)
126126
message(STATUS "Using system supplied version of rapidfuzz-cpp")
127127
else()

src/rapidfuzz/fuzz_py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def WRatio(
802802
token_ratio(s1, s2, score_cutoff=score_cutoff, processor=None) * UNBASE_SCALE,
803803
)
804804

805-
PARTIAL_SCALE = 0.9 if len_ratio < 8.0 else 0.6
805+
PARTIAL_SCALE = 0.9 if len_ratio <= 8.0 else 0.6
806806
score_cutoff = max(score_cutoff, end_ratio) / PARTIAL_SCALE
807807
end_ratio = max(end_ratio, partial_ratio(s1, s2, score_cutoff=score_cutoff) * PARTIAL_SCALE)
808808

tests/test_fuzz.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ def testWRatioUnicode():
173173
assert fuzz.WRatio("new york mets", "new york mets") == 100
174174

175175

176+
def test_issue452():
177+
assert pytest.approx(fuzz.WRatio("hello", "hello" + "abcde"*7)) == 90
178+
179+
176180
def testQRatioUnicode():
177181
assert fuzz.WRatio("new york mets", "new york mets") == 100
178182

0 commit comments

Comments
 (0)