From 47df6ffa4b0df0dd16f063f12d2876f2eb983248 Mon Sep 17 00:00:00 2001 From: Max Bachmann <44199644+maxbachmann@users.noreply.github.com> Date: Tue, 19 May 2020 18:39:16 +0200 Subject: [PATCH 1/2] The cpp version is now always used --- Benchmarks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Benchmarks.md b/Benchmarks.md index 75a2bc3..7dc6e3a 100644 --- a/Benchmarks.md +++ b/Benchmarks.md @@ -1,7 +1,7 @@ # Benchmarks To compare the speed of FuzzyWuzzy and RapidFuzz the Benchmark of FuzzyWuzzy is used. -Therefore the Benchmark is always executed for FuzzyWuzzy, RapidFuzz and when directly calling the CPP handler without redirection (e.g. `rapidfuzz.fuzz.fuzz_cpp.ratio`). +Therefore the Benchmark is always executed for FuzzyWuzzy and RapidFuzz. Afterwards a ratio between the runtime of both results is calculated. The benchmark can be found [here](https://github.com/rhasspy/rapidfuzz/blob/master/python/bench). The results of the benchmarks are visualised below. ## fuzz.ratio From 52dcaa9f3d0db35dcb94463092022399fc9d7773 Mon Sep 17 00:00:00 2001 From: Max Bachmann <44199644+maxbachmann@users.noreply.github.com> Date: Tue, 19 May 2020 21:25:30 +0200 Subject: [PATCH 2/2] fix some wrong docstrings --- src/py_fuzz.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/py_fuzz.cpp b/src/py_fuzz.cpp index 02d6eff..1f61a74 100644 --- a/src/py_fuzz.cpp +++ b/src/py_fuzz.cpp @@ -137,7 +137,7 @@ static PyObject* ratio(PyObject* /*self*/, PyObject* args, PyObject* keywds) { PyDoc_STRVAR(partial_ratio_docstring, "partial_ratio($module, s1, s2, processor = False, score_cutoff = 0)\n" "--\n\n" -"calculates a partial ratio between two strings\n\n" +"calculates the fuzz.ratio of the optimal string alignment\n\n" "Args:\n" " s1 (str): first string to compare\n" " s2 (str): first string to compare\n" @@ -159,7 +159,7 @@ static PyObject* partial_ratio(PyObject* /*self*/, PyObject* args, PyObject* key PyDoc_STRVAR(token_sort_ratio_docstring, "token_sort_ratio($module, s1, s2, processor = False, score_cutoff = 0)\n" "--\n\n" -"Compares the words in the strings based on unique and common words between them using fuzz.ratio\n\n" +"sorts the words in the strings and calculates the fuzz.ratio between them\n\n" "Args:\n" " s1 (str): first string to compare\n" " s2 (str): first string to compare\n" @@ -326,7 +326,8 @@ PyDoc_STRVAR(quick_lev_ratio_docstring, "quick_lev_ratio($module, s1, s2, processor = False, score_cutoff = 0)\n" "--\n\n" "Calculates a quick estimation of fuzz.ratio by counting uncommon letters between the two sentences.\n" -"Guaranteed to be equal or higher than fuzz.ratio and can therefore be used to filter results before using fuzz.ratio\n\n" +"Guaranteed to be equal or higher than fuzz.ratio.\n" +"(internally used by fuzz.ratio when providing it with a score_cutoff to speed up the matching)\n\n" "Args:\n" " s1 (str): first string to compare\n" " s2 (str): first string to compare\n" @@ -376,4 +377,4 @@ static struct PyModuleDef moduledef = { PyMODINIT_FUNC PyInit_fuzz(void) { return PyModule_Create(&moduledef); -} \ No newline at end of file +}