diff --git a/.github/workflows/pythonbuild.yml b/.github/workflows/pythonbuild.yml index d01f52e..e5a8b1b 100644 --- a/.github/workflows/pythonbuild.yml +++ b/.github/workflows/pythonbuild.yml @@ -101,7 +101,8 @@ jobs: fail-fast: false matrix: python_tag: [ "pp36-*", "pp37-*"] - os: [ubuntu-latest, windows-latest, macos-latest] + # numpy ships no wheels for pypy on mac os + os: [ubuntu-latest, windows-latest] env: CIBW_BUILD: ${{matrix.python_tag}} # activate tests when the fix for diff --git a/docs/process.rst b/docs/process.rst index f277251..314cd20 100644 --- a/docs/process.rst +++ b/docs/process.rst @@ -1,6 +1,10 @@ process module ============== +cdist +---------- +.. autofunction:: rapidfuzz.process.cdist + extract ------- .. autofunction:: rapidfuzz.process.extract diff --git a/pyproject.toml b/pyproject.toml index 51f8f45..d8e7d08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,6 @@ requires = [ "setuptools", "wheel", + "oldest-supported-numpy" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 205a21c..da6b057 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,6 +26,8 @@ package_dir= =src packages = find: python_requires = >=3.5 +install_requires = + numpy [options.packages.find] where=src diff --git a/setup.py b/setup.py index f555764..37622e6 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ from setuptools import setup, Extension from setuptools.command.build_ext import build_ext import sys import os +import numpy as np # use with export RAPIDFUZZ_TRACE=1 RAPIDFUZZ_TRACE = os.environ.get("RAPIDFUZZ_TRACE", False) @@ -46,7 +47,7 @@ ext_modules = [ 'src/cpp_process.cpp', 'src/rapidfuzz-cpp/rapidfuzz/details/unicode.cpp' ], - include_dirs=["src/rapidfuzz-cpp/"], + include_dirs=["src/rapidfuzz-cpp/", np.get_include()], language='c++', ), Extension( diff --git a/src/cpp_common.hpp b/src/cpp_common.hpp index 5cd1ea3..86ea9d8 100644 --- a/src/cpp_common.hpp +++ b/src/cpp_common.hpp @@ -204,8 +204,9 @@ double RATIO##_impl_inner_##PROCESSOR(const proc_string& s1, const Sentence& s2, { \ switch(s1.kind){ \ LIST_OF_CASES(RATIO_FUNC, PROCESSOR) \ + default: \ + throw std::logic_error("Reached end of control flow in " #RATIO "_impl_inner_" #PROCESSOR); \ } \ - assert(false); /* silence any warnings about missing return value */ \ } /* generate _impl_ functions which are used internally @@ -217,8 +218,9 @@ double RATIO##_impl_##PROCESSOR(const proc_string& s1, const proc_string& s2, Ar { \ switch(s1.kind){ \ LIST_OF_CASES(RATIO##_impl_inner_##PROCESSOR, PROCESSOR) \ + default: \ + throw std::logic_error("Reached end of control flow in " #RATIO "_impl_" #PROCESSOR); \ } \ - assert(false); /* silence any warnings about missing return value */ \ } #define RATIO_IMPL_DEF(RATIO, RATIO_FUNC) \ @@ -236,8 +238,9 @@ size_t RATIO##_impl_inner_##PROCESSOR(const proc_string& s1, const Sentence& s2, { \ switch(s1.kind){ \ LIST_OF_CASES(RATIO_FUNC, PROCESSOR) \ + default: \ + throw std::logic_error("Reached end of control flow in " #RATIO "_impl_inner_" #PROCESSOR); \ } \ - assert(false); /* silence any warnings about missing return value */ \ } /* generate _impl_ functions which are used internally @@ -249,8 +252,9 @@ size_t RATIO##_impl_##PROCESSOR(const proc_string& s1, const proc_string& s2, Ar { \ switch(s1.kind){ \ LIST_OF_CASES(RATIO##_impl_inner_##PROCESSOR, PROCESSOR) \ + default: \ + throw std::logic_error("Reached end of control flow in " #RATIO "_impl_" #PROCESSOR); \ } \ - assert(false); /* silence any warnings about missing return value */ \ } #define DISTANCE_IMPL_DEF(RATIO, RATIO_FUNC) \ @@ -310,3 +314,36 @@ PyObject* RATIO##_default_process(const proc_string& s1, const proc_string& s2, size_t result = RATIO##_impl_default_process(s1, s2, max); \ return dist_to_long(result); \ } + + +template +proc_string default_process_func_impl(proc_string sentence) { + CharT* str = static_cast(sentence.data); + if (!sentence.allocated) + { + CharT* temp_str = (CharT*)malloc(sentence.length * sizeof(CharT)); + if (temp_str == NULL) + { + throw std::bad_alloc(); + } + std::copy(str, str + sentence.length, temp_str); + str = temp_str; + } + + sentence.allocated = true; + sentence.data = str; + sentence.kind = sentence.kind; + sentence.length = utils::default_process(str, sentence.length); + + return sentence; +} + +proc_string default_process_func(proc_string sentence) { + switch (sentence.kind) { + # define X_ENUM(KIND, TYPE, MSVC_TUPLE) case KIND: return default_process_func_impl(std::move(sentence)); + LIST_OF_CASES() + default: + throw std::logic_error("Reached end of control flow in default_process_func"); + # undef X_ENUM + } +} diff --git a/src/cpp_common.pxd b/src/cpp_common.pxd index 1e1c654..48e8943 100644 --- a/src/cpp_common.pxd +++ b/src/cpp_common.pxd @@ -23,6 +23,7 @@ cdef extern from "cpp_common.hpp": int is_valid_string(object py_str) except + proc_string convert_string(object py_str) void validate_string(object py_str, const char* err) except + + proc_string default_process_func(proc_string sentence) except + cdef inline proc_string hash_array(arr) except *: # TODO on Cpython this does not require any copies diff --git a/src/cpp_fuzz.cpp b/src/cpp_fuzz.cpp index 05439ad..cdb8d1b 100644 --- a/src/cpp_fuzz.cpp +++ b/src/cpp_fuzz.cpp @@ -1976,11 +1976,11 @@ static const char __pyx_k_partial_token_set_ratio[] = "partial_token_set_ratio"; static const char __pyx_k_partial_token_sort_ratio[] = "partial_token_sort_ratio"; static const char __pyx_k_token_set_ratio_line_217[] = "token_set_ratio (line 217)"; static const char __pyx_k_token_sort_ratio_line_170[] = "token_sort_ratio (line 170)"; -static const char __pyx_k_Sorts_the_words_in_the_strings[] = "\n Sorts the words in the strings and calculates the fuzz.ratio between them\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_sort_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\")\n 100.0\n "; -static const char __pyx_k_Calculates_a_quick_ratio_betwee[] = "\n Calculates a quick ratio between two strings using fuzz.ratio.\n The only difference to fuzz.ratio is, that this preprocesses\n the strings by default.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Examples\n --------\n >>> fuzz.QRatio(\"this is a test\", \"THIS is a test!\")\n 100.0\n "; -static const char __pyx_k_Calculates_the_normalized_InDel[] = "\n Calculates the normalized InDel distance.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n See Also\n --------\n rapidfuzz.string_metric.normalized_levenshtein : Normalized levenshtein distance\n\n Notes\n -----\n .. image:: img/ratio.svg\n\n Examples\n --------\n >>> fuzz.ratio(\"this is a test\", \"this is a test!\")\n 96.55171966552734\n "; -static const char __pyx_k_Compares_the_words_in_the_strin[] = "\n Compares the words in the strings based on unique and common words between them\n using fuzz.ratio\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_set_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 83.8709716796875\n >>> fuzz.token_set_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 100.0\n "; -static const char __pyx_k_Searches_for_the_optimal_alignm[] = "\n Searches for the optimal alignment of the shorter string in the\n longer string and returns the fuzz.ratio for this alignment.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n Depending on the length of the needle (shorter string) different\n implementations are used to improve the performance.\n\n short needle (length \342\211\244 64):\n When using a short needle length the fuzz.ratio is calculated for all\n alignments that could result in an optimal alignment. It is\n guaranteed to find the optimal alignment. For short needles this is very\n fast, since for them fuzz.ratio runs in ``O(N)`` time. This results in a worst\n case performance of ``O(NM)``.\n \n .. image:: img/partial_ratio_short_needle.svg\n\n long needle (length > 64):\n For long needles a similar implementation to FuzzyWuzzy is used.\n This implementation only considers alignments which start at one\n of the longest common substrings. This results in a worst case performance\n of ``O(N[N/64]M)``. However usually most of the alignments can be skipped.\n The following Python code shows the concept:\n\n .. code-block:: python\n\n blocks = SequenceMatcher(None, needle, longer, False).get_ma""tching_blocks()\n score = 0\n for block in blocks:\n long_start = block[1] - block[0] if (block[1] - block[0]) > 0 else 0\n long_end = long_start + len(shorter)\n long_substr = longer[long_start:long_end]\n score = max(score, fuzz.ratio(needle, long_substr))\n\n This is a lot faster than checking all possible alignments. However it\n only finds one of the best alignments and not necessarily the optimal one.\n\n .. image:: img/partial_ratio_long_needle.svg\n\n Examples\n --------\n >>> fuzz.partial_ratio(\"this is a test\", \"this is a test!\")\n 100.0\n "; +static const char __pyx_k_Sorts_the_words_in_the_strings[] = "\n Sorts the words in the strings and calculates the fuzz.ratio between them\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_sort_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\")\n 100.0\n "; +static const char __pyx_k_Calculates_a_quick_ratio_betwee[] = "\n Calculates a quick ratio between two strings using fuzz.ratio.\n The only difference to fuzz.ratio is, that this preprocesses\n the strings by default.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Examples\n --------\n >>> fuzz.QRatio(\"this is a test\", \"THIS is a test!\")\n 100.0\n "; +static const char __pyx_k_Calculates_the_normalized_InDel[] = "\n Calculates the normalized InDel distance.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n See Also\n --------\n rapidfuzz.string_metric.normalized_levenshtein : Normalized levenshtein distance\n\n Notes\n -----\n .. image:: img/ratio.svg\n\n Examples\n --------\n >>> fuzz.ratio(\"this is a test\", \"this is a test!\")\n 96.55171966552734\n "; +static const char __pyx_k_Compares_the_words_in_the_strin[] = "\n Compares the words in the strings based on unique and common words between them\n using fuzz.ratio\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_set_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 83.8709716796875\n >>> fuzz.token_set_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 100.0\n "; +static const char __pyx_k_Searches_for_the_optimal_alignm[] = "\n Searches for the optimal alignment of the shorter string in the\n longer string and returns the fuzz.ratio for this alignment.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n Depending on the length of the needle (shorter string) different\n implementations are used to improve the performance.\n\n short needle (length \342\211\244 64):\n When using a short needle length the fuzz.ratio is calculated for all\n alignments that could result in an optimal alignment. It is\n guaranteed to find the optimal alignment. For short needles this is very\n fast, since for them fuzz.ratio runs in ``O(N)`` time. This results in a worst\n case performance of ``O(NM)``.\n \n .. image:: img/partial_ratio_short_needle.svg\n\n long needle (length > 64):\n For long needles a similar implementation to FuzzyWuzzy is used.\n This implementation only considers alignments which start at one\n of the longest common substrings. This results in a worst case performance\n of ``O(N[N/64]M)``. However usually most of the alignments can be skipped.\n The following Python code shows the concept:\n\n .. code-block:: python\n\n blocks = SequenceMatcher(None,"" needle, longer, False).get_matching_blocks()\n score = 0\n for block in blocks:\n long_start = block[1] - block[0] if (block[1] - block[0]) > 0 else 0\n long_end = long_start + len(shorter)\n long_substr = longer[long_start:long_end]\n score = max(score, fuzz.ratio(needle, long_substr))\n\n This is a lot faster than checking all possible alignments. However it\n only finds one of the best alignments and not necessarily the optimal one.\n\n .. image:: img/partial_ratio_long_needle.svg\n\n Examples\n --------\n >>> fuzz.partial_ratio(\"this is a test\", \"this is a test!\")\n 100.0\n "; #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_kp_u_Calculates_a_quick_ratio_betwee; static PyObject *__pyx_kp_u_Calculates_the_normalized_InDel; @@ -2542,7 +2542,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_ratio, "\n Calculates the normalized InDel distance.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n See Also\n --------\n rapidfuzz.string_metric.normalized_levenshtein : Normalized levenshtein distance\n\n Notes\n -----\n .. image:: img/ratio.svg\n\n Examples\n --------\n >>> fuzz.ratio(\"this is a test\", \"this is a test!\")\n 96.55171966552734\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_ratio, "\n Calculates the normalized InDel distance.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n See Also\n --------\n rapidfuzz.string_metric.normalized_levenshtein : Normalized levenshtein distance\n\n Notes\n -----\n .. image:: img/ratio.svg\n\n Examples\n --------\n >>> fuzz.ratio(\"this is a test\", \"this is a test!\")\n 96.55171966552734\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_1ratio = {"ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_1ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_1ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -2926,7 +2926,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_2partial_ratio, "\n Searches for the optimal alignment of the shorter string in the\n longer string and returns the fuzz.ratio for this alignment.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n Depending on the length of the needle (shorter string) different\n implementations are used to improve the performance.\n\n short needle (length \342\211\244 64):\n When using a short needle length the fuzz.ratio is calculated for all\n alignments that could result in an optimal alignment. It is\n guaranteed to find the optimal alignment. For short needles this is very\n fast, since for them fuzz.ratio runs in ``O(N)`` time. This results in a worst\n case performance of ``O(NM)``.\n \n .. image:: img/partial_ratio_short_needle.svg\n\n long needle (length > 64):\n For long needles a similar implementation to FuzzyWuzzy is used.\n This implementation only considers alignments which start at one\n of the longest common substrings. This results in a worst case performance\n of ``O(N[N/64]M)``. However usually most of the alignments can be skipped.\n The following Python code shows the concept:\n\n .. code-block:: python\n\n blocks = SequenceMatcher(None, needle, longer, False).get_ma""tching_blocks()\n score = 0\n for block in blocks:\n long_start = block[1] - block[0] if (block[1] - block[0]) > 0 else 0\n long_end = long_start + len(shorter)\n long_substr = longer[long_start:long_end]\n score = max(score, fuzz.ratio(needle, long_substr))\n\n This is a lot faster than checking all possible alignments. However it\n only finds one of the best alignments and not necessarily the optimal one.\n\n .. image:: img/partial_ratio_long_needle.svg\n\n Examples\n --------\n >>> fuzz.partial_ratio(\"this is a test\", \"this is a test!\")\n 100.0\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_2partial_ratio, "\n Searches for the optimal alignment of the shorter string in the\n longer string and returns the fuzz.ratio for this alignment.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n Depending on the length of the needle (shorter string) different\n implementations are used to improve the performance.\n\n short needle (length \342\211\244 64):\n When using a short needle length the fuzz.ratio is calculated for all\n alignments that could result in an optimal alignment. It is\n guaranteed to find the optimal alignment. For short needles this is very\n fast, since for them fuzz.ratio runs in ``O(N)`` time. This results in a worst\n case performance of ``O(NM)``.\n \n .. image:: img/partial_ratio_short_needle.svg\n\n long needle (length > 64):\n For long needles a similar implementation to FuzzyWuzzy is used.\n This implementation only considers alignments which start at one\n of the longest common substrings. This results in a worst case performance\n of ``O(N[N/64]M)``. However usually most of the alignments can be skipped.\n The following Python code shows the concept:\n\n .. code-block:: python\n\n blocks = SequenceMatcher(None,"" needle, longer, False).get_matching_blocks()\n score = 0\n for block in blocks:\n long_start = block[1] - block[0] if (block[1] - block[0]) > 0 else 0\n long_end = long_start + len(shorter)\n long_substr = longer[long_start:long_end]\n score = max(score, fuzz.ratio(needle, long_substr))\n\n This is a lot faster than checking all possible alignments. However it\n only finds one of the best alignments and not necessarily the optimal one.\n\n .. image:: img/partial_ratio_long_needle.svg\n\n Examples\n --------\n >>> fuzz.partial_ratio(\"this is a test\", \"this is a test!\")\n 100.0\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_3partial_ratio = {"partial_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_3partial_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_2partial_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_3partial_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -3310,7 +3310,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_4token_sort_ratio, "\n Sorts the words in the strings and calculates the fuzz.ratio between them\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_sort_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\")\n 100.0\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_4token_sort_ratio, "\n Sorts the words in the strings and calculates the fuzz.ratio between them\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_sort_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\")\n 100.0\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_5token_sort_ratio = {"token_sort_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_5token_sort_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_4token_sort_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_5token_sort_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -3694,7 +3694,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_6token_set_ratio, "\n Compares the words in the strings based on unique and common words between them\n using fuzz.ratio\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_set_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 83.8709716796875\n >>> fuzz.token_set_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 100.0\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_6token_set_ratio, "\n Compares the words in the strings based on unique and common words between them\n using fuzz.ratio\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_set_ratio.svg\n\n Examples\n --------\n >>> fuzz.token_sort_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 83.8709716796875\n >>> fuzz.token_set_ratio(\"fuzzy was a bear\", \"fuzzy fuzzy was a bear\")\n 100.0\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_7token_set_ratio = {"token_set_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_7token_set_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_6token_set_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_7token_set_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4078,7 +4078,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_8token_ratio, "\n Helper method that returns the maximum of fuzz.token_set_ratio and fuzz.token_sort_ratio\n (faster than manually executing the two functions)\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_ratio.svg\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_8token_ratio, "\n Helper method that returns the maximum of fuzz.token_set_ratio and fuzz.token_sort_ratio\n (faster than manually executing the two functions)\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/token_ratio.svg\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_9token_ratio = {"token_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_9token_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_8token_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_9token_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4462,7 +4462,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_10partial_token_sort_ratio, "\n sorts the words in the strings and calculates the fuzz.partial_ratio between them\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_sort_ratio.svg\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_10partial_token_sort_ratio, "\n sorts the words in the strings and calculates the fuzz.partial_ratio between them\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_sort_ratio.svg\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_11partial_token_sort_ratio = {"partial_token_sort_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_11partial_token_sort_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_10partial_token_sort_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_11partial_token_sort_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4846,7 +4846,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_12partial_token_set_ratio, "\n Compares the words in the strings based on unique and common words between them\n using fuzz.partial_ratio\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_set_ratio.svg\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_12partial_token_set_ratio, "\n Compares the words in the strings based on unique and common words between them\n using fuzz.partial_ratio\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_set_ratio.svg\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_13partial_token_set_ratio = {"partial_token_set_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_13partial_token_set_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_12partial_token_set_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_13partial_token_set_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5230,7 +5230,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_14partial_token_ratio, "\n Helper method that returns the maximum of fuzz.partial_token_set_ratio and\n fuzz.partial_token_sort_ratio (faster than manually executing the two functions)\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_ratio.svg\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_14partial_token_ratio, "\n Helper method that returns the maximum of fuzz.partial_token_set_ratio and\n fuzz.partial_token_sort_ratio (faster than manually executing the two functions)\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/partial_token_ratio.svg\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_15partial_token_ratio = {"partial_token_ratio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_15partial_token_ratio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_14partial_token_ratio}; static PyObject *__pyx_pw_8cpp_fuzz_15partial_token_ratio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5614,7 +5614,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_16WRatio, "\n Calculates a weighted ratio based on the other ratio algorithms\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/WRatio.svg\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_16WRatio, "\n Calculates a weighted ratio based on the other ratio algorithms\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Notes\n -----\n .. image:: img/WRatio.svg\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_17WRatio = {"WRatio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_17WRatio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_16WRatio}; static PyObject *__pyx_pw_8cpp_fuzz_17WRatio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5998,7 +5998,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_18QRatio, "\n Calculates a quick ratio between two strings using fuzz.ratio.\n The only difference to fuzz.ratio is, that this preprocesses\n the strings by default.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Examples\n --------\n >>> fuzz.QRatio(\"this is a test\", \"THIS is a test!\")\n 100.0\n "); +PyDoc_STRVAR(__pyx_doc_8cpp_fuzz_18QRatio, "\n Calculates a quick ratio between two strings using fuzz.ratio.\n The only difference to fuzz.ratio is, that this preprocesses\n the strings by default.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is True.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Examples\n --------\n >>> fuzz.QRatio(\"this is a test\", \"THIS is a test!\")\n 100.0\n "); static PyMethodDef __pyx_mdef_8cpp_fuzz_19QRatio = {"QRatio", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cpp_fuzz_19QRatio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cpp_fuzz_18QRatio}; static PyObject *__pyx_pw_8cpp_fuzz_19QRatio(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -6364,8 +6364,8 @@ static PyObject *__pyx_pf_8cpp_fuzz_18QRatio(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + +/* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -6407,30 +6407,30 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_array", 0); - /* "cpp_common.pxd":30 + /* "cpp_common.pxd":31 * # TODO on Cpython this does not require any copies * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode # <<<<<<<<<<<<<< * s_proc.length = len(arr) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_typecode = ((Py_UCS4)__pyx_t_2); - /* "cpp_common.pxd":31 + /* "cpp_common.pxd":32 * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode * s_proc.length = len(arr) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 32, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_3); - /* "cpp_common.pxd":33 + /* "cpp_common.pxd":34 * s_proc.length = len(arr) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -6439,7 +6439,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -6449,16 +6449,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_4 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_4)) { - /* "cpp_common.pxd":36 + /* "cpp_common.pxd":37 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 36, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 37, __pyx_L1_error) - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -6467,7 +6467,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6483,7 +6483,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -6494,7 +6494,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx case 98: case 66: - /* "cpp_common.pxd":41 + /* "cpp_common.pxd":42 * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6503,7 +6503,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":42 + /* "cpp_common.pxd":43 * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6515,21 +6515,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":43 + /* "cpp_common.pxd":44 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -6539,7 +6539,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x75: - /* "cpp_common.pxd":45 + /* "cpp_common.pxd":46 * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6548,7 +6548,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":46 + /* "cpp_common.pxd":47 * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6560,21 +6560,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":47 + /* "cpp_common.pxd":48 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_2)); } - /* "cpp_common.pxd":44 + /* "cpp_common.pxd":45 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t # <<<<<<<<<<<<<< @@ -6584,7 +6584,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x68: - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -6593,7 +6593,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 72: - /* "cpp_common.pxd":49 + /* "cpp_common.pxd":50 * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6602,7 +6602,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":50 + /* "cpp_common.pxd":51 * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6614,21 +6614,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":51 + /* "cpp_common.pxd":52 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -6638,7 +6638,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x69: - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -6647,7 +6647,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 73: - /* "cpp_common.pxd":53 + /* "cpp_common.pxd":54 * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6656,7 +6656,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":54 + /* "cpp_common.pxd":55 * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6668,21 +6668,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":55 + /* "cpp_common.pxd":56 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -6692,7 +6692,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x6C: - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -6701,7 +6701,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 76: - /* "cpp_common.pxd":57 + /* "cpp_common.pxd":58 * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6710,7 +6710,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":58 + /* "cpp_common.pxd":59 * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6722,21 +6722,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":59 + /* "cpp_common.pxd":60 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -6746,7 +6746,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x71: - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -6755,7 +6755,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 81: - /* "cpp_common.pxd":61 + /* "cpp_common.pxd":62 * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6764,7 +6764,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":62 + /* "cpp_common.pxd":63 * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6776,21 +6776,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":63 + /* "cpp_common.pxd":64 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -6800,7 +6800,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; default: - /* "cpp_common.pxd":65 + /* "cpp_common.pxd":66 * (s_proc.data)[i] = arr[i] * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -6809,7 +6809,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":66 + /* "cpp_common.pxd":67 * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6821,23 +6821,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":67 + /* "cpp_common.pxd":68 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) # <<<<<<<<<<<<<< * except Exception as e: * free(s_proc.data) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_12); } break; } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6852,7 +6852,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -6862,7 +6862,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("cpp_common.hash_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 68, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 69, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_15); @@ -6870,7 +6870,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_v_e = __pyx_t_14; /*try:*/ { - /* "cpp_common.pxd":69 + /* "cpp_common.pxd":70 * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -6879,7 +6879,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":70 + /* "cpp_common.pxd":71 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -6888,7 +6888,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":71 + /* "cpp_common.pxd":72 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -6900,10 +6900,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_14, __pyx_t_15); __pyx_t_1 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; - __PYX_ERR(1, 71, __pyx_L29_error) + __PYX_ERR(1, 72, __pyx_L29_error) } - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -6947,7 +6947,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6962,7 +6962,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L9_try_end:; } - /* "cpp_common.pxd":73 + /* "cpp_common.pxd":74 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -6971,7 +6971,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":74 + /* "cpp_common.pxd":75 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -6981,8 +6981,8 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + + /* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -7002,7 +7002,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx return __pyx_r; } -/* "cpp_common.pxd":77 +/* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -7046,17 +7046,17 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_sequence", 0); - /* "cpp_common.pxd":79 + /* "cpp_common.pxd":80 * cdef inline proc_string hash_sequence(seq) except *: * cdef proc_string s_proc * s_proc.length = len(seq) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_1); - /* "cpp_common.pxd":81 + /* "cpp_common.pxd":82 * s_proc.length = len(seq) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -7065,7 +7065,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -7075,16 +7075,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "cpp_common.pxd":84 + /* "cpp_common.pxd":85 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 84, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 85, __pyx_L1_error) - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -7093,7 +7093,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7109,7 +7109,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "cpp_common.pxd":87 + /* "cpp_common.pxd":88 * * try: * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -7118,7 +7118,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":88 + /* "cpp_common.pxd":89 * try: * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -7130,19 +7130,19 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "cpp_common.pxd":89 + /* "cpp_common.pxd":90 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * elem = seq[i] # <<<<<<<<<<<<<< * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L4_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -7156,23 +7156,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = __pyx_t_11; goto __pyx_L13_bool_binop_done; } - __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 91, __pyx_L4_error) + __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 92, __pyx_L4_error) __pyx_t_11 = ((__pyx_t_1 == 1) != 0); __pyx_t_2 = __pyx_t_11; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_common.pxd":92 + /* "cpp_common.pxd":93 * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: * (s_proc.data)[i] = elem # <<<<<<<<<<<<<< * else: * (s_proc.data)[i] = hash(elem) */ - __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L4_error) + __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_12)); - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -7182,7 +7182,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L12; } - /* "cpp_common.pxd":94 + /* "cpp_common.pxd":95 * (s_proc.data)[i] = elem * else: * (s_proc.data)[i] = hash(elem) # <<<<<<<<<<<<<< @@ -7190,13 +7190,13 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ * free(s_proc.data) */ /*else*/ { - __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 94, __pyx_L4_error) + __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 95, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_13); } __pyx_L12:; } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7211,7 +7211,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -7221,7 +7221,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_14) { __Pyx_AddTraceback("cpp_common.hash_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 95, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 96, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_15); __Pyx_GOTREF(__pyx_t_16); @@ -7229,7 +7229,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_v_e = __pyx_t_15; /*try:*/ { - /* "cpp_common.pxd":96 + /* "cpp_common.pxd":97 * (s_proc.data)[i] = hash(elem) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -7238,7 +7238,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":97 + /* "cpp_common.pxd":98 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -7247,7 +7247,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":98 + /* "cpp_common.pxd":99 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -7259,10 +7259,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_15, __pyx_t_16); __pyx_t_9 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __PYX_ERR(1, 98, __pyx_L20_error) + __PYX_ERR(1, 99, __pyx_L20_error) } - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -7306,7 +7306,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7321,7 +7321,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L9_try_end:; } - /* "cpp_common.pxd":100 + /* "cpp_common.pxd":101 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -7329,7 +7329,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":101 + /* "cpp_common.pxd":102 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -7337,7 +7337,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":77 + /* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -7463,8 +7463,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 36, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 42, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 43, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -8252,7 +8252,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_common.pxd":77 + /* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< diff --git a/src/cpp_fuzz.pyx b/src/cpp_fuzz.pyx index 3dc43a5..422cbaf 100644 --- a/src/cpp_fuzz.pyx +++ b/src/cpp_fuzz.pyx @@ -42,9 +42,9 @@ def ratio(s1, s2, *, processor=None, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -94,9 +94,9 @@ def partial_ratio(s1, s2, *, processor=None, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -173,9 +173,9 @@ def token_sort_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -221,9 +221,9 @@ def token_set_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -271,9 +271,9 @@ def token_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -313,9 +313,9 @@ def partial_token_sort_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -356,9 +356,9 @@ def partial_token_set_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -399,9 +399,9 @@ def partial_token_ratio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -441,9 +441,9 @@ def WRatio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -485,9 +485,9 @@ def QRatio(s1, s2, *, processor=True, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before diff --git a/src/cpp_process.cpp b/src/cpp_process.cpp index fee4404..e41b2ef 100644 --- a/src/cpp_process.cpp +++ b/src/cpp_process.cpp @@ -827,12 +827,21 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #include +#include +#include #include #include -#include #include #include #include "cpp_common.hpp" + + /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */ + +#include "numpy/arrayobject.h" +#include "numpy/ndarrayobject.h" +#include "numpy/ndarraytypes.h" +#include "numpy/arrayscalars.h" +#include "numpy/ufuncobject.h" #include "cpp_process.hpp" #ifdef _OPENMP #include @@ -1052,11 +1061,34 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "cpp_process.pyx", "cpp_common.pxd", + "__init__.cython-30.pxd", "type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ @@ -1067,8 +1099,257 @@ static const char *__pyx_f[] = { #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + /* #### Code section: numeric_typedefs ### */ + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":732 + * # in Cython to enable them only on the right systems. + * + * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + */ +typedef npy_int8 __pyx_t_5numpy_int8_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":733 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":734 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":735 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":739 + * #ctypedef npy_int128 int128_t + * + * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + */ +typedef npy_uint8 __pyx_t_5numpy_uint8_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":740 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":741 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":742 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":746 + * #ctypedef npy_uint128 uint128_t + * + * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< + * ctypedef npy_float64 float64_t + * #ctypedef npy_float80 float80_t + */ +typedef npy_float32 __pyx_t_5numpy_float32_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":747 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":756 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":757 + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong longlong_t + * + */ +typedef npy_longlong __pyx_t_5numpy_long_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":758 + * ctypedef npy_long int_t + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_ulong uint_t + */ +typedef npy_longlong __pyx_t_5numpy_longlong_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":760 + * ctypedef npy_longlong longlong_t + * + * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t + */ +typedef npy_ulong __pyx_t_5numpy_uint_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":761 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":762 + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t + * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< + * + * ctypedef npy_intp intp_t + */ +typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":764 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":765 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":767 + * ctypedef npy_uintp uintp_t + * + * ctypedef npy_double float_t # <<<<<<<<<<<<<< + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t + */ +typedef npy_double __pyx_t_5numpy_float_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":768 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":769 + * ctypedef npy_double float_t + * ctypedef npy_double double_t + * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cfloat cfloat_t + */ +typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /* #### Code section: complex_type_declarations ### */ +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ @@ -1079,12 +1360,50 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict; struct __pyx_obj_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list; struct __pyx_obj_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict; struct __pyx_obj_11cpp_process___pyx_scope_struct_6_py_extract_iter_list; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":771 + * ctypedef npy_longdouble longdouble_t + * + * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t + */ +typedef npy_cfloat __pyx_t_5numpy_cfloat_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":772 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":773 + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t + * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< + * + * ctypedef npy_cdouble complex_t + */ +typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":775 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; typedef struct __pyx_defaults1 __pyx_defaults1; struct __pyx_defaults2; typedef struct __pyx_defaults2 __pyx_defaults2; +struct __pyx_defaults3; +typedef struct __pyx_defaults3 __pyx_defaults3; struct __pyx_defaults { PyObject *__pyx_arg_scorer; PyObject *__pyx_arg_processor; @@ -1097,8 +1416,11 @@ struct __pyx_defaults2 { PyObject *__pyx_arg_scorer; PyObject *__pyx_arg_processor; }; +struct __pyx_defaults3 { + PyObject *__pyx_arg_scorer; +}; -/* "cpp_process.pyx":1104 +/* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -1128,7 +1450,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct__extract_iter { }; -/* "cpp_process.pyx":1165 +/* "cpp_process.pyx":1170 * cdef size_t c_max = -1 * * def extract_iter_dict(): # <<<<<<<<<<<<<< @@ -1149,7 +1471,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_1_extract_iter_dict { }; -/* "cpp_process.pyx":1196 +/* "cpp_process.pyx":1201 * yield (choice, score, choice_key) * * def extract_iter_list(): # <<<<<<<<<<<<<< @@ -1170,7 +1492,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_2_extract_iter_list { }; -/* "cpp_process.pyx":1228 +/* "cpp_process.pyx":1233 * yield (choice, score, i) * * def extract_iter_distance_dict(): # <<<<<<<<<<<<<< @@ -1191,7 +1513,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict { }; -/* "cpp_process.pyx":1259 +/* "cpp_process.pyx":1264 * yield (choice, distance, choice_key) * * def extract_iter_distance_list(): # <<<<<<<<<<<<<< @@ -1212,7 +1534,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list { }; -/* "cpp_process.pyx":1291 +/* "cpp_process.pyx":1296 * yield (choice, distance, i) * * def py_extract_iter_dict(): # <<<<<<<<<<<<<< @@ -1232,7 +1554,7 @@ struct __pyx_obj_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict { }; -/* "cpp_process.pyx":1320 +/* "cpp_process.pyx":1325 * yield (choice, score, choice_key) * * def py_extract_iter_list(): # <<<<<<<<<<<<<< @@ -2141,6 +2463,31 @@ static int __pyx_Generator_init(PyObject *module); /* GeneratorYieldFrom.proto */ static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject *gen, PyObject *source); +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* BufferGetAndValidate.proto */ +#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\ + ((obj == Py_None || obj == NULL) ?\ + (__Pyx_ZeroBuffer(buf), 0) :\ + __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)) +static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj, + __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); +static void __Pyx_ZeroBuffer(Py_buffer* buf); +static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); +static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 }; +static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); @@ -2197,6 +2544,29 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + /* CppExceptionConversion.proto */ #ifndef __Pyx_CppExn2PyErr #include @@ -2250,6 +2620,104 @@ static void __Pyx_CppExn2PyErr() { /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); @@ -2311,6 +2779,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); #endif /* #### Code section: module_declarations ### */ +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/ +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/ /* Module declarations from "libcpp.vector" */ #if !CYTHON_USE_MODULE_STATE @@ -2328,6 +2803,14 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); #if !CYTHON_USE_MODULE_STATE #endif +/* Module declarations from "libc.stdint" */ +#if !CYTHON_USE_MODULE_STATE +#endif + +/* Module declarations from "libc.math" */ +#if !CYTHON_USE_MODULE_STATE +#endif + /* Module declarations from "libc.string" */ #if !CYTHON_USE_MODULE_STATE #endif @@ -2361,10 +2844,6 @@ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; #if !CYTHON_USE_MODULE_STATE #endif -/* Module declarations from "libc.stdint" */ -#if !CYTHON_USE_MODULE_STATE -#endif - /* Module declarations from "libc.stdlib" */ #if !CYTHON_USE_MODULE_STATE #endif @@ -2379,6 +2858,33 @@ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *); /*proto*/ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *); /*proto*/ +/* Module declarations from "numpy" */ +#if !CYTHON_USE_MODULE_STATE +#endif + +/* Module declarations from "numpy" */ +#if !CYTHON_USE_MODULE_STATE +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_generic = 0; +static PyTypeObject *__pyx_ptype_5numpy_number = 0; +static PyTypeObject *__pyx_ptype_5numpy_integer = 0; +static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; +static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; +static PyTypeObject *__pyx_ptype_5numpy_floating = 0; +static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; +static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; +static PyTypeObject *__pyx_ptype_5numpy_character = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +#endif + +/* Module declarations from "cython" */ +#if !CYTHON_USE_MODULE_STATE +#endif + /* Module declarations from "cpp_process" */ #if !CYTHON_USE_MODULE_STATE static PyTypeObject *__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter = 0; @@ -2409,7 +2915,16 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(CachedDistanceContext, PyObject *, PyObject *, size_t, size_t); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *, PyObject *, PyObject *, PyObject *, size_t, double, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *, PyObject *, PyObject *, PyObject *, size_t, double, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_two_lists_similarity(std::vector const &, std::vector const &, PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_two_lists_distance(std::vector const &, std::vector const &, PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_cdist_two_lists(std::vector const &, std::vector const &, PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_11cpp_process_cdist_two_lists(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_single_list_similarity(std::vector const &, PyObject *, PyObject *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_single_list_distance(std::vector const &, PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_11cpp_process_cdist_single_list(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "cpp_process" extern int __pyx_module_is_main_cpp_process; @@ -2421,11 +2936,13 @@ static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_ImportError; /* #### Code section: string_decls ### */ static const char __pyx_k_i[] = "i"; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__18[] = "*"; -static const char __pyx_k__22[] = "?"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k__21[] = "*"; +static const char __pyx_k__26[] = "?"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_args[] = "args"; @@ -2436,16 +2953,22 @@ static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_c_max[] = "c_max"; +static const char __pyx_k_cdist[] = "cdist"; static const char __pyx_k_close[] = "close"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_heapq[] = "heapq"; static const char __pyx_k_index[] = "index"; +static const char __pyx_k_int32[] = "int32"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_limit[] = "limit"; +static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_query[] = "query"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_ratio[] = "ratio"; static const char __pyx_k_score[] = "score"; static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_uint8[] = "uint8"; static const char __pyx_k_QRatio[] = "QRatio"; static const char __pyx_k_WRatio[] = "WRatio"; static const char __pyx_k_choice[] = "choice"; @@ -2457,6 +2980,7 @@ static const char __pyx_k_choices[] = "choices"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_extract[] = "extract"; static const char __pyx_k_hamming[] = "hamming"; +static const char __pyx_k_queries[] = "queries"; static const char __pyx_k_weights[] = "weights"; static const char __pyx_k_distance[] = "distance"; static const char __pyx_k_nlargest[] = "nlargest"; @@ -2467,6 +2991,7 @@ static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_processor[] = "processor"; static const char __pyx_k_choice_key[] = "choice_key"; static const char __pyx_k_extractOne[] = "extractOne"; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_cpp_process[] = "cpp_process"; static const char __pyx_k_def_process[] = "def_process"; @@ -2495,7 +3020,7 @@ static const char __pyx_k_extract_iter_list[] = "extract_iter_list"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_normalized_hamming[] = "normalized_hamming"; -static const char __pyx_k_extractOne_line_476[] = "extractOne (line 476)"; +static const char __pyx_k_extractOne_line_481[] = "extractOne (line 481)"; static const char __pyx_k_partial_token_ratio[] = "partial_token_ratio"; static const char __pyx_k_py_extract_iter_dict[] = "py_extract_iter_dict"; static const char __pyx_k_py_extract_iter_list[] = "py_extract_iter_list"; @@ -2508,9 +3033,11 @@ static const char __pyx_k_extract_iter_distance_dict[] = "extract_iter_distance_ static const char __pyx_k_extract_iter_distance_list[] = "extract_iter_distance_list"; static const char __pyx_k_py_extract_dict_locals_lambda[] = "py_extract_dict.."; static const char __pyx_k_py_extract_list_locals_lambda[] = "py_extract_list.."; -static const char __pyx_k_Find_the_best_match_in_a_list_o[] = "\n Find the best match in a list of choices. When multiple elements have the same similarity,\n the first element is returned.\n\n Parameters\n ----------\n query : str\n string we want to find\n choices : Iterable\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n Tuple[str, Any, Any]\n Returns the best match in form of a Tuple with 3 elements. The values stored in the\n tuple depend on the types of the input arguments.\n\n * The first element is always the `choice`, which is the value thats compared to the query.\n\n * The second value repre""sents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n None\n When no choice has a `similarity >= score_cutoff`/`distance <= score_cutoff` None is returned\n\n Examples\n --------\n\n >>> from rapidfuzz.process import extractOne\n >>> from rapidfuzz.string_metric import levenshtein, normalized_levenshtein\n >>> from rapidfuzz.fuzz import ratio\n\n extractOne can be used with normalized edit distances.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abcd\", 75.0, 1)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=normalized_levenshtein)\n (\"abcd\", 75.0, 1)\n\n extractOne can be used with edit distances as well.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein)\n (\"abce\", 1, 0)\n\n additional settings of the scorer can be passed as keyword arguments to extractOne\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abcde\", 2, 1)\n\n when a mapping is used for the choices the key of the choi""ce is returned instead of the List index\n\n >>> extractOne(\"abcd\", {\"key\": \"abce\"}, scorer=ratio)\n (\"abcd\", 75.0, \"key\")\n\n By default each string is preprocessed using `utils.default_process`, which lowercases the strings,\n replaces non alphanumeric characters with whitespaces and trims whitespaces from start and end of them.\n This behavior can be changed by passing a custom function, or None/False to disable the behavior. Preprocessing\n can take a significant part of the runtime, so it makes sense to disable it, when it is not required.\n\n\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio)\n (\"abcD\", 100.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=None)\n (\"abcD\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=lambda s: s.upper())\n (\"abcD\", 100.0, 0)\n\n When only results with a similarity above a certain threshold are relevant, the parameter score_cutoff can be\n used to filter out results with a lower similarity. This threshold is used by some of the scorers to exit early,\n when they are sure, that the similarity is below the threshold.\n For normalized edit distances all results with a similarity below score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abce\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio, score_cutoff=80)\n None\n\n For edit distances all results with an edit distance above the score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abce\", 2, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2), score_cutoff=1)\n None\n\n "; +static const char __pyx_k_Find_the_best_match_in_a_list_o[] = "\n Find the best match in a list of choices. When multiple elements have the same similarity,\n the first element is returned.\n\n Parameters\n ----------\n query : Sequence[Hashable]\n string we want to find\n choices : Iterable[Sequence[Hashable]] | Mapping[Sequence[Hashable]]\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n Tuple[Sequence[Hashable], Any, Any]\n Returns the best match in form of a Tuple with 3 elements. The values stored in the\n tuple depend on the types of the input arguments.\n\n * The first element is always the `choice`, whi""ch is the value thats compared to the query.\n\n * The second value represents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n None\n When no choice has a `similarity >= score_cutoff`/`distance <= score_cutoff` None is returned\n\n Examples\n --------\n\n >>> from rapidfuzz.process import extractOne\n >>> from rapidfuzz.string_metric import levenshtein, normalized_levenshtein\n >>> from rapidfuzz.fuzz import ratio\n\n extractOne can be used with normalized edit distances.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abcd\", 75.0, 1)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=normalized_levenshtein)\n (\"abcd\", 75.0, 1)\n\n extractOne can be used with edit distances as well.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein)\n (\"abce\", 1, 0)\n\n additional settings of the scorer can be passed as keyword arguments to extractOne\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (""\"abcde\", 2, 1)\n\n when a mapping is used for the choices the key of the choice is returned instead of the List index\n\n >>> extractOne(\"abcd\", {\"key\": \"abce\"}, scorer=ratio)\n (\"abcd\", 75.0, \"key\")\n\n By default each string is preprocessed using `utils.default_process`, which lowercases the strings,\n replaces non alphanumeric characters with whitespaces and trims whitespaces from start and end of them.\n This behavior can be changed by passing a custom function, or None/False to disable the behavior. Preprocessing\n can take a significant part of the runtime, so it makes sense to disable it, when it is not required.\n\n\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio)\n (\"abcD\", 100.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=None)\n (\"abcD\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=lambda s: s.upper())\n (\"abcD\", 100.0, 0)\n\n When only results with a similarity above a certain threshold are relevant, the parameter score_cutoff can be\n used to filter out results with a lower similarity. This threshold is used by some of the scorers to exit early,\n when they are sure, that the similarity is below the threshold.\n For normalized edit distances all results with a similarity below score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abce\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio, score_cutoff=80)\n None\n\n For edit distances all results with an edit distance above the score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abce\", 2, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2), score_cutoff=1)\n None\n\n "; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_extract_iter_locals_extract_iter[] = "extract_iter..extract_iter_dict"; static const char __pyx_k_extract_iter_locals_py_extract_i[] = "extract_iter..py_extract_iter_dict"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_score_cutoff_has_to_be_in_the_ra[] = "score_cutoff has to be in the range of 0.0 - 100.0"; static const char __pyx_k_extract_iter_locals_extract_iter_2[] = "extract_iter..extract_iter_list"; static const char __pyx_k_extract_iter_locals_extract_iter_3[] = "extract_iter..extract_iter_distance_dict"; @@ -2519,18 +3046,20 @@ static const char __pyx_k_extract_iter_locals_py_extract_i_2[] = "extract_iter.< #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_n_s_DistanceContext; static PyObject *__pyx_kp_u_Find_the_best_match_in_a_list_o; +static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_s_QRatio; static PyObject *__pyx_n_s_ScorerContext; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_WRatio; -static PyObject *__pyx_n_s__18; -static PyObject *__pyx_n_s__22; +static PyObject *__pyx_n_s__21; +static PyObject *__pyx_n_s__26; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_asyncio_coroutines; static PyObject *__pyx_n_s_c_max; static PyObject *__pyx_n_s_c_score_cutoff; +static PyObject *__pyx_n_s_cdist; static PyObject *__pyx_n_s_choice; static PyObject *__pyx_n_s_choice_key; static PyObject *__pyx_n_s_choices; @@ -2542,11 +3071,13 @@ static PyObject *__pyx_n_s_def_process; static PyObject *__pyx_n_s_default_process; static PyObject *__pyx_kp_u_disable; static PyObject *__pyx_n_s_distance; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_empty; static PyObject *__pyx_kp_u_enable; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_extract; static PyObject *__pyx_n_s_extractOne; -static PyObject *__pyx_kp_u_extractOne_line_476; +static PyObject *__pyx_kp_u_extractOne_line_481; static PyObject *__pyx_n_s_extract_iter; static PyObject *__pyx_n_s_extract_iter_dict; static PyObject *__pyx_n_s_extract_iter_distance_dict; @@ -2566,6 +3097,7 @@ static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_initializing; +static PyObject *__pyx_n_s_int32; static PyObject *__pyx_n_s_is_coroutine; static PyObject *__pyx_kp_u_isenabled; static PyObject *__pyx_n_s_items; @@ -2581,6 +3113,10 @@ static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_nlargest; static PyObject *__pyx_n_s_normalized_hamming; static PyObject *__pyx_n_s_normalized_levenshtein; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_partial_ratio; static PyObject *__pyx_n_s_partial_token_ratio; static PyObject *__pyx_n_s_partial_token_set_ratio; @@ -2593,6 +3129,7 @@ static PyObject *__pyx_n_s_py_extract_dict_locals_lambda; static PyObject *__pyx_n_s_py_extract_iter_dict; static PyObject *__pyx_n_s_py_extract_iter_list; static PyObject *__pyx_n_s_py_extract_list_locals_lambda; +static PyObject *__pyx_n_s_queries; static PyObject *__pyx_n_s_query; static PyObject *__pyx_n_s_query_context; static PyObject *__pyx_n_s_range; @@ -2613,16 +3150,17 @@ static PyObject *__pyx_n_s_token_ratio; static PyObject *__pyx_n_s_token_set_ratio; static PyObject *__pyx_n_s_token_sort_ratio; static PyObject *__pyx_n_s_typecode; +static PyObject *__pyx_n_s_uint8; static PyObject *__pyx_n_u_weights; #endif /* #### Code section: decls ### */ -static PyObject *__pyx_pf_11cpp_process_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_11cpp_process_9__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_11cpp_process_9__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_limit, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11cpp_process_11__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_limit, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_11cpp_process_13__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11cpp_process_4extract_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_11cpp_process_12extract_iter_extract_iter_dict(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11cpp_process_12extract_iter_3extract_iter_list(PyObject *__pyx_self); /* proto */ @@ -2630,6 +3168,8 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_6extract_iter_distance_di static PyObject *__pyx_pf_11cpp_process_12extract_iter_9extract_iter_distance_list(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11cpp_process_12extract_iter_12py_extract_iter_dict(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_11cpp_process_12extract_iter_15py_extract_iter_list(PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_11cpp_process_15__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_11cpp_process_7cdist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queries, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_tp_new_11cpp_process___pyx_scope_struct__extract_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11cpp_process___pyx_scope_struct_1_extract_iter_dict(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11cpp_process___pyx_scope_struct_2_extract_iter_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2655,7 +3195,10 @@ static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__5; @@ -2665,6 +3208,7 @@ static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__18; #endif /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ @@ -2683,6 +3227,21 @@ typedef struct { PyTypeObject *__pyx_FusedFunctionType; #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; + PyTypeObject *__pyx_ptype_5numpy_dtype; + PyTypeObject *__pyx_ptype_5numpy_flatiter; + PyTypeObject *__pyx_ptype_5numpy_broadcast; + PyTypeObject *__pyx_ptype_5numpy_ndarray; + PyTypeObject *__pyx_ptype_5numpy_generic; + PyTypeObject *__pyx_ptype_5numpy_number; + PyTypeObject *__pyx_ptype_5numpy_integer; + PyTypeObject *__pyx_ptype_5numpy_signedinteger; + PyTypeObject *__pyx_ptype_5numpy_unsignedinteger; + PyTypeObject *__pyx_ptype_5numpy_inexact; + PyTypeObject *__pyx_ptype_5numpy_floating; + PyTypeObject *__pyx_ptype_5numpy_complexfloating; + PyTypeObject *__pyx_ptype_5numpy_flexible; + PyTypeObject *__pyx_ptype_5numpy_character; + PyTypeObject *__pyx_ptype_5numpy_ufunc; PyTypeObject *__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter; PyObject *__pyx_type_11cpp_process___pyx_scope_struct__extract_iter; PyTypeObject *__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict; @@ -2699,18 +3258,20 @@ typedef struct { PyObject *__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list; PyObject *__pyx_n_s_DistanceContext; PyObject *__pyx_kp_u_Find_the_best_match_in_a_list_o; + PyObject *__pyx_n_s_ImportError; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_s_QRatio; PyObject *__pyx_n_s_ScorerContext; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_WRatio; - PyObject *__pyx_n_s__18; - PyObject *__pyx_n_s__22; + PyObject *__pyx_n_s__21; + PyObject *__pyx_n_s__26; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_array; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_c_max; PyObject *__pyx_n_s_c_score_cutoff; + PyObject *__pyx_n_s_cdist; PyObject *__pyx_n_s_choice; PyObject *__pyx_n_s_choice_key; PyObject *__pyx_n_s_choices; @@ -2722,11 +3283,13 @@ typedef struct { PyObject *__pyx_n_s_default_process; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_distance; + PyObject *__pyx_n_s_dtype; + PyObject *__pyx_n_s_empty; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_enumerate; PyObject *__pyx_n_s_extract; PyObject *__pyx_n_s_extractOne; - PyObject *__pyx_kp_u_extractOne_line_476; + PyObject *__pyx_kp_u_extractOne_line_481; PyObject *__pyx_n_s_extract_iter; PyObject *__pyx_n_s_extract_iter_dict; PyObject *__pyx_n_s_extract_iter_distance_dict; @@ -2746,6 +3309,7 @@ typedef struct { PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_initializing; + PyObject *__pyx_n_s_int32; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; @@ -2761,6 +3325,10 @@ typedef struct { PyObject *__pyx_n_s_nlargest; PyObject *__pyx_n_s_normalized_hamming; PyObject *__pyx_n_s_normalized_levenshtein; + PyObject *__pyx_n_s_np; + PyObject *__pyx_n_s_numpy; + PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to; + PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor; PyObject *__pyx_n_s_partial_ratio; PyObject *__pyx_n_s_partial_token_ratio; PyObject *__pyx_n_s_partial_token_set_ratio; @@ -2773,6 +3341,7 @@ typedef struct { PyObject *__pyx_n_s_py_extract_iter_dict; PyObject *__pyx_n_s_py_extract_iter_list; PyObject *__pyx_n_s_py_extract_list_locals_lambda; + PyObject *__pyx_n_s_queries; PyObject *__pyx_n_s_query; PyObject *__pyx_n_s_query_context; PyObject *__pyx_n_s_range; @@ -2793,6 +3362,7 @@ typedef struct { PyObject *__pyx_n_s_token_set_ratio; PyObject *__pyx_n_s_token_sort_ratio; PyObject *__pyx_n_s_typecode; + PyObject *__pyx_n_s_uint8; PyObject *__pyx_n_u_weights; PyObject *__pyx_float_0_1; PyObject *__pyx_int_1; @@ -2808,7 +3378,10 @@ typedef struct { PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__21; + PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__23; + PyObject *__pyx_tuple__24; + PyObject *__pyx_tuple__25; PyObject *__pyx_codeobj__2; PyObject *__pyx_codeobj__4; PyObject *__pyx_codeobj__5; @@ -2818,6 +3391,7 @@ typedef struct { PyObject *__pyx_codeobj__13; PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__17; + PyObject *__pyx_codeobj__18; } __pyx_mstate; #ifdef __cplusplus @@ -2852,6 +3426,21 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character); + Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc); Py_CLEAR(clear_module_state->__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter); Py_CLEAR(clear_module_state->__pyx_type_11cpp_process___pyx_scope_struct__extract_iter); Py_CLEAR(clear_module_state->__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict); @@ -2868,18 +3457,20 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list); Py_CLEAR(clear_module_state->__pyx_n_s_DistanceContext); Py_CLEAR(clear_module_state->__pyx_kp_u_Find_the_best_match_in_a_list_o); + Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_s_QRatio); Py_CLEAR(clear_module_state->__pyx_n_s_ScorerContext); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_WRatio); - Py_CLEAR(clear_module_state->__pyx_n_s__18); - Py_CLEAR(clear_module_state->__pyx_n_s__22); + Py_CLEAR(clear_module_state->__pyx_n_s__21); + Py_CLEAR(clear_module_state->__pyx_n_s__26); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_array); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_c_max); Py_CLEAR(clear_module_state->__pyx_n_s_c_score_cutoff); + Py_CLEAR(clear_module_state->__pyx_n_s_cdist); Py_CLEAR(clear_module_state->__pyx_n_s_choice); Py_CLEAR(clear_module_state->__pyx_n_s_choice_key); Py_CLEAR(clear_module_state->__pyx_n_s_choices); @@ -2891,11 +3482,13 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_default_process); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_distance); + Py_CLEAR(clear_module_state->__pyx_n_s_dtype); + Py_CLEAR(clear_module_state->__pyx_n_s_empty); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); Py_CLEAR(clear_module_state->__pyx_n_s_extract); Py_CLEAR(clear_module_state->__pyx_n_s_extractOne); - Py_CLEAR(clear_module_state->__pyx_kp_u_extractOne_line_476); + Py_CLEAR(clear_module_state->__pyx_kp_u_extractOne_line_481); Py_CLEAR(clear_module_state->__pyx_n_s_extract_iter); Py_CLEAR(clear_module_state->__pyx_n_s_extract_iter_dict); Py_CLEAR(clear_module_state->__pyx_n_s_extract_iter_distance_dict); @@ -2915,6 +3508,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_n_s_int32); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); @@ -2930,6 +3524,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_nlargest); Py_CLEAR(clear_module_state->__pyx_n_s_normalized_hamming); Py_CLEAR(clear_module_state->__pyx_n_s_normalized_levenshtein); + Py_CLEAR(clear_module_state->__pyx_n_s_np); + Py_CLEAR(clear_module_state->__pyx_n_s_numpy); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_CLEAR(clear_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); Py_CLEAR(clear_module_state->__pyx_n_s_partial_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_partial_token_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_partial_token_set_ratio); @@ -2942,6 +3540,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_py_extract_iter_dict); Py_CLEAR(clear_module_state->__pyx_n_s_py_extract_iter_list); Py_CLEAR(clear_module_state->__pyx_n_s_py_extract_list_locals_lambda); + Py_CLEAR(clear_module_state->__pyx_n_s_queries); Py_CLEAR(clear_module_state->__pyx_n_s_query); Py_CLEAR(clear_module_state->__pyx_n_s_query_context); Py_CLEAR(clear_module_state->__pyx_n_s_range); @@ -2962,6 +3561,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_token_set_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_token_sort_ratio); Py_CLEAR(clear_module_state->__pyx_n_s_typecode); + Py_CLEAR(clear_module_state->__pyx_n_s_uint8); Py_CLEAR(clear_module_state->__pyx_n_u_weights); Py_CLEAR(clear_module_state->__pyx_float_0_1); Py_CLEAR(clear_module_state->__pyx_int_1); @@ -2977,7 +3577,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__21); + Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__23); + Py_CLEAR(clear_module_state->__pyx_tuple__24); + Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_codeobj__2); Py_CLEAR(clear_module_state->__pyx_codeobj__4); Py_CLEAR(clear_module_state->__pyx_codeobj__5); @@ -2987,6 +3590,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__13); Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__17); + Py_CLEAR(clear_module_state->__pyx_codeobj__18); return 0; } #endif @@ -3008,6 +3612,21 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character); + Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc); Py_VISIT(traverse_module_state->__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter); Py_VISIT(traverse_module_state->__pyx_type_11cpp_process___pyx_scope_struct__extract_iter); Py_VISIT(traverse_module_state->__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict); @@ -3024,18 +3643,20 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list); Py_VISIT(traverse_module_state->__pyx_n_s_DistanceContext); Py_VISIT(traverse_module_state->__pyx_kp_u_Find_the_best_match_in_a_list_o); + Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_s_QRatio); Py_VISIT(traverse_module_state->__pyx_n_s_ScorerContext); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_WRatio); - Py_VISIT(traverse_module_state->__pyx_n_s__18); - Py_VISIT(traverse_module_state->__pyx_n_s__22); + Py_VISIT(traverse_module_state->__pyx_n_s__21); + Py_VISIT(traverse_module_state->__pyx_n_s__26); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_array); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_c_max); Py_VISIT(traverse_module_state->__pyx_n_s_c_score_cutoff); + Py_VISIT(traverse_module_state->__pyx_n_s_cdist); Py_VISIT(traverse_module_state->__pyx_n_s_choice); Py_VISIT(traverse_module_state->__pyx_n_s_choice_key); Py_VISIT(traverse_module_state->__pyx_n_s_choices); @@ -3047,11 +3668,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_default_process); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_distance); + Py_VISIT(traverse_module_state->__pyx_n_s_dtype); + Py_VISIT(traverse_module_state->__pyx_n_s_empty); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); Py_VISIT(traverse_module_state->__pyx_n_s_extract); Py_VISIT(traverse_module_state->__pyx_n_s_extractOne); - Py_VISIT(traverse_module_state->__pyx_kp_u_extractOne_line_476); + Py_VISIT(traverse_module_state->__pyx_kp_u_extractOne_line_481); Py_VISIT(traverse_module_state->__pyx_n_s_extract_iter); Py_VISIT(traverse_module_state->__pyx_n_s_extract_iter_dict); Py_VISIT(traverse_module_state->__pyx_n_s_extract_iter_distance_dict); @@ -3071,6 +3694,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_n_s_int32); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); @@ -3086,6 +3710,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_nlargest); Py_VISIT(traverse_module_state->__pyx_n_s_normalized_hamming); Py_VISIT(traverse_module_state->__pyx_n_s_normalized_levenshtein); + Py_VISIT(traverse_module_state->__pyx_n_s_np); + Py_VISIT(traverse_module_state->__pyx_n_s_numpy); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_multiarray_failed_to); + Py_VISIT(traverse_module_state->__pyx_kp_u_numpy_core_umath_failed_to_impor); Py_VISIT(traverse_module_state->__pyx_n_s_partial_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_partial_token_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_partial_token_set_ratio); @@ -3098,6 +3726,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_py_extract_iter_dict); Py_VISIT(traverse_module_state->__pyx_n_s_py_extract_iter_list); Py_VISIT(traverse_module_state->__pyx_n_s_py_extract_list_locals_lambda); + Py_VISIT(traverse_module_state->__pyx_n_s_queries); Py_VISIT(traverse_module_state->__pyx_n_s_query); Py_VISIT(traverse_module_state->__pyx_n_s_query_context); Py_VISIT(traverse_module_state->__pyx_n_s_range); @@ -3118,6 +3747,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_token_set_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_token_sort_ratio); Py_VISIT(traverse_module_state->__pyx_n_s_typecode); + Py_VISIT(traverse_module_state->__pyx_n_s_uint8); Py_VISIT(traverse_module_state->__pyx_n_u_weights); Py_VISIT(traverse_module_state->__pyx_float_0_1); Py_VISIT(traverse_module_state->__pyx_int_1); @@ -3133,7 +3763,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__21); + Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__23); + Py_VISIT(traverse_module_state->__pyx_tuple__24); + Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_codeobj__2); Py_VISIT(traverse_module_state->__pyx_codeobj__4); Py_VISIT(traverse_module_state->__pyx_codeobj__5); @@ -3143,6 +3776,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__13); Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__17); + Py_VISIT(traverse_module_state->__pyx_codeobj__18); return 0; } #endif @@ -3161,6 +3795,21 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type +#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype +#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter +#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast +#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray +#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic +#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number +#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer +#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger +#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger +#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact +#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating +#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating +#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible +#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character +#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc #define __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter __pyx_mstate_global->__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter #define __pyx_type_11cpp_process___pyx_scope_struct__extract_iter __pyx_mstate_global->__pyx_type_11cpp_process___pyx_scope_struct__extract_iter #define __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict __pyx_mstate_global->__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict @@ -3177,18 +3826,20 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list __pyx_mstate_global->__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list #define __pyx_n_s_DistanceContext __pyx_mstate_global->__pyx_n_s_DistanceContext #define __pyx_kp_u_Find_the_best_match_in_a_list_o __pyx_mstate_global->__pyx_kp_u_Find_the_best_match_in_a_list_o +#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_s_QRatio __pyx_mstate_global->__pyx_n_s_QRatio #define __pyx_n_s_ScorerContext __pyx_mstate_global->__pyx_n_s_ScorerContext #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_WRatio __pyx_mstate_global->__pyx_n_s_WRatio -#define __pyx_n_s__18 __pyx_mstate_global->__pyx_n_s__18 -#define __pyx_n_s__22 __pyx_mstate_global->__pyx_n_s__22 +#define __pyx_n_s__21 __pyx_mstate_global->__pyx_n_s__21 +#define __pyx_n_s__26 __pyx_mstate_global->__pyx_n_s__26 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_c_max __pyx_mstate_global->__pyx_n_s_c_max #define __pyx_n_s_c_score_cutoff __pyx_mstate_global->__pyx_n_s_c_score_cutoff +#define __pyx_n_s_cdist __pyx_mstate_global->__pyx_n_s_cdist #define __pyx_n_s_choice __pyx_mstate_global->__pyx_n_s_choice #define __pyx_n_s_choice_key __pyx_mstate_global->__pyx_n_s_choice_key #define __pyx_n_s_choices __pyx_mstate_global->__pyx_n_s_choices @@ -3200,11 +3851,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_default_process __pyx_mstate_global->__pyx_n_s_default_process #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_distance __pyx_mstate_global->__pyx_n_s_distance +#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype +#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate #define __pyx_n_s_extract __pyx_mstate_global->__pyx_n_s_extract #define __pyx_n_s_extractOne __pyx_mstate_global->__pyx_n_s_extractOne -#define __pyx_kp_u_extractOne_line_476 __pyx_mstate_global->__pyx_kp_u_extractOne_line_476 +#define __pyx_kp_u_extractOne_line_481 __pyx_mstate_global->__pyx_kp_u_extractOne_line_481 #define __pyx_n_s_extract_iter __pyx_mstate_global->__pyx_n_s_extract_iter #define __pyx_n_s_extract_iter_dict __pyx_mstate_global->__pyx_n_s_extract_iter_dict #define __pyx_n_s_extract_iter_distance_dict __pyx_mstate_global->__pyx_n_s_extract_iter_distance_dict @@ -3224,6 +3877,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_n_s_int32 __pyx_mstate_global->__pyx_n_s_int32 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items @@ -3239,6 +3893,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_nlargest __pyx_mstate_global->__pyx_n_s_nlargest #define __pyx_n_s_normalized_hamming __pyx_mstate_global->__pyx_n_s_normalized_hamming #define __pyx_n_s_normalized_levenshtein __pyx_mstate_global->__pyx_n_s_normalized_levenshtein +#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np +#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy +#define __pyx_kp_u_numpy_core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy_core_multiarray_failed_to +#define __pyx_kp_u_numpy_core_umath_failed_to_impor __pyx_mstate_global->__pyx_kp_u_numpy_core_umath_failed_to_impor #define __pyx_n_s_partial_ratio __pyx_mstate_global->__pyx_n_s_partial_ratio #define __pyx_n_s_partial_token_ratio __pyx_mstate_global->__pyx_n_s_partial_token_ratio #define __pyx_n_s_partial_token_set_ratio __pyx_mstate_global->__pyx_n_s_partial_token_set_ratio @@ -3251,6 +3909,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_py_extract_iter_dict __pyx_mstate_global->__pyx_n_s_py_extract_iter_dict #define __pyx_n_s_py_extract_iter_list __pyx_mstate_global->__pyx_n_s_py_extract_iter_list #define __pyx_n_s_py_extract_list_locals_lambda __pyx_mstate_global->__pyx_n_s_py_extract_list_locals_lambda +#define __pyx_n_s_queries __pyx_mstate_global->__pyx_n_s_queries #define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query #define __pyx_n_s_query_context __pyx_mstate_global->__pyx_n_s_query_context #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range @@ -3271,6 +3930,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_token_set_ratio __pyx_mstate_global->__pyx_n_s_token_set_ratio #define __pyx_n_s_token_sort_ratio __pyx_mstate_global->__pyx_n_s_token_sort_ratio #define __pyx_n_s_typecode __pyx_mstate_global->__pyx_n_s_typecode +#define __pyx_n_s_uint8 __pyx_mstate_global->__pyx_n_s_uint8 #define __pyx_n_u_weights __pyx_mstate_global->__pyx_n_u_weights #define __pyx_float_0_1 __pyx_mstate_global->__pyx_float_0_1 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 @@ -3286,7 +3946,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 +#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 +#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 @@ -3296,11 +3959,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 +#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #endif /* #### Code section: module_code ### */ -/* "cpp_process.pyx":42 - * +/* "cpp_process.pyx":47 + * cimport cython * * cdef inline proc_string conv_sequence(seq) except *: # <<<<<<<<<<<<<< * if is_valid_string(seq): @@ -3320,37 +3984,37 @@ static CYTHON_INLINE proc_string __pyx_f_11cpp_process_conv_sequence(PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("conv_sequence", 0); - __Pyx_TraceCall("conv_sequence", __pyx_f[0], 42, 0, __PYX_ERR(0, 42, __pyx_L1_error)); + __Pyx_TraceCall("conv_sequence", __pyx_f[0], 47, 0, __PYX_ERR(0, 47, __pyx_L1_error)); - /* "cpp_process.pyx":43 + /* "cpp_process.pyx":48 * * cdef inline proc_string conv_sequence(seq) except *: * if is_valid_string(seq): # <<<<<<<<<<<<<< * return move(convert_string(seq)) * elif isinstance(seq, array): */ - __Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error)) + __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) try { __pyx_t_1 = is_valid_string(__pyx_v_seq); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 43, __pyx_L1_error) + __PYX_ERR(0, 48, __pyx_L1_error) } __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":44 + /* "cpp_process.pyx":49 * cdef inline proc_string conv_sequence(seq) except *: * if is_valid_string(seq): * return move(convert_string(seq)) # <<<<<<<<<<<<<< * elif isinstance(seq, array): * return move(hash_array(seq)) */ - __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error)) + __Pyx_TraceLine(49,0,__PYX_ERR(0, 49, __pyx_L1_error)) __pyx_r = cython_std::move(convert_string(__pyx_v_seq)); goto __pyx_L0; - /* "cpp_process.pyx":43 + /* "cpp_process.pyx":48 * * cdef inline proc_string conv_sequence(seq) except *: * if is_valid_string(seq): # <<<<<<<<<<<<<< @@ -3359,34 +4023,34 @@ static CYTHON_INLINE proc_string __pyx_f_11cpp_process_conv_sequence(PyObject *_ */ } - /* "cpp_process.pyx":45 + /* "cpp_process.pyx":50 * if is_valid_string(seq): * return move(convert_string(seq)) * elif isinstance(seq, array): # <<<<<<<<<<<<<< * return move(hash_array(seq)) * else: */ - __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_seq, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_seq, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { - /* "cpp_process.pyx":46 + /* "cpp_process.pyx":51 * return move(convert_string(seq)) * elif isinstance(seq, array): * return move(hash_array(seq)) # <<<<<<<<<<<<<< * else: * return move(hash_sequence(seq)) */ - __Pyx_TraceLine(46,0,__PYX_ERR(0, 46, __pyx_L1_error)) - __pyx_t_5 = __pyx_f_10cpp_common_hash_array(__pyx_v_seq); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error)) + __pyx_t_5 = __pyx_f_10cpp_common_hash_array(__pyx_v_seq); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5)); goto __pyx_L0; - /* "cpp_process.pyx":45 + /* "cpp_process.pyx":50 * if is_valid_string(seq): * return move(convert_string(seq)) * elif isinstance(seq, array): # <<<<<<<<<<<<<< @@ -3395,22 +4059,22 @@ static CYTHON_INLINE proc_string __pyx_f_11cpp_process_conv_sequence(PyObject *_ */ } - /* "cpp_process.pyx":48 + /* "cpp_process.pyx":53 * return move(hash_array(seq)) * else: * return move(hash_sequence(seq)) # <<<<<<<<<<<<<< * * cdef extern from "cpp_process.hpp": */ - __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error)) + __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error)) /*else*/ { - __pyx_t_5 = __pyx_f_10cpp_common_hash_sequence(__pyx_v_seq); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_5 = __pyx_f_10cpp_common_hash_sequence(__pyx_v_seq); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5)); goto __pyx_L0; } - /* "cpp_process.pyx":42 - * + /* "cpp_process.pyx":47 + * cimport cython * * cdef inline proc_string conv_sequence(seq) except *: # <<<<<<<<<<<<<< * if is_valid_string(seq): @@ -3428,7 +4092,7 @@ static CYTHON_INLINE proc_string __pyx_f_11cpp_process_conv_sequence(PyObject *_ return __pyx_r; } -/* "cpp_process.pyx":111 +/* "cpp_process.pyx":116 * * * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -3457,162 +4121,14 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedNormalizedL const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CachedNormalizedLevenshteinInit", 0); - __Pyx_TraceCall("CachedNormalizedLevenshteinInit", __pyx_f[0], 111, 0, __PYX_ERR(0, 111, __pyx_L1_error)); + __Pyx_TraceCall("CachedNormalizedLevenshteinInit", __pyx_f[0], 116, 0, __PYX_ERR(0, 116, __pyx_L1_error)); - /* "cpp_process.pyx":113 + /* "cpp_process.pyx":118 * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): * cdef size_t insertion, deletion, substitution * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) # <<<<<<<<<<<<<< * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) * - */ - __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error)) - if (unlikely(__pyx_v_kwargs == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 113, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_u_weights, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 113, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 113, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 113, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_insertion = __pyx_t_7; - __pyx_v_deletion = __pyx_t_8; - __pyx_v_substitution = __pyx_t_9; - - /* "cpp_process.pyx":114 - * cdef size_t insertion, deletion, substitution - * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) - * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) # <<<<<<<<<<<<<< - * - * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): - */ - __Pyx_TraceLine(114,0,__PYX_ERR(0, 114, __pyx_L1_error)) - try { - __pyx_t_10 = cached_normalized_levenshtein_init(__pyx_v_query, __pyx_v_def_process, __pyx_v_insertion, __pyx_v_deletion, __pyx_v_substitution); - } catch(...) { - __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 114, __pyx_L1_error) - } - __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10)); - goto __pyx_L0; - - /* "cpp_process.pyx":111 - * - * - * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< - * cdef size_t insertion, deletion, substitution - * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_WriteUnraisable("cpp_process.CachedNormalizedLevenshteinInit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); - __Pyx_pretend_to_initialize(&__pyx_r); - __pyx_L0:; - __Pyx_TraceReturn(Py_None, 0); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "cpp_process.pyx":116 - * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) - * - * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< - * cdef size_t insertion, deletion, substitution - * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) - */ - -static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedLevenshteinInit(proc_string const &__pyx_v_query, int __pyx_v_def_process, PyObject *__pyx_v_kwargs) { - size_t __pyx_v_insertion; - size_t __pyx_v_deletion; - size_t __pyx_v_substitution; - CachedDistanceContext __pyx_r; - __Pyx_TraceDeclarations - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - size_t __pyx_t_7; - size_t __pyx_t_8; - size_t __pyx_t_9; - CachedDistanceContext __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CachedLevenshteinInit", 0); - __Pyx_TraceCall("CachedLevenshteinInit", __pyx_f[0], 116, 0, __PYX_ERR(0, 116, __pyx_L1_error)); - - /* "cpp_process.pyx":118 - * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): - * cdef size_t insertion, deletion, substitution - * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) # <<<<<<<<<<<<<< - * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) - * */ __Pyx_TraceLine(118,0,__PYX_ERR(0, 118, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { @@ -3687,21 +4203,169 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedLevenshte /* "cpp_process.pyx":119 * cdef size_t insertion, deletion, substitution * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) - * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) # <<<<<<<<<<<<<< + * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) # <<<<<<<<<<<<<< * - * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): + * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): */ __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error)) try { - __pyx_t_10 = cached_levenshtein_init(__pyx_v_query, __pyx_v_def_process, __pyx_v_insertion, __pyx_v_deletion, __pyx_v_substitution); + __pyx_t_10 = cached_normalized_levenshtein_init(__pyx_v_query, __pyx_v_def_process, __pyx_v_insertion, __pyx_v_deletion, __pyx_v_substitution); } catch(...) { __Pyx_CppExn2PyErr(); __PYX_ERR(0, 119, __pyx_L1_error) } - __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10)); + __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10)); goto __pyx_L0; /* "cpp_process.pyx":116 + * + * + * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t insertion, deletion, substitution + * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("cpp_process.CachedNormalizedLevenshteinInit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_TraceReturn(Py_None, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":121 + * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) + * + * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t insertion, deletion, substitution + * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) + */ + +static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedLevenshteinInit(proc_string const &__pyx_v_query, int __pyx_v_def_process, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_insertion; + size_t __pyx_v_deletion; + size_t __pyx_v_substitution; + CachedDistanceContext __pyx_r; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + size_t __pyx_t_7; + size_t __pyx_t_8; + size_t __pyx_t_9; + CachedDistanceContext __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("CachedLevenshteinInit", 0); + __Pyx_TraceCall("CachedLevenshteinInit", __pyx_f[0], 121, 0, __PYX_ERR(0, 121, __pyx_L1_error)); + + /* "cpp_process.pyx":123 + * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): + * cdef size_t insertion, deletion, substitution + * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) # <<<<<<<<<<<<<< + * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) + * + */ + __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 123, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_u_weights, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 123, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_unpacking_done; + __pyx_L3_unpacking_failed:; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_L4_unpacking_done:; + } + __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_insertion = __pyx_t_7; + __pyx_v_deletion = __pyx_t_8; + __pyx_v_substitution = __pyx_t_9; + + /* "cpp_process.pyx":124 + * cdef size_t insertion, deletion, substitution + * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) + * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) # <<<<<<<<<<<<<< + * + * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): + */ + __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) + try { + __pyx_t_10 = cached_levenshtein_init(__pyx_v_query, __pyx_v_def_process, __pyx_v_insertion, __pyx_v_deletion, __pyx_v_substitution); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 124, __pyx_L1_error) + } + __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10)); + goto __pyx_L0; + + /* "cpp_process.pyx":121 * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) * * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -3724,7 +4388,7 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedLevenshte return __pyx_r; } -/* "cpp_process.pyx":121 +/* "cpp_process.pyx":126 * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) * * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -3744,44 +4408,44 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedJaroWinkler const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CachedJaroWinklerSimilarityInit", 0); - __Pyx_TraceCall("CachedJaroWinklerSimilarityInit", __pyx_f[0], 121, 0, __PYX_ERR(0, 121, __pyx_L1_error)); + __Pyx_TraceCall("CachedJaroWinklerSimilarityInit", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error)); - /* "cpp_process.pyx":123 + /* "cpp_process.pyx":128 * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): * cdef double prefix_weight * prefix_weight = kwargs.get("prefix_weight", 0.1) # <<<<<<<<<<<<<< * return move(cached_jaro_winkler_similarity_init(query, def_process, prefix_weight)) * */ - __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error)) + __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 123, __pyx_L1_error) + __PYX_ERR(0, 128, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_u_prefix_weight, __pyx_float_0_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_u_prefix_weight, __pyx_float_0_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_prefix_weight = __pyx_t_2; - /* "cpp_process.pyx":124 + /* "cpp_process.pyx":129 * cdef double prefix_weight * prefix_weight = kwargs.get("prefix_weight", 0.1) * return move(cached_jaro_winkler_similarity_init(query, def_process, prefix_weight)) # <<<<<<<<<<<<<< * * cdef inline int IsIntegratedScorer(object scorer): */ - __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error)) + __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error)) try { __pyx_t_3 = cached_jaro_winkler_similarity_init(__pyx_v_query, __pyx_v_def_process, __pyx_v_prefix_weight); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 124, __pyx_L1_error) + __PYX_ERR(0, 129, __pyx_L1_error) } __pyx_r = cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3)); goto __pyx_L0; - /* "cpp_process.pyx":121 + /* "cpp_process.pyx":126 * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) * * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -3800,7 +4464,7 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedJaroWinkler return __pyx_r; } -/* "cpp_process.pyx":126 +/* "cpp_process.pyx":131 * return move(cached_jaro_winkler_similarity_init(query, def_process, prefix_weight)) * * cdef inline int IsIntegratedScorer(object scorer): # <<<<<<<<<<<<<< @@ -3819,107 +4483,17 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("IsIntegratedScorer", 0); - __Pyx_TraceCall("IsIntegratedScorer", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error)); + __Pyx_TraceCall("IsIntegratedScorer", __pyx_f[0], 131, 0, __PYX_ERR(0, 131, __pyx_L1_error)); - /* "cpp_process.pyx":128 + /* "cpp_process.pyx":133 * cdef inline int IsIntegratedScorer(object scorer): * return ( * scorer is ratio or # <<<<<<<<<<<<<< * scorer is partial_ratio or * scorer is token_sort_ratio or - */ - __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - - /* "cpp_process.pyx":129 - * return ( - * scorer is ratio or - * scorer is partial_ratio or # <<<<<<<<<<<<<< - * scorer is token_sort_ratio or - * scorer is token_set_ratio or - */ - __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - - /* "cpp_process.pyx":130 - * scorer is ratio or - * scorer is partial_ratio or - * scorer is token_sort_ratio or # <<<<<<<<<<<<<< - * scorer is token_set_ratio or - * scorer is token_ratio or - */ - __Pyx_TraceLine(130,0,__PYX_ERR(0, 130, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_sort_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - - /* "cpp_process.pyx":131 - * scorer is partial_ratio or - * scorer is token_sort_ratio or - * scorer is token_set_ratio or # <<<<<<<<<<<<<< - * scorer is token_ratio or - * scorer is partial_token_sort_ratio or - */ - __Pyx_TraceLine(131,0,__PYX_ERR(0, 131, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_set_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - - /* "cpp_process.pyx":132 - * scorer is token_sort_ratio or - * scorer is token_set_ratio or - * scorer is token_ratio or # <<<<<<<<<<<<<< - * scorer is partial_token_sort_ratio or - * scorer is partial_token_set_ratio or - */ - __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_3) { - } else { - __pyx_t_1 = __pyx_t_3; - goto __pyx_L3_bool_binop_done; - } - - /* "cpp_process.pyx":133 - * scorer is token_set_ratio or - * scorer is token_ratio or - * scorer is partial_token_sort_ratio or # <<<<<<<<<<<<<< - * scorer is partial_token_set_ratio or - * scorer is partial_token_ratio or */ __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_sort_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3930,14 +4504,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":134 - * scorer is token_ratio or - * scorer is partial_token_sort_ratio or - * scorer is partial_token_set_ratio or # <<<<<<<<<<<<<< - * scorer is partial_token_ratio or - * scorer is WRatio or + * return ( + * scorer is ratio or + * scorer is partial_ratio or # <<<<<<<<<<<<<< + * scorer is token_sort_ratio or + * scorer is token_set_ratio or */ __Pyx_TraceLine(134,0,__PYX_ERR(0, 134, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_set_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3948,14 +4522,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":135 - * scorer is partial_token_sort_ratio or - * scorer is partial_token_set_ratio or - * scorer is partial_token_ratio or # <<<<<<<<<<<<<< - * scorer is WRatio or - * scorer is QRatio or + * scorer is ratio or + * scorer is partial_ratio or + * scorer is token_sort_ratio or # <<<<<<<<<<<<<< + * scorer is token_set_ratio or + * scorer is token_ratio or */ __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_sort_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3966,14 +4540,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":136 - * scorer is partial_token_set_ratio or - * scorer is partial_token_ratio or - * scorer is WRatio or # <<<<<<<<<<<<<< - * scorer is QRatio or - * scorer is normalized_levenshtein or + * scorer is partial_ratio or + * scorer is token_sort_ratio or + * scorer is token_set_ratio or # <<<<<<<<<<<<<< + * scorer is token_ratio or + * scorer is partial_token_sort_ratio or */ __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_set_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3984,14 +4558,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":137 - * scorer is partial_token_ratio or - * scorer is WRatio or - * scorer is QRatio or # <<<<<<<<<<<<<< - * scorer is normalized_levenshtein or - * scorer is normalized_hamming or + * scorer is token_sort_ratio or + * scorer is token_set_ratio or + * scorer is token_ratio or # <<<<<<<<<<<<<< + * scorer is partial_token_sort_ratio or + * scorer is partial_token_set_ratio or */ __Pyx_TraceLine(137,0,__PYX_ERR(0, 137, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_token_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4002,14 +4576,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":138 - * scorer is WRatio or - * scorer is QRatio or - * scorer is normalized_levenshtein or # <<<<<<<<<<<<<< - * scorer is normalized_hamming or - * scorer is jaro_similarity or + * scorer is token_set_ratio or + * scorer is token_ratio or + * scorer is partial_token_sort_ratio or # <<<<<<<<<<<<<< + * scorer is partial_token_set_ratio or + * scorer is partial_token_ratio or */ __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalized_levenshtein); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_sort_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4020,14 +4594,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":139 - * scorer is QRatio or - * scorer is normalized_levenshtein or - * scorer is normalized_hamming or # <<<<<<<<<<<<<< - * scorer is jaro_similarity or - * scorer is jaro_winkler_similarity + * scorer is token_ratio or + * scorer is partial_token_sort_ratio or + * scorer is partial_token_set_ratio or # <<<<<<<<<<<<<< + * scorer is partial_token_ratio or + * scorer is WRatio or */ __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalized_hamming); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_set_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4038,14 +4612,14 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":140 - * scorer is normalized_levenshtein or - * scorer is normalized_hamming or - * scorer is jaro_similarity or # <<<<<<<<<<<<<< - * scorer is jaro_winkler_similarity - * ) + * scorer is partial_token_sort_ratio or + * scorer is partial_token_set_ratio or + * scorer is partial_token_ratio or # <<<<<<<<<<<<<< + * scorer is WRatio or + * scorer is QRatio or */ __Pyx_TraceLine(140,0,__PYX_ERR(0, 140, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_jaro_similarity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_partial_token_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4056,14 +4630,104 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py } /* "cpp_process.pyx":141 + * scorer is partial_token_set_ratio or + * scorer is partial_token_ratio or + * scorer is WRatio or # <<<<<<<<<<<<<< + * scorer is QRatio or + * scorer is normalized_levenshtein or + */ + __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "cpp_process.pyx":142 + * scorer is partial_token_ratio or + * scorer is WRatio or + * scorer is QRatio or # <<<<<<<<<<<<<< + * scorer is normalized_levenshtein or + * scorer is normalized_hamming or + */ + __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_QRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "cpp_process.pyx":143 + * scorer is WRatio or + * scorer is QRatio or + * scorer is normalized_levenshtein or # <<<<<<<<<<<<<< + * scorer is normalized_hamming or + * scorer is jaro_similarity or + */ + __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalized_levenshtein); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "cpp_process.pyx":144 + * scorer is QRatio or + * scorer is normalized_levenshtein or + * scorer is normalized_hamming or # <<<<<<<<<<<<<< + * scorer is jaro_similarity or + * scorer is jaro_winkler_similarity + */ + __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_normalized_hamming); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "cpp_process.pyx":145 + * scorer is normalized_levenshtein or + * scorer is normalized_hamming or + * scorer is jaro_similarity or # <<<<<<<<<<<<<< + * scorer is jaro_winkler_similarity + * ) + */ + __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_jaro_similarity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "cpp_process.pyx":146 * scorer is normalized_hamming or * scorer is jaro_similarity or * scorer is jaro_winkler_similarity # <<<<<<<<<<<<<< * ) * */ - __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_jaro_winkler_similarity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_jaro_winkler_similarity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4072,7 +4736,7 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "cpp_process.pyx":126 + /* "cpp_process.pyx":131 * return move(cached_jaro_winkler_similarity_init(query, def_process, prefix_weight)) * * cdef inline int IsIntegratedScorer(object scorer): # <<<<<<<<<<<<<< @@ -4091,7 +4755,7 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedScorer(PyObject *__py return __pyx_r; } -/* "cpp_process.pyx":144 +/* "cpp_process.pyx":149 * ) * * cdef inline int IsIntegratedDistance(object scorer): # <<<<<<<<<<<<<< @@ -4110,17 +4774,17 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedDistance(PyObject *__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("IsIntegratedDistance", 0); - __Pyx_TraceCall("IsIntegratedDistance", __pyx_f[0], 144, 0, __PYX_ERR(0, 144, __pyx_L1_error)); + __Pyx_TraceCall("IsIntegratedDistance", __pyx_f[0], 149, 0, __PYX_ERR(0, 149, __pyx_L1_error)); - /* "cpp_process.pyx":146 + /* "cpp_process.pyx":151 * cdef inline int IsIntegratedDistance(object scorer): * return ( * scorer is levenshtein or # <<<<<<<<<<<<<< * scorer is hamming * ) */ - __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_levenshtein); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_TraceLine(151,0,__PYX_ERR(0, 151, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_levenshtein); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4130,15 +4794,15 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedDistance(PyObject *__ goto __pyx_L3_bool_binop_done; } - /* "cpp_process.pyx":147 + /* "cpp_process.pyx":152 * return ( * scorer is levenshtein or * scorer is hamming # <<<<<<<<<<<<<< * ) * */ - __Pyx_TraceLine(147,0,__PYX_ERR(0, 147, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hamming); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hamming); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4147,7 +4811,7 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedDistance(PyObject *__ __pyx_r = __pyx_t_1; goto __pyx_L0; - /* "cpp_process.pyx":144 + /* "cpp_process.pyx":149 * ) * * cdef inline int IsIntegratedDistance(object scorer): # <<<<<<<<<<<<<< @@ -4166,7 +4830,7 @@ static CYTHON_INLINE int __pyx_f_11cpp_process_IsIntegratedDistance(PyObject *__ return __pyx_r; } -/* "cpp_process.pyx":150 +/* "cpp_process.pyx":155 * ) * * cdef inline CachedScorerContext CachedScorerInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -4187,40 +4851,40 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CachedScorerInit", 0); - __Pyx_TraceCall("CachedScorerInit", __pyx_f[0], 150, 0, __PYX_ERR(0, 150, __pyx_L1_error)); + __Pyx_TraceCall("CachedScorerInit", __pyx_f[0], 155, 0, __PYX_ERR(0, 155, __pyx_L1_error)); - /* "cpp_process.pyx":153 + /* "cpp_process.pyx":158 * cdef CachedScorerContext context * * if scorer is ratio: # <<<<<<<<<<<<<< * context = cached_ratio_init(query, def_process) * elif scorer is partial_ratio: */ - __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":154 + /* "cpp_process.pyx":159 * * if scorer is ratio: * context = cached_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is partial_ratio: * context = cached_partial_ratio_init(query, def_process) */ - __Pyx_TraceLine(154,0,__PYX_ERR(0, 154, __pyx_L1_error)) + __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error)) try { __pyx_t_4 = cached_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 154, __pyx_L1_error) + __PYX_ERR(0, 159, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":153 + /* "cpp_process.pyx":158 * cdef CachedScorerContext context * * if scorer is ratio: # <<<<<<<<<<<<<< @@ -4230,38 +4894,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":155 + /* "cpp_process.pyx":160 * if scorer is ratio: * context = cached_ratio_init(query, def_process) * elif scorer is partial_ratio: # <<<<<<<<<<<<<< * context = cached_partial_ratio_init(query, def_process) * elif scorer is token_sort_ratio: */ - __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":156 + /* "cpp_process.pyx":161 * context = cached_ratio_init(query, def_process) * elif scorer is partial_ratio: * context = cached_partial_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is token_sort_ratio: * context = cached_token_sort_ratio_init(query, def_process) */ - __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error)) + __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error)) try { __pyx_t_4 = cached_partial_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 156, __pyx_L1_error) + __PYX_ERR(0, 161, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":155 + /* "cpp_process.pyx":160 * if scorer is ratio: * context = cached_ratio_init(query, def_process) * elif scorer is partial_ratio: # <<<<<<<<<<<<<< @@ -4271,38 +4935,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":157 + /* "cpp_process.pyx":162 * elif scorer is partial_ratio: * context = cached_partial_ratio_init(query, def_process) * elif scorer is token_sort_ratio: # <<<<<<<<<<<<<< * context = cached_token_sort_ratio_init(query, def_process) * elif scorer is token_set_ratio: */ - __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_sort_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_sort_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":158 + /* "cpp_process.pyx":163 * context = cached_partial_ratio_init(query, def_process) * elif scorer is token_sort_ratio: * context = cached_token_sort_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is token_set_ratio: * context = cached_token_set_ratio_init(query, def_process) */ - __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error)) + __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) try { __pyx_t_4 = cached_token_sort_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 158, __pyx_L1_error) + __PYX_ERR(0, 163, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":157 + /* "cpp_process.pyx":162 * elif scorer is partial_ratio: * context = cached_partial_ratio_init(query, def_process) * elif scorer is token_sort_ratio: # <<<<<<<<<<<<<< @@ -4312,38 +4976,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":159 + /* "cpp_process.pyx":164 * elif scorer is token_sort_ratio: * context = cached_token_sort_ratio_init(query, def_process) * elif scorer is token_set_ratio: # <<<<<<<<<<<<<< * context = cached_token_set_ratio_init(query, def_process) * elif scorer is token_ratio: */ - __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_set_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_set_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":160 + /* "cpp_process.pyx":165 * context = cached_token_sort_ratio_init(query, def_process) * elif scorer is token_set_ratio: * context = cached_token_set_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is token_ratio: * context = cached_token_ratio_init(query, def_process) */ - __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error)) + __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error)) try { __pyx_t_4 = cached_token_set_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 160, __pyx_L1_error) + __PYX_ERR(0, 165, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":159 + /* "cpp_process.pyx":164 * elif scorer is token_sort_ratio: * context = cached_token_sort_ratio_init(query, def_process) * elif scorer is token_set_ratio: # <<<<<<<<<<<<<< @@ -4353,38 +5017,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":161 + /* "cpp_process.pyx":166 * elif scorer is token_set_ratio: * context = cached_token_set_ratio_init(query, def_process) * elif scorer is token_ratio: # <<<<<<<<<<<<<< * context = cached_token_ratio_init(query, def_process) * elif scorer is partial_token_sort_ratio: */ - __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_token_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":162 + /* "cpp_process.pyx":167 * context = cached_token_set_ratio_init(query, def_process) * elif scorer is token_ratio: * context = cached_token_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is partial_token_sort_ratio: * context = cached_partial_token_sort_ratio_init(query, def_process) */ - __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error)) + __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) try { __pyx_t_4 = cached_token_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 167, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":161 + /* "cpp_process.pyx":166 * elif scorer is token_set_ratio: * context = cached_token_set_ratio_init(query, def_process) * elif scorer is token_ratio: # <<<<<<<<<<<<<< @@ -4394,38 +5058,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":163 + /* "cpp_process.pyx":168 * elif scorer is token_ratio: * context = cached_token_ratio_init(query, def_process) * elif scorer is partial_token_sort_ratio: # <<<<<<<<<<<<<< * context = cached_partial_token_sort_ratio_init(query, def_process) * elif scorer is partial_token_set_ratio: */ - __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_sort_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_sort_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":164 + /* "cpp_process.pyx":169 * context = cached_token_ratio_init(query, def_process) * elif scorer is partial_token_sort_ratio: * context = cached_partial_token_sort_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is partial_token_set_ratio: * context = cached_partial_token_set_ratio_init(query, def_process) */ - __Pyx_TraceLine(164,0,__PYX_ERR(0, 164, __pyx_L1_error)) + __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error)) try { __pyx_t_4 = cached_partial_token_sort_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 164, __pyx_L1_error) + __PYX_ERR(0, 169, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":163 + /* "cpp_process.pyx":168 * elif scorer is token_ratio: * context = cached_token_ratio_init(query, def_process) * elif scorer is partial_token_sort_ratio: # <<<<<<<<<<<<<< @@ -4435,38 +5099,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":165 + /* "cpp_process.pyx":170 * elif scorer is partial_token_sort_ratio: * context = cached_partial_token_sort_ratio_init(query, def_process) * elif scorer is partial_token_set_ratio: # <<<<<<<<<<<<<< * context = cached_partial_token_set_ratio_init(query, def_process) * elif scorer is partial_token_ratio: */ - __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_set_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_TraceLine(170,0,__PYX_ERR(0, 170, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_set_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":166 + /* "cpp_process.pyx":171 * context = cached_partial_token_sort_ratio_init(query, def_process) * elif scorer is partial_token_set_ratio: * context = cached_partial_token_set_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is partial_token_ratio: * context = cached_partial_token_ratio_init(query, def_process) */ - __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error)) + __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) try { __pyx_t_4 = cached_partial_token_set_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 166, __pyx_L1_error) + __PYX_ERR(0, 171, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":165 + /* "cpp_process.pyx":170 * elif scorer is partial_token_sort_ratio: * context = cached_partial_token_sort_ratio_init(query, def_process) * elif scorer is partial_token_set_ratio: # <<<<<<<<<<<<<< @@ -4476,38 +5140,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":167 + /* "cpp_process.pyx":172 * elif scorer is partial_token_set_ratio: * context = cached_partial_token_set_ratio_init(query, def_process) * elif scorer is partial_token_ratio: # <<<<<<<<<<<<<< * context = cached_partial_token_ratio_init(query, def_process) * elif scorer is WRatio: */ - __Pyx_TraceLine(167,0,__PYX_ERR(0, 167, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial_token_ratio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":168 + /* "cpp_process.pyx":173 * context = cached_partial_token_set_ratio_init(query, def_process) * elif scorer is partial_token_ratio: * context = cached_partial_token_ratio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is WRatio: * context = cached_WRatio_init(query, def_process) */ - __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error)) + __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error)) try { __pyx_t_4 = cached_partial_token_ratio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(0, 173, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":167 + /* "cpp_process.pyx":172 * elif scorer is partial_token_set_ratio: * context = cached_partial_token_set_ratio_init(query, def_process) * elif scorer is partial_token_ratio: # <<<<<<<<<<<<<< @@ -4517,38 +5181,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":169 + /* "cpp_process.pyx":174 * elif scorer is partial_token_ratio: * context = cached_partial_token_ratio_init(query, def_process) * elif scorer is WRatio: # <<<<<<<<<<<<<< * context = cached_WRatio_init(query, def_process) * elif scorer is QRatio: */ - __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":170 + /* "cpp_process.pyx":175 * context = cached_partial_token_ratio_init(query, def_process) * elif scorer is WRatio: * context = cached_WRatio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is QRatio: * context = cached_QRatio_init(query, def_process) */ - __Pyx_TraceLine(170,0,__PYX_ERR(0, 170, __pyx_L1_error)) + __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error)) try { __pyx_t_4 = cached_WRatio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 170, __pyx_L1_error) + __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":169 + /* "cpp_process.pyx":174 * elif scorer is partial_token_ratio: * context = cached_partial_token_ratio_init(query, def_process) * elif scorer is WRatio: # <<<<<<<<<<<<<< @@ -4558,38 +5222,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":171 + /* "cpp_process.pyx":176 * elif scorer is WRatio: * context = cached_WRatio_init(query, def_process) * elif scorer is QRatio: # <<<<<<<<<<<<<< * context = cached_QRatio_init(query, def_process) * elif scorer is normalized_levenshtein: */ - __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_QRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_QRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":172 + /* "cpp_process.pyx":177 * context = cached_WRatio_init(query, def_process) * elif scorer is QRatio: * context = cached_QRatio_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is normalized_levenshtein: * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) */ - __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error)) + __Pyx_TraceLine(177,0,__PYX_ERR(0, 177, __pyx_L1_error)) try { __pyx_t_4 = cached_QRatio_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(0, 177, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":171 + /* "cpp_process.pyx":176 * elif scorer is WRatio: * context = cached_WRatio_init(query, def_process) * elif scorer is QRatio: # <<<<<<<<<<<<<< @@ -4599,32 +5263,32 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":173 + /* "cpp_process.pyx":178 * elif scorer is QRatio: * context = cached_QRatio_init(query, def_process) * elif scorer is normalized_levenshtein: # <<<<<<<<<<<<<< * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) * elif scorer is normalized_hamming: */ - __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_normalized_levenshtein); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_normalized_levenshtein); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":174 + /* "cpp_process.pyx":179 * context = cached_QRatio_init(query, def_process) * elif scorer is normalized_levenshtein: * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) # <<<<<<<<<<<<<< * elif scorer is normalized_hamming: * context = cached_normalized_hamming_init(query, def_process) */ - __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error)) + __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) __pyx_v_context = __pyx_f_11cpp_process_CachedNormalizedLevenshteinInit(__pyx_v_query, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":173 + /* "cpp_process.pyx":178 * elif scorer is QRatio: * context = cached_QRatio_init(query, def_process) * elif scorer is normalized_levenshtein: # <<<<<<<<<<<<<< @@ -4634,38 +5298,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":175 + /* "cpp_process.pyx":180 * elif scorer is normalized_levenshtein: * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) * elif scorer is normalized_hamming: # <<<<<<<<<<<<<< * context = cached_normalized_hamming_init(query, def_process) * elif scorer is jaro_similarity: */ - __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_normalized_hamming); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_TraceLine(180,0,__PYX_ERR(0, 180, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_normalized_hamming); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":176 + /* "cpp_process.pyx":181 * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) * elif scorer is normalized_hamming: * context = cached_normalized_hamming_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is jaro_similarity: * context = cached_jaro_similarity_init(query, def_process) */ - __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error)) + __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error)) try { __pyx_t_4 = cached_normalized_hamming_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 176, __pyx_L1_error) + __PYX_ERR(0, 181, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":175 + /* "cpp_process.pyx":180 * elif scorer is normalized_levenshtein: * context = CachedNormalizedLevenshteinInit(query, def_process, kwargs) * elif scorer is normalized_hamming: # <<<<<<<<<<<<<< @@ -4675,38 +5339,38 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":177 + /* "cpp_process.pyx":182 * elif scorer is normalized_hamming: * context = cached_normalized_hamming_init(query, def_process) * elif scorer is jaro_similarity: # <<<<<<<<<<<<<< * context = cached_jaro_similarity_init(query, def_process) * elif scorer is jaro_winkler_similarity: */ - __Pyx_TraceLine(177,0,__PYX_ERR(0, 177, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_jaro_similarity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_jaro_similarity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":178 + /* "cpp_process.pyx":183 * context = cached_normalized_hamming_init(query, def_process) * elif scorer is jaro_similarity: * context = cached_jaro_similarity_init(query, def_process) # <<<<<<<<<<<<<< * elif scorer is jaro_winkler_similarity: * context = CachedJaroWinklerSimilarityInit(query, def_process, kwargs) */ - __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error)) + __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error)) try { __pyx_t_4 = cached_jaro_similarity_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 178, __pyx_L1_error) + __PYX_ERR(0, 183, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":177 + /* "cpp_process.pyx":182 * elif scorer is normalized_hamming: * context = cached_normalized_hamming_init(query, def_process) * elif scorer is jaro_similarity: # <<<<<<<<<<<<<< @@ -4716,32 +5380,32 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( goto __pyx_L3; } - /* "cpp_process.pyx":179 + /* "cpp_process.pyx":184 * elif scorer is jaro_similarity: * context = cached_jaro_similarity_init(query, def_process) * elif scorer is jaro_winkler_similarity: # <<<<<<<<<<<<<< * context = CachedJaroWinklerSimilarityInit(query, def_process, kwargs) * */ - __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_jaro_winkler_similarity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_jaro_winkler_similarity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":180 + /* "cpp_process.pyx":185 * context = cached_jaro_similarity_init(query, def_process) * elif scorer is jaro_winkler_similarity: * context = CachedJaroWinklerSimilarityInit(query, def_process, kwargs) # <<<<<<<<<<<<<< * * return move(context) */ - __Pyx_TraceLine(180,0,__PYX_ERR(0, 180, __pyx_L1_error)) + __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error)) __pyx_v_context = __pyx_f_11cpp_process_CachedJaroWinklerSimilarityInit(__pyx_v_query, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":179 + /* "cpp_process.pyx":184 * elif scorer is jaro_similarity: * context = cached_jaro_similarity_init(query, def_process) * elif scorer is jaro_winkler_similarity: # <<<<<<<<<<<<<< @@ -4751,18 +5415,18 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( } __pyx_L3:; - /* "cpp_process.pyx":182 + /* "cpp_process.pyx":187 * context = CachedJaroWinklerSimilarityInit(query, def_process, kwargs) * * return move(context) # <<<<<<<<<<<<<< * * cdef inline CachedDistanceContext CachedDistanceInit(object scorer, const proc_string& query, int def_process, dict kwargs): */ - __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error)) + __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) __pyx_r = cython_std::move(__pyx_v_context); goto __pyx_L0; - /* "cpp_process.pyx":150 + /* "cpp_process.pyx":155 * ) * * cdef inline CachedScorerContext CachedScorerInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -4781,7 +5445,7 @@ static CYTHON_INLINE CachedScorerContext __pyx_f_11cpp_process_CachedScorerInit( return __pyx_r; } -/* "cpp_process.pyx":184 +/* "cpp_process.pyx":189 * return move(context) * * cdef inline CachedDistanceContext CachedDistanceInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -4802,34 +5466,34 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedDistanceI const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("CachedDistanceInit", 0); - __Pyx_TraceCall("CachedDistanceInit", __pyx_f[0], 184, 0, __PYX_ERR(0, 184, __pyx_L1_error)); + __Pyx_TraceCall("CachedDistanceInit", __pyx_f[0], 189, 0, __PYX_ERR(0, 189, __pyx_L1_error)); - /* "cpp_process.pyx":187 + /* "cpp_process.pyx":192 * cdef CachedDistanceContext context * * if scorer is levenshtein: # <<<<<<<<<<<<<< * context = CachedLevenshteinInit(query, def_process, kwargs) * elif scorer is hamming: */ - __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_levenshtein); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_levenshtein); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":188 + /* "cpp_process.pyx":193 * * if scorer is levenshtein: * context = CachedLevenshteinInit(query, def_process, kwargs) # <<<<<<<<<<<<<< * elif scorer is hamming: * context = cached_hamming_init(query, def_process) */ - __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error)) + __Pyx_TraceLine(193,0,__PYX_ERR(0, 193, __pyx_L1_error)) __pyx_v_context = __pyx_f_11cpp_process_CachedLevenshteinInit(__pyx_v_query, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":187 + /* "cpp_process.pyx":192 * cdef CachedDistanceContext context * * if scorer is levenshtein: # <<<<<<<<<<<<<< @@ -4839,38 +5503,38 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedDistanceI goto __pyx_L3; } - /* "cpp_process.pyx":189 + /* "cpp_process.pyx":194 * if scorer is levenshtein: * context = CachedLevenshteinInit(query, def_process, kwargs) * elif scorer is hamming: # <<<<<<<<<<<<<< * context = cached_hamming_init(query, def_process) * */ - __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hamming); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hamming); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_scorer == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":190 + /* "cpp_process.pyx":195 * context = CachedLevenshteinInit(query, def_process, kwargs) * elif scorer is hamming: * context = cached_hamming_init(query, def_process) # <<<<<<<<<<<<<< * * return move(context) */ - __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error)) + __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error)) try { __pyx_t_4 = cached_hamming_init(__pyx_v_query, __pyx_v_def_process); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 195, __pyx_L1_error) } __pyx_v_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "cpp_process.pyx":189 + /* "cpp_process.pyx":194 * if scorer is levenshtein: * context = CachedLevenshteinInit(query, def_process, kwargs) * elif scorer is hamming: # <<<<<<<<<<<<<< @@ -4880,18 +5544,18 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedDistanceI } __pyx_L3:; - /* "cpp_process.pyx":192 + /* "cpp_process.pyx":197 * context = cached_hamming_init(query, def_process) * * return move(context) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error)) + __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error)) __pyx_r = cython_std::move(__pyx_v_context); goto __pyx_L0; - /* "cpp_process.pyx":184 + /* "cpp_process.pyx":189 * return move(context) * * cdef inline CachedDistanceContext CachedDistanceInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< @@ -4910,7 +5574,7 @@ static CYTHON_INLINE CachedDistanceContext __pyx_f_11cpp_process_CachedDistanceI return __pyx_r; } -/* "cpp_process.pyx":195 +/* "cpp_process.pyx":200 * * * cdef inline extractOne_dict(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< @@ -4945,66 +5609,66 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extractOne_dict", 0); - __Pyx_TraceCall("extractOne_dict", __pyx_f[0], 195, 0, __PYX_ERR(0, 195, __pyx_L1_error)); + __Pyx_TraceCall("extractOne_dict", __pyx_f[0], 200, 0, __PYX_ERR(0, 200, __pyx_L1_error)); - /* "cpp_process.pyx":203 + /* "cpp_process.pyx":208 * cdef double score * # use -1 as score, so even a score of 0 in the first iteration is higher * cdef double result_score = -1 # <<<<<<<<<<<<<< * result_choice = None * result_key = None */ - __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error)) + __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error)) __pyx_v_result_score = -1.0; - /* "cpp_process.pyx":204 + /* "cpp_process.pyx":209 * # use -1 as score, so even a score of 0 in the first iteration is higher * cdef double result_score = -1 * result_choice = None # <<<<<<<<<<<<<< * result_key = None * */ - __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error)) + __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":205 + /* "cpp_process.pyx":210 * cdef double result_score = -1 * result_choice = None * result_key = None # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(205,0,__PYX_ERR(0, 205, __pyx_L1_error)) + __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_key = Py_None; - /* "cpp_process.pyx":207 + /* "cpp_process.pyx":212 * result_key = None * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error)) + __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":208 + /* "cpp_process.pyx":213 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error)) + __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error)) __pyx_t_4 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 208, __pyx_L1_error) + __PYX_ERR(0, 213, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -5012,7 +5676,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 208, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_7); @@ -5020,29 +5684,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":209 + /* "cpp_process.pyx":214 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error)) + __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":210 + /* "cpp_process.pyx":215 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error)) + __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":209 + /* "cpp_process.pyx":214 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -5051,14 +5715,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore */ } - /* "cpp_process.pyx":212 + /* "cpp_process.pyx":217 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error)) + __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_7 = __pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -5076,36 +5740,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":213 + /* "cpp_process.pyx":218 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error)) + __Pyx_TraceLine(218,0,__PYX_ERR(0, 218, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":214 + /* "cpp_process.pyx":219 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) */ - __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error)) + __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":213 + /* "cpp_process.pyx":218 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -5114,31 +5778,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore */ } - /* "cpp_process.pyx":216 + /* "cpp_process.pyx":221 * continue * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_TraceLine(221,0,__PYX_ERR(0, 221, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 216, __pyx_L1_error) + __PYX_ERR(0, 221, __pyx_L1_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":218 + /* "cpp_process.pyx":223 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< * result_score = score_cutoff = score * result_choice = choice */ - __Pyx_TraceLine(218,0,__PYX_ERR(0, 218, __pyx_L1_error)) + __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_1) { } else { @@ -5150,61 +5814,61 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":219 + /* "cpp_process.pyx":224 * * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error)) + __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) __pyx_v_result_score = __pyx_v_score; __pyx_v_score_cutoff = __pyx_v_score; - /* "cpp_process.pyx":220 + /* "cpp_process.pyx":225 * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(220,0,__PYX_ERR(0, 220, __pyx_L1_error)) + __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":221 + /* "cpp_process.pyx":226 * result_score = score_cutoff = score * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if result_score == 100: */ - __Pyx_TraceLine(221,0,__PYX_ERR(0, 221, __pyx_L1_error)) + __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":223 + /* "cpp_process.pyx":228 * result_key = choice_key * * if result_score == 100: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error)) + __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_result_score == 100.0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":224 + /* "cpp_process.pyx":229 * * if result_score == 100: * break # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error)) + __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":223 + /* "cpp_process.pyx":228 * result_key = choice_key * * if result_score == 100: # <<<<<<<<<<<<<< @@ -5213,7 +5877,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore */ } - /* "cpp_process.pyx":218 + /* "cpp_process.pyx":223 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< @@ -5226,7 +5890,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __pyx_L5_break:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":207 + /* "cpp_process.pyx":212 * result_key = None * * if processor is not None: # <<<<<<<<<<<<<< @@ -5236,21 +5900,21 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore goto __pyx_L3; } - /* "cpp_process.pyx":226 + /* "cpp_process.pyx":231 * break * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error)) + __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 226, __pyx_L1_error) + __PYX_ERR(0, 231, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_8; @@ -5258,7 +5922,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -5266,29 +5930,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":227 + /* "cpp_process.pyx":232 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(227,0,__PYX_ERR(0, 227, __pyx_L1_error)) + __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":228 + /* "cpp_process.pyx":233 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(choice), score_cutoff) */ - __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error)) + __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":227 + /* "cpp_process.pyx":232 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -5297,31 +5961,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore */ } - /* "cpp_process.pyx":230 + /* "cpp_process.pyx":235 * continue * * score = context.ratio(conv_sequence(choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 230, __pyx_L1_error) + __PYX_ERR(0, 235, __pyx_L1_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":232 + /* "cpp_process.pyx":237 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< * result_score = score_cutoff = score * result_choice = choice */ - __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error)) + __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_2) { } else { @@ -5333,61 +5997,61 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __pyx_L16_bool_binop_done:; if (__pyx_t_1) { - /* "cpp_process.pyx":233 + /* "cpp_process.pyx":238 * * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error)) + __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error)) __pyx_v_result_score = __pyx_v_score; __pyx_v_score_cutoff = __pyx_v_score; - /* "cpp_process.pyx":234 + /* "cpp_process.pyx":239 * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(234,0,__PYX_ERR(0, 234, __pyx_L1_error)) + __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":235 + /* "cpp_process.pyx":240 * result_score = score_cutoff = score * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if result_score == 100: */ - __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error)) + __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":237 + /* "cpp_process.pyx":242 * result_key = choice_key * * if result_score == 100: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error)) + __Pyx_TraceLine(242,0,__PYX_ERR(0, 242, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_result_score == 100.0) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":238 + /* "cpp_process.pyx":243 * * if result_score == 100: * break # <<<<<<<<<<<<<< * * return (result_choice, result_score, result_key) if result_choice is not None else None */ - __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error)) + __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error)) goto __pyx_L13_break; - /* "cpp_process.pyx":237 + /* "cpp_process.pyx":242 * result_key = choice_key * * if result_score == 100: # <<<<<<<<<<<<<< @@ -5396,7 +6060,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore */ } - /* "cpp_process.pyx":232 + /* "cpp_process.pyx":237 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< @@ -5411,20 +6075,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore } __pyx_L3:; - /* "cpp_process.pyx":240 + /* "cpp_process.pyx":245 * break * * return (result_choice, result_score, result_key) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(240,0,__PYX_ERR(0, 240, __pyx_L1_error)) + __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_1 != 0)) { - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_result_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_result_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -5445,7 +6109,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":195 + /* "cpp_process.pyx":200 * * * cdef inline extractOne_dict(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< @@ -5473,7 +6137,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_dict(CachedScore return __pyx_r; } -/* "cpp_process.pyx":243 +/* "cpp_process.pyx":248 * * * cdef inline extractOne_distance_dict(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< @@ -5508,66 +6172,66 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extractOne_distance_dict", 0); - __Pyx_TraceCall("extractOne_distance_dict", __pyx_f[0], 243, 0, __PYX_ERR(0, 243, __pyx_L1_error)); + __Pyx_TraceCall("extractOne_distance_dict", __pyx_f[0], 248, 0, __PYX_ERR(0, 248, __pyx_L1_error)); - /* "cpp_process.pyx":250 + /* "cpp_process.pyx":255 * """ * cdef size_t distance * cdef size_t result_distance = -1 # <<<<<<<<<<<<<< * result_choice = None * result_key = None */ - __Pyx_TraceLine(250,0,__PYX_ERR(0, 250, __pyx_L1_error)) + __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error)) __pyx_v_result_distance = ((size_t)-1L); - /* "cpp_process.pyx":251 + /* "cpp_process.pyx":256 * cdef size_t distance * cdef size_t result_distance = -1 * result_choice = None # <<<<<<<<<<<<<< * result_key = None * */ - __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error)) + __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":252 + /* "cpp_process.pyx":257 * cdef size_t result_distance = -1 * result_choice = None * result_key = None # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error)) + __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_key = Py_None; - /* "cpp_process.pyx":254 + /* "cpp_process.pyx":259 * result_key = None * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(254,0,__PYX_ERR(0, 254, __pyx_L1_error)) + __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":255 + /* "cpp_process.pyx":260 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error)) + __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) __pyx_t_4 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 255, __pyx_L1_error) + __PYX_ERR(0, 260, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -5575,7 +6239,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_7); @@ -5583,29 +6247,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":256 + /* "cpp_process.pyx":261 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error)) + __Pyx_TraceLine(261,0,__PYX_ERR(0, 261, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":257 + /* "cpp_process.pyx":262 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error)) + __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":256 + /* "cpp_process.pyx":261 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -5614,14 +6278,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca */ } - /* "cpp_process.pyx":259 + /* "cpp_process.pyx":264 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error)) + __Pyx_TraceLine(264,0,__PYX_ERR(0, 264, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_7 = __pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -5639,36 +6303,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":260 + /* "cpp_process.pyx":265 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error)) + __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":261 + /* "cpp_process.pyx":266 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(proc_choice), max_) */ - __Pyx_TraceLine(261,0,__PYX_ERR(0, 261, __pyx_L1_error)) + __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":260 + /* "cpp_process.pyx":265 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -5677,31 +6341,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca */ } - /* "cpp_process.pyx":263 + /* "cpp_process.pyx":268 * continue * * distance = context.ratio(conv_sequence(proc_choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_ and distance < result_distance: */ - __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 263, __pyx_L1_error) + __PYX_ERR(0, 268, __pyx_L1_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":265 + /* "cpp_process.pyx":270 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< * result_distance = max_ = distance * result_choice = choice */ - __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error)) + __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_1) { } else { @@ -5713,61 +6377,61 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":266 + /* "cpp_process.pyx":271 * * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error)) + __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error)) __pyx_v_result_distance = __pyx_v_distance; __pyx_v_max_ = __pyx_v_distance; - /* "cpp_process.pyx":267 + /* "cpp_process.pyx":272 * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error)) + __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":268 + /* "cpp_process.pyx":273 * result_distance = max_ = distance * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if result_distance == 0: */ - __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error)) + __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":270 + /* "cpp_process.pyx":275 * result_key = choice_key * * if result_distance == 0: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(270,0,__PYX_ERR(0, 270, __pyx_L1_error)) + __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_result_distance == 0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":271 + /* "cpp_process.pyx":276 * * if result_distance == 0: * break # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error)) + __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":270 + /* "cpp_process.pyx":275 * result_key = choice_key * * if result_distance == 0: # <<<<<<<<<<<<<< @@ -5776,7 +6440,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca */ } - /* "cpp_process.pyx":265 + /* "cpp_process.pyx":270 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< @@ -5789,7 +6453,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __pyx_L5_break:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":254 + /* "cpp_process.pyx":259 * result_key = None * * if processor is not None: # <<<<<<<<<<<<<< @@ -5799,21 +6463,21 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca goto __pyx_L3; } - /* "cpp_process.pyx":273 + /* "cpp_process.pyx":278 * break * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(273,0,__PYX_ERR(0, 273, __pyx_L1_error)) + __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 273, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_8; @@ -5821,7 +6485,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -5829,29 +6493,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":274 + /* "cpp_process.pyx":279 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error)) + __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":275 + /* "cpp_process.pyx":280 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(choice), max_) */ - __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error)) + __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":274 + /* "cpp_process.pyx":279 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -5860,31 +6524,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca */ } - /* "cpp_process.pyx":277 + /* "cpp_process.pyx":282 * continue * * distance = context.ratio(conv_sequence(choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_ and distance < result_distance: */ - __Pyx_TraceLine(277,0,__PYX_ERR(0, 277, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":279 + /* "cpp_process.pyx":284 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< * result_distance = max_ = distance * result_choice = choice */ - __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error)) + __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_2) { } else { @@ -5896,61 +6560,61 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __pyx_L16_bool_binop_done:; if (__pyx_t_1) { - /* "cpp_process.pyx":280 + /* "cpp_process.pyx":285 * * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error)) + __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) __pyx_v_result_distance = __pyx_v_distance; __pyx_v_max_ = __pyx_v_distance; - /* "cpp_process.pyx":281 + /* "cpp_process.pyx":286 * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error)) + __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":282 + /* "cpp_process.pyx":287 * result_distance = max_ = distance * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if result_distance == 0: */ - __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error)) + __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":284 + /* "cpp_process.pyx":289 * result_key = choice_key * * if result_distance == 0: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error)) + __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_result_distance == 0) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":285 + /* "cpp_process.pyx":290 * * if result_distance == 0: * break # <<<<<<<<<<<<<< * * return (result_choice, result_distance, result_key) if result_choice is not None else None */ - __Pyx_TraceLine(285,0,__PYX_ERR(0, 285, __pyx_L1_error)) + __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error)) goto __pyx_L13_break; - /* "cpp_process.pyx":284 + /* "cpp_process.pyx":289 * result_key = choice_key * * if result_distance == 0: # <<<<<<<<<<<<<< @@ -5959,7 +6623,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca */ } - /* "cpp_process.pyx":279 + /* "cpp_process.pyx":284 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< @@ -5974,20 +6638,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca } __pyx_L3:; - /* "cpp_process.pyx":287 + /* "cpp_process.pyx":292 * break * * return (result_choice, result_distance, result_key) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error)) + __Pyx_TraceLine(292,0,__PYX_ERR(0, 292, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_1 != 0)) { - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_result_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_result_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -6008,7 +6672,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":243 + /* "cpp_process.pyx":248 * * * cdef inline extractOne_distance_dict(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< @@ -6036,7 +6700,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_dict(Ca return __pyx_r; } -/* "cpp_process.pyx":290 +/* "cpp_process.pyx":295 * * * cdef inline extractOne_list(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< @@ -6071,94 +6735,94 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extractOne_list", 0); - __Pyx_TraceCall("extractOne_list", __pyx_f[0], 290, 0, __PYX_ERR(0, 290, __pyx_L1_error)); + __Pyx_TraceCall("extractOne_list", __pyx_f[0], 295, 0, __PYX_ERR(0, 295, __pyx_L1_error)); - /* "cpp_process.pyx":296 + /* "cpp_process.pyx":301 * - scorer = normalized scorer implemented in C++ * """ * cdef double score = 0.0 # <<<<<<<<<<<<<< * # use -1 as score, so even a score of 0 in the first iteration is higher * cdef double result_score = -1 */ - __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error)) + __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error)) __pyx_v_score = 0.0; - /* "cpp_process.pyx":298 + /* "cpp_process.pyx":303 * cdef double score = 0.0 * # use -1 as score, so even a score of 0 in the first iteration is higher * cdef double result_score = -1 # <<<<<<<<<<<<<< * cdef size_t i * cdef size_t result_index = 0 */ - __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error)) + __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) __pyx_v_result_score = -1.0; - /* "cpp_process.pyx":300 + /* "cpp_process.pyx":305 * cdef double result_score = -1 * cdef size_t i * cdef size_t result_index = 0 # <<<<<<<<<<<<<< * result_choice = None * */ - __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error)) + __Pyx_TraceLine(305,0,__PYX_ERR(0, 305, __pyx_L1_error)) __pyx_v_result_index = 0; - /* "cpp_process.pyx":301 + /* "cpp_process.pyx":306 * cdef size_t i * cdef size_t result_index = 0 * result_choice = None # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error)) + __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":303 + /* "cpp_process.pyx":308 * result_choice = None * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error)) + __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":304 + /* "cpp_process.pyx":309 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) + __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -6168,7 +6832,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 304, __pyx_L1_error) + else __PYX_ERR(0, 309, __pyx_L1_error) } break; } @@ -6179,29 +6843,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":305 + /* "cpp_process.pyx":310 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(305,0,__PYX_ERR(0, 305, __pyx_L1_error)) + __Pyx_TraceLine(310,0,__PYX_ERR(0, 310, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":306 + /* "cpp_process.pyx":311 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error)) + __Pyx_TraceLine(311,0,__PYX_ERR(0, 311, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":305 + /* "cpp_process.pyx":310 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -6210,14 +6874,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":308 + /* "cpp_process.pyx":313 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error)) + __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -6235,36 +6899,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":309 + /* "cpp_process.pyx":314 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) + __Pyx_TraceLine(314,0,__PYX_ERR(0, 314, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":310 + /* "cpp_process.pyx":315 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) */ - __Pyx_TraceLine(310,0,__PYX_ERR(0, 310, __pyx_L1_error)) + __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":309 + /* "cpp_process.pyx":314 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -6273,31 +6937,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":312 + /* "cpp_process.pyx":317 * continue * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 312, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":314 + /* "cpp_process.pyx":319 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< * result_score = score_cutoff = score * result_choice = choice */ - __Pyx_TraceLine(314,0,__PYX_ERR(0, 314, __pyx_L1_error)) + __Pyx_TraceLine(319,0,__PYX_ERR(0, 319, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_1) { } else { @@ -6309,60 +6973,60 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":315 + /* "cpp_process.pyx":320 * * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error)) + __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error)) __pyx_v_result_score = __pyx_v_score; __pyx_v_score_cutoff = __pyx_v_score; - /* "cpp_process.pyx":316 + /* "cpp_process.pyx":321 * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error)) + __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":317 + /* "cpp_process.pyx":322 * result_score = score_cutoff = score * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if result_score == 100: */ - __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error)) + __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":319 + /* "cpp_process.pyx":324 * result_index = i * * if result_score == 100: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(319,0,__PYX_ERR(0, 319, __pyx_L1_error)) + __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_result_score == 100.0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":320 + /* "cpp_process.pyx":325 * * if result_score == 100: * break # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error)) + __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":319 + /* "cpp_process.pyx":324 * result_index = i * * if result_score == 100: # <<<<<<<<<<<<<< @@ -6371,7 +7035,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":314 + /* "cpp_process.pyx":319 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< @@ -6380,20 +7044,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":304 + /* "cpp_process.pyx":309 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error)) + __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error)) __pyx_L4_continue:; } __pyx_L5_break:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpp_process.pyx":303 + /* "cpp_process.pyx":308 * result_choice = None * * if processor is not None: # <<<<<<<<<<<<<< @@ -6403,40 +7067,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore goto __pyx_L3; } - /* "cpp_process.pyx":322 + /* "cpp_process.pyx":327 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error)) + __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error)) /*else*/ { __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -6446,7 +7110,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 322, __pyx_L1_error) + else __PYX_ERR(0, 327, __pyx_L1_error) } break; } @@ -6457,29 +7121,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":323 + /* "cpp_process.pyx":328 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error)) + __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":324 + /* "cpp_process.pyx":329 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(choice), score_cutoff) */ - __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error)) + __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":323 + /* "cpp_process.pyx":328 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -6488,31 +7152,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":326 + /* "cpp_process.pyx":331 * continue * * score = context.ratio(conv_sequence(choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 326, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":328 + /* "cpp_process.pyx":333 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< * result_score = score_cutoff = score * result_choice = choice */ - __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error)) + __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_2) { } else { @@ -6524,60 +7188,60 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore __pyx_L16_bool_binop_done:; if (__pyx_t_1) { - /* "cpp_process.pyx":329 + /* "cpp_process.pyx":334 * * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error)) + __Pyx_TraceLine(334,0,__PYX_ERR(0, 334, __pyx_L1_error)) __pyx_v_result_score = __pyx_v_score; __pyx_v_score_cutoff = __pyx_v_score; - /* "cpp_process.pyx":330 + /* "cpp_process.pyx":335 * if score >= score_cutoff and score > result_score: * result_score = score_cutoff = score * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error)) + __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":331 + /* "cpp_process.pyx":336 * result_score = score_cutoff = score * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if result_score == 100: */ - __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error)) + __Pyx_TraceLine(336,0,__PYX_ERR(0, 336, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":333 + /* "cpp_process.pyx":338 * result_index = i * * if result_score == 100: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error)) + __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_result_score == 100.0) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":334 + /* "cpp_process.pyx":339 * * if result_score == 100: * break # <<<<<<<<<<<<<< * * return (result_choice, result_score, result_index) if result_choice is not None else None */ - __Pyx_TraceLine(334,0,__PYX_ERR(0, 334, __pyx_L1_error)) + __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) goto __pyx_L13_break; - /* "cpp_process.pyx":333 + /* "cpp_process.pyx":338 * result_index = i * * if result_score == 100: # <<<<<<<<<<<<<< @@ -6586,7 +7250,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":328 + /* "cpp_process.pyx":333 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< @@ -6595,14 +7259,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore */ } - /* "cpp_process.pyx":322 + /* "cpp_process.pyx":327 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error)) + __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error)) __pyx_L12_continue:; } __pyx_L13_break:; @@ -6610,22 +7274,22 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore } __pyx_L3:; - /* "cpp_process.pyx":336 + /* "cpp_process.pyx":341 * break * * return (result_choice, result_score, result_index) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(336,0,__PYX_ERR(0, 336, __pyx_L1_error)) + __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_1 != 0)) { - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_result_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_result_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -6646,7 +7310,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore __pyx_t_4 = 0; goto __pyx_L0; - /* "cpp_process.pyx":290 + /* "cpp_process.pyx":295 * * * cdef inline extractOne_list(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< @@ -6672,7 +7336,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_list(CachedScore return __pyx_r; } -/* "cpp_process.pyx":339 +/* "cpp_process.pyx":344 * * * cdef inline extractOne_distance_list(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< @@ -6707,84 +7371,84 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extractOne_distance_list", 0); - __Pyx_TraceCall("extractOne_distance_list", __pyx_f[0], 339, 0, __PYX_ERR(0, 339, __pyx_L1_error)); + __Pyx_TraceCall("extractOne_distance_list", __pyx_f[0], 344, 0, __PYX_ERR(0, 344, __pyx_L1_error)); - /* "cpp_process.pyx":346 + /* "cpp_process.pyx":351 * """ * cdef size_t distance * cdef size_t result_distance = -1 # <<<<<<<<<<<<<< * cdef size_t i * cdef size_t result_index = 0 */ - __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error)) + __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error)) __pyx_v_result_distance = ((size_t)-1L); - /* "cpp_process.pyx":348 + /* "cpp_process.pyx":353 * cdef size_t result_distance = -1 * cdef size_t i * cdef size_t result_index = 0 # <<<<<<<<<<<<<< * result_choice = None * */ - __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error)) + __Pyx_TraceLine(353,0,__PYX_ERR(0, 353, __pyx_L1_error)) __pyx_v_result_index = 0; - /* "cpp_process.pyx":349 + /* "cpp_process.pyx":354 * cdef size_t i * cdef size_t result_index = 0 * result_choice = None # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(349,0,__PYX_ERR(0, 349, __pyx_L1_error)) + __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":351 + /* "cpp_process.pyx":356 * result_choice = None * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error)) + __Pyx_TraceLine(356,0,__PYX_ERR(0, 356, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":352 + /* "cpp_process.pyx":357 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(352,0,__PYX_ERR(0, 352, __pyx_L1_error)) + __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error)) __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -6794,7 +7458,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 352, __pyx_L1_error) + else __PYX_ERR(0, 357, __pyx_L1_error) } break; } @@ -6805,29 +7469,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":353 + /* "cpp_process.pyx":358 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(353,0,__PYX_ERR(0, 353, __pyx_L1_error)) + __Pyx_TraceLine(358,0,__PYX_ERR(0, 358, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":354 + /* "cpp_process.pyx":359 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error)) + __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":353 + /* "cpp_process.pyx":358 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -6836,14 +7500,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":356 + /* "cpp_process.pyx":361 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(356,0,__PYX_ERR(0, 356, __pyx_L1_error)) + __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -6861,36 +7525,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":357 + /* "cpp_process.pyx":362 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error)) + __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":358 + /* "cpp_process.pyx":363 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(proc_choice), max_) */ - __Pyx_TraceLine(358,0,__PYX_ERR(0, 358, __pyx_L1_error)) + __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":357 + /* "cpp_process.pyx":362 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -6899,31 +7563,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":360 + /* "cpp_process.pyx":365 * continue * * distance = context.ratio(conv_sequence(proc_choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_ and distance < result_distance: */ - __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 360, __pyx_L1_error) + __PYX_ERR(0, 365, __pyx_L1_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":362 + /* "cpp_process.pyx":367 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< * result_distance = max_ = distance * result_choice = choice */ - __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error)) + __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_1) { } else { @@ -6935,60 +7599,60 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca __pyx_L9_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":363 + /* "cpp_process.pyx":368 * * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error)) + __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error)) __pyx_v_result_distance = __pyx_v_distance; __pyx_v_max_ = __pyx_v_distance; - /* "cpp_process.pyx":364 + /* "cpp_process.pyx":369 * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(364,0,__PYX_ERR(0, 364, __pyx_L1_error)) + __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":365 + /* "cpp_process.pyx":370 * result_distance = max_ = distance * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if result_distance == 0: */ - __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error)) + __Pyx_TraceLine(370,0,__PYX_ERR(0, 370, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":367 + /* "cpp_process.pyx":372 * result_index = i * * if result_distance == 0: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(367,0,__PYX_ERR(0, 367, __pyx_L1_error)) + __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_result_distance == 0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":368 + /* "cpp_process.pyx":373 * * if result_distance == 0: * break # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error)) + __Pyx_TraceLine(373,0,__PYX_ERR(0, 373, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":367 + /* "cpp_process.pyx":372 * result_index = i * * if result_distance == 0: # <<<<<<<<<<<<<< @@ -6997,7 +7661,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":362 + /* "cpp_process.pyx":367 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< @@ -7006,20 +7670,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":352 + /* "cpp_process.pyx":357 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(352,0,__PYX_ERR(0, 352, __pyx_L1_error)) + __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error)) __pyx_L4_continue:; } __pyx_L5_break:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpp_process.pyx":351 + /* "cpp_process.pyx":356 * result_choice = None * * if processor is not None: # <<<<<<<<<<<<<< @@ -7029,40 +7693,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca goto __pyx_L3; } - /* "cpp_process.pyx":370 + /* "cpp_process.pyx":375 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(370,0,__PYX_ERR(0, 370, __pyx_L1_error)) + __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) /*else*/ { __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -7072,7 +7736,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 370, __pyx_L1_error) + else __PYX_ERR(0, 375, __pyx_L1_error) } break; } @@ -7083,29 +7747,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":371 + /* "cpp_process.pyx":376 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error)) + __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":372 + /* "cpp_process.pyx":377 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(choice), max_) */ - __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error)) + __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":371 + /* "cpp_process.pyx":376 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -7114,31 +7778,31 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":374 + /* "cpp_process.pyx":379 * continue * * distance = context.ratio(conv_sequence(choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_ and distance < result_distance: */ - __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 374, __pyx_L1_error) + __PYX_ERR(0, 379, __pyx_L1_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":376 + /* "cpp_process.pyx":381 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< * result_distance = max_ = distance * result_choice = choice */ - __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error)) + __Pyx_TraceLine(381,0,__PYX_ERR(0, 381, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_2) { } else { @@ -7150,60 +7814,60 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca __pyx_L16_bool_binop_done:; if (__pyx_t_1) { - /* "cpp_process.pyx":377 + /* "cpp_process.pyx":382 * * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error)) + __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) __pyx_v_result_distance = __pyx_v_distance; __pyx_v_max_ = __pyx_v_distance; - /* "cpp_process.pyx":378 + /* "cpp_process.pyx":383 * if distance <= max_ and distance < result_distance: * result_distance = max_ = distance * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error)) + __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":379 + /* "cpp_process.pyx":384 * result_distance = max_ = distance * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if result_distance == 0: */ - __Pyx_TraceLine(379,0,__PYX_ERR(0, 379, __pyx_L1_error)) + __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":381 + /* "cpp_process.pyx":386 * result_index = i * * if result_distance == 0: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(381,0,__PYX_ERR(0, 381, __pyx_L1_error)) + __Pyx_TraceLine(386,0,__PYX_ERR(0, 386, __pyx_L1_error)) __pyx_t_1 = ((__pyx_v_result_distance == 0) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":382 + /* "cpp_process.pyx":387 * * if result_distance == 0: * break # <<<<<<<<<<<<<< * * return (result_choice, result_distance, result_index) if result_choice is not None else None */ - __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error)) + __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error)) goto __pyx_L13_break; - /* "cpp_process.pyx":381 + /* "cpp_process.pyx":386 * result_index = i * * if result_distance == 0: # <<<<<<<<<<<<<< @@ -7212,7 +7876,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":376 + /* "cpp_process.pyx":381 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_ and distance < result_distance: # <<<<<<<<<<<<<< @@ -7221,14 +7885,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca */ } - /* "cpp_process.pyx":370 + /* "cpp_process.pyx":375 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(370,0,__PYX_ERR(0, 370, __pyx_L1_error)) + __Pyx_TraceLine(375,0,__PYX_ERR(0, 375, __pyx_L1_error)) __pyx_L12_continue:; } __pyx_L13_break:; @@ -7236,22 +7900,22 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca } __pyx_L3:; - /* "cpp_process.pyx":384 + /* "cpp_process.pyx":389 * break * * return (result_choice, result_distance, result_index) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error)) + __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_1 != 0)) { - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_result_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_result_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -7272,7 +7936,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca __pyx_t_4 = 0; goto __pyx_L0; - /* "cpp_process.pyx":339 + /* "cpp_process.pyx":344 * * * cdef inline extractOne_distance_list(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< @@ -7298,7 +7962,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extractOne_distance_list(Ca return __pyx_r; } -/* "cpp_process.pyx":387 +/* "cpp_process.pyx":392 * * * cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -7331,98 +7995,98 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("py_extractOne_dict", 0); - __Pyx_TraceCall("py_extractOne_dict", __pyx_f[0], 387, 0, __PYX_ERR(0, 387, __pyx_L1_error)); + __Pyx_TraceCall("py_extractOne_dict", __pyx_f[0], 392, 0, __PYX_ERR(0, 392, __pyx_L1_error)); - /* "cpp_process.pyx":388 + /* "cpp_process.pyx":393 * * cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_cutoff, dict kwargs): * result_score = -1 # <<<<<<<<<<<<<< * result_choice = None * result_key = None */ - __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error)) + __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error)) __Pyx_INCREF(__pyx_int_neg_1); __pyx_v_result_score = __pyx_int_neg_1; - /* "cpp_process.pyx":389 + /* "cpp_process.pyx":394 * cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_cutoff, dict kwargs): * result_score = -1 * result_choice = None # <<<<<<<<<<<<<< * result_key = None * */ - __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error)) + __Pyx_TraceLine(394,0,__PYX_ERR(0, 394, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":390 + /* "cpp_process.pyx":395 * result_score = -1 * result_choice = None * result_key = None # <<<<<<<<<<<<<< * * kwargs["processor"] = None */ - __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error)) + __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_key = Py_None; - /* "cpp_process.pyx":392 + /* "cpp_process.pyx":397 * result_key = None * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = score_cutoff * */ - __Pyx_TraceLine(392,0,__PYX_ERR(0, 392, __pyx_L1_error)) + __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 392, __pyx_L1_error) + __PYX_ERR(0, 397, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 392, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 397, __pyx_L1_error) - /* "cpp_process.pyx":393 + /* "cpp_process.pyx":398 * * kwargs["processor"] = None * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 393, __pyx_L1_error) + __PYX_ERR(0, 398, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":395 + /* "cpp_process.pyx":400 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(395,0,__PYX_ERR(0, 395, __pyx_L1_error)) + __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":396 + /* "cpp_process.pyx":401 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error)) + __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error)) __pyx_t_4 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 396, __pyx_L1_error) + __PYX_ERR(0, 401, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; @@ -7430,7 +8094,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_7); @@ -7438,29 +8102,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":397 + /* "cpp_process.pyx":402 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error)) + __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":398 + /* "cpp_process.pyx":403 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(398,0,__PYX_ERR(0, 398, __pyx_L1_error)) + __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":397 + /* "cpp_process.pyx":402 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -7469,14 +8133,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject */ } - /* "cpp_process.pyx":400 + /* "cpp_process.pyx":405 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error)) + __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_7 = __pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -7494,11 +8158,11 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -7508,126 +8172,123 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject __pyx_t_8 = 0; if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 400, __pyx_L1_error) + __PYX_ERR(0, 405, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":402 + /* "cpp_process.pyx":407 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ - __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 402, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":403 + /* "cpp_process.pyx":408 * * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< - * score_cutoff = score + * score_cutoff = score # <<<<<<<<<<<<<< + * kwargs["score_cutoff"] = score * result_score = score */ - __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 403, __pyx_L1_error) - } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_8) < 0))) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error)) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_v_score_cutoff = __pyx_t_11; - /* "cpp_process.pyx":404 + /* "cpp_process.pyx":409 * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff - * score_cutoff = score # <<<<<<<<<<<<<< + * score_cutoff = score + * kwargs["score_cutoff"] = score # <<<<<<<<<<<<<< * result_score = score * result_choice = choice */ - __Pyx_TraceLine(404,0,__PYX_ERR(0, 404, __pyx_L1_error)) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) - __pyx_v_score_cutoff = __pyx_t_11; + __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 409, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_v_score) < 0))) __PYX_ERR(0, 409, __pyx_L1_error) - /* "cpp_process.pyx":405 - * kwargs["score_cutoff"] = score_cutoff + /* "cpp_process.pyx":410 * score_cutoff = score + * kwargs["score_cutoff"] = score * result_score = score # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error)) + __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_score); __Pyx_DECREF_SET(__pyx_v_result_score, __pyx_v_score); - /* "cpp_process.pyx":406 - * score_cutoff = score + /* "cpp_process.pyx":411 + * kwargs["score_cutoff"] = score * result_score = score * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(406,0,__PYX_ERR(0, 406, __pyx_L1_error)) + __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":407 + /* "cpp_process.pyx":412 * result_score = score * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if score_cutoff == 100: */ - __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error)) + __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":409 + /* "cpp_process.pyx":414 * result_key = choice_key * * if score_cutoff == 100: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error)) + __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_score_cutoff == 100.0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":410 + /* "cpp_process.pyx":415 * * if score_cutoff == 100: * break # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error)) + __Pyx_TraceLine(415,0,__PYX_ERR(0, 415, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":409 + /* "cpp_process.pyx":414 * result_key = choice_key * * if score_cutoff == 100: # <<<<<<<<<<<<<< @@ -7636,12 +8297,12 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject */ } - /* "cpp_process.pyx":402 + /* "cpp_process.pyx":407 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ } __pyx_L4_continue:; @@ -7649,7 +8310,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject __pyx_L5_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":395 + /* "cpp_process.pyx":400 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -7659,21 +8320,21 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject goto __pyx_L3; } - /* "cpp_process.pyx":412 + /* "cpp_process.pyx":417 * break * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error)) + __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 412, __pyx_L1_error) + __PYX_ERR(0, 417, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_8; @@ -7681,7 +8342,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_10, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -7689,29 +8350,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":413 + /* "cpp_process.pyx":418 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error)) + __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":414 + /* "cpp_process.pyx":419 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error)) + __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":413 + /* "cpp_process.pyx":418 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -7720,15 +8381,15 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject */ } - /* "cpp_process.pyx":416 + /* "cpp_process.pyx":421 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -7738,126 +8399,123 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_choice); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 421, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":418 + /* "cpp_process.pyx":423 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ - __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_3) { - /* "cpp_process.pyx":419 + /* "cpp_process.pyx":424 * * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< - * score_cutoff = score + * score_cutoff = score # <<<<<<<<<<<<<< + * kwargs["score_cutoff"] = score * result_score = score */ - __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 419, __pyx_L1_error) - } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_8) < 0))) __PYX_ERR(0, 419, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error)) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_v_score_cutoff = __pyx_t_11; - /* "cpp_process.pyx":420 + /* "cpp_process.pyx":425 * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff - * score_cutoff = score # <<<<<<<<<<<<<< + * score_cutoff = score + * kwargs["score_cutoff"] = score # <<<<<<<<<<<<<< * result_score = score * result_choice = choice */ - __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error)) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_v_score_cutoff = __pyx_t_11; + __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 425, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_v_score) < 0))) __PYX_ERR(0, 425, __pyx_L1_error) - /* "cpp_process.pyx":421 - * kwargs["score_cutoff"] = score_cutoff + /* "cpp_process.pyx":426 * score_cutoff = score + * kwargs["score_cutoff"] = score * result_score = score # <<<<<<<<<<<<<< * result_choice = choice * result_key = choice_key */ - __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error)) + __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_score); __Pyx_DECREF_SET(__pyx_v_result_score, __pyx_v_score); - /* "cpp_process.pyx":422 - * score_cutoff = score + /* "cpp_process.pyx":427 + * kwargs["score_cutoff"] = score * result_score = score * result_choice = choice # <<<<<<<<<<<<<< * result_key = choice_key * */ - __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error)) + __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":423 + /* "cpp_process.pyx":428 * result_score = score * result_choice = choice * result_key = choice_key # <<<<<<<<<<<<<< * * if score_cutoff == 100: */ - __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error)) + __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice_key); __Pyx_DECREF_SET(__pyx_v_result_key, __pyx_v_choice_key); - /* "cpp_process.pyx":425 + /* "cpp_process.pyx":430 * result_key = choice_key * * if score_cutoff == 100: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error)) + __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error)) __pyx_t_3 = ((__pyx_v_score_cutoff == 100.0) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":426 + /* "cpp_process.pyx":431 * * if score_cutoff == 100: * break # <<<<<<<<<<<<<< * * return (result_choice, result_score, result_key) if result_choice is not None else None */ - __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error)) + __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) goto __pyx_L12_break; - /* "cpp_process.pyx":425 + /* "cpp_process.pyx":430 * result_key = choice_key * * if score_cutoff == 100: # <<<<<<<<<<<<<< @@ -7866,12 +8524,12 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject */ } - /* "cpp_process.pyx":418 + /* "cpp_process.pyx":423 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ } __pyx_L11_continue:; @@ -7881,18 +8539,18 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject } __pyx_L3:; - /* "cpp_process.pyx":428 + /* "cpp_process.pyx":433 * break * * return (result_choice, result_score, result_key) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error)) + __Pyx_TraceLine(433,0,__PYX_ERR(0, 433, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_3 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_3 != 0)) { - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -7913,7 +8571,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "cpp_process.pyx":387 + /* "cpp_process.pyx":392 * * * cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -7942,7 +8600,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_dict(PyObject return __pyx_r; } -/* "cpp_process.pyx":431 +/* "cpp_process.pyx":436 * * * cdef inline py_extractOne_list(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -7975,116 +8633,116 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("py_extractOne_list", 0); - __Pyx_TraceCall("py_extractOne_list", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error)); + __Pyx_TraceCall("py_extractOne_list", __pyx_f[0], 436, 0, __PYX_ERR(0, 436, __pyx_L1_error)); - /* "cpp_process.pyx":432 + /* "cpp_process.pyx":437 * * cdef inline py_extractOne_list(query, choices, scorer, processor, double score_cutoff, dict kwargs): * cdef size_t result_index = 0 # <<<<<<<<<<<<<< * cdef size_t i * result_score = -1 */ - __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error)) + __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error)) __pyx_v_result_index = 0; - /* "cpp_process.pyx":434 + /* "cpp_process.pyx":439 * cdef size_t result_index = 0 * cdef size_t i * result_score = -1 # <<<<<<<<<<<<<< * result_choice = None * */ - __Pyx_TraceLine(434,0,__PYX_ERR(0, 434, __pyx_L1_error)) + __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error)) __Pyx_INCREF(__pyx_int_neg_1); __pyx_v_result_score = __pyx_int_neg_1; - /* "cpp_process.pyx":435 + /* "cpp_process.pyx":440 * cdef size_t i * result_score = -1 * result_choice = None # <<<<<<<<<<<<<< * * kwargs["processor"] = None */ - __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error)) + __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_result_choice = Py_None; - /* "cpp_process.pyx":437 + /* "cpp_process.pyx":442 * result_choice = None * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = score_cutoff * */ - __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error)) + __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 437, __pyx_L1_error) + __PYX_ERR(0, 442, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 437, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 442, __pyx_L1_error) - /* "cpp_process.pyx":438 + /* "cpp_process.pyx":443 * * kwargs["processor"] = None * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(438,0,__PYX_ERR(0, 438, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_TraceLine(443,0,__PYX_ERR(0, 443, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 438, __pyx_L1_error) + __PYX_ERR(0, 443, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 438, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":440 + /* "cpp_process.pyx":445 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error)) + __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":441 + /* "cpp_process.pyx":446 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error)) + __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_1 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -8094,7 +8752,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 441, __pyx_L1_error) + else __PYX_ERR(0, 446, __pyx_L1_error) } break; } @@ -8105,29 +8763,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":442 + /* "cpp_process.pyx":447 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error)) + __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":443 + /* "cpp_process.pyx":448 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(443,0,__PYX_ERR(0, 443, __pyx_L1_error)) + __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":442 + /* "cpp_process.pyx":447 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -8136,14 +8794,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject */ } - /* "cpp_process.pyx":445 + /* "cpp_process.pyx":450 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(445,0,__PYX_ERR(0, 445, __pyx_L1_error)) + __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -8161,11 +8819,11 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -8175,125 +8833,122 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject __pyx_t_7 = 0; if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 445, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } - __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":447 + /* "cpp_process.pyx":452 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ - __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":448 + /* "cpp_process.pyx":453 * * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< - * score_cutoff = score + * score_cutoff = score # <<<<<<<<<<<<<< + * kwargs["score_cutoff"] = score * result_score = score */ - __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 448, __pyx_L1_error) - } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_7) < 0))) __PYX_ERR(0, 448, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_TraceLine(453,0,__PYX_ERR(0, 453, __pyx_L1_error)) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_v_score_cutoff = __pyx_t_11; - /* "cpp_process.pyx":449 + /* "cpp_process.pyx":454 * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff - * score_cutoff = score # <<<<<<<<<<<<<< + * score_cutoff = score + * kwargs["score_cutoff"] = score # <<<<<<<<<<<<<< * result_score = score * result_choice = choice */ - __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error)) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) - __pyx_v_score_cutoff = __pyx_t_11; + __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 454, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_v_score) < 0))) __PYX_ERR(0, 454, __pyx_L1_error) - /* "cpp_process.pyx":450 - * kwargs["score_cutoff"] = score_cutoff + /* "cpp_process.pyx":455 * score_cutoff = score + * kwargs["score_cutoff"] = score * result_score = score # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error)) + __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_score); __Pyx_DECREF_SET(__pyx_v_result_score, __pyx_v_score); - /* "cpp_process.pyx":451 - * score_cutoff = score + /* "cpp_process.pyx":456 + * kwargs["score_cutoff"] = score * result_score = score * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(451,0,__PYX_ERR(0, 451, __pyx_L1_error)) + __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":452 + /* "cpp_process.pyx":457 * result_score = score * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if score_cutoff == 100: */ - __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error)) + __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":454 + /* "cpp_process.pyx":459 * result_index = i * * if score_cutoff == 100: # <<<<<<<<<<<<<< * break * else: */ - __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error)) + __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_score_cutoff == 100.0) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":455 + /* "cpp_process.pyx":460 * * if score_cutoff == 100: * break # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error)) + __Pyx_TraceLine(460,0,__PYX_ERR(0, 460, __pyx_L1_error)) goto __pyx_L5_break; - /* "cpp_process.pyx":454 + /* "cpp_process.pyx":459 * result_index = i * * if score_cutoff == 100: # <<<<<<<<<<<<<< @@ -8302,29 +8957,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject */ } - /* "cpp_process.pyx":447 + /* "cpp_process.pyx":452 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ } - /* "cpp_process.pyx":441 + /* "cpp_process.pyx":446 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error)) + __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error)) __pyx_L4_continue:; } __pyx_L5_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":440 + /* "cpp_process.pyx":445 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -8334,40 +8989,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject goto __pyx_L3; } - /* "cpp_process.pyx":457 + /* "cpp_process.pyx":462 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) + __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) /*else*/ { __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_1 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 462, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 462, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -8377,7 +9032,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 457, __pyx_L1_error) + else __PYX_ERR(0, 462, __pyx_L1_error) } break; } @@ -8388,29 +9043,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":458 + /* "cpp_process.pyx":463 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error)) + __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":459 + /* "cpp_process.pyx":464 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error)) + __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":458 + /* "cpp_process.pyx":463 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -8419,15 +9074,15 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject */ } - /* "cpp_process.pyx":461 + /* "cpp_process.pyx":466 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff and score > result_score: */ - __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error)) - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_TraceLine(466,0,__PYX_ERR(0, 466, __pyx_L1_error)) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -8437,125 +9092,122 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_choice); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 461, __pyx_L1_error) + __PYX_ERR(0, 466, __pyx_L1_error) } - __pyx_t_9 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_9 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_v_score, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":463 + /* "cpp_process.pyx":468 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ - __Pyx_TraceLine(463,0,__PYX_ERR(0, 463, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } - __pyx_t_9 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_v_score, __pyx_v_result_score, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_3) { - /* "cpp_process.pyx":464 + /* "cpp_process.pyx":469 * * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< - * score_cutoff = score + * score_cutoff = score # <<<<<<<<<<<<<< + * kwargs["score_cutoff"] = score * result_score = score */ - __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 464, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__pyx_v_kwargs == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 464, __pyx_L1_error) - } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_9) < 0))) __PYX_ERR(0, 464, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_TraceLine(469,0,__PYX_ERR(0, 469, __pyx_L1_error)) + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_v_score_cutoff = __pyx_t_11; - /* "cpp_process.pyx":465 + /* "cpp_process.pyx":470 * if score >= score_cutoff and score > result_score: - * kwargs["score_cutoff"] = score_cutoff - * score_cutoff = score # <<<<<<<<<<<<<< + * score_cutoff = score + * kwargs["score_cutoff"] = score # <<<<<<<<<<<<<< * result_score = score * result_choice = choice */ - __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error)) - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_score); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_v_score_cutoff = __pyx_t_11; + __Pyx_TraceLine(470,0,__PYX_ERR(0, 470, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 470, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_v_score) < 0))) __PYX_ERR(0, 470, __pyx_L1_error) - /* "cpp_process.pyx":466 - * kwargs["score_cutoff"] = score_cutoff + /* "cpp_process.pyx":471 * score_cutoff = score + * kwargs["score_cutoff"] = score * result_score = score # <<<<<<<<<<<<<< * result_choice = choice * result_index = i */ - __Pyx_TraceLine(466,0,__PYX_ERR(0, 466, __pyx_L1_error)) + __Pyx_TraceLine(471,0,__PYX_ERR(0, 471, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_score); __Pyx_DECREF_SET(__pyx_v_result_score, __pyx_v_score); - /* "cpp_process.pyx":467 - * score_cutoff = score + /* "cpp_process.pyx":472 + * kwargs["score_cutoff"] = score * result_score = score * result_choice = choice # <<<<<<<<<<<<<< * result_index = i * */ - __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error)) + __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_choice); __Pyx_DECREF_SET(__pyx_v_result_choice, __pyx_v_choice); - /* "cpp_process.pyx":468 + /* "cpp_process.pyx":473 * result_score = score * result_choice = choice * result_index = i # <<<<<<<<<<<<<< * * if score_cutoff == 100: */ - __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error)) + __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) __pyx_v_result_index = __pyx_v_i; - /* "cpp_process.pyx":470 + /* "cpp_process.pyx":475 * result_index = i * * if score_cutoff == 100: # <<<<<<<<<<<<<< * break * */ - __Pyx_TraceLine(470,0,__PYX_ERR(0, 470, __pyx_L1_error)) + __Pyx_TraceLine(475,0,__PYX_ERR(0, 475, __pyx_L1_error)) __pyx_t_3 = ((__pyx_v_score_cutoff == 100.0) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":471 + /* "cpp_process.pyx":476 * * if score_cutoff == 100: * break # <<<<<<<<<<<<<< * * return (result_choice, result_score, result_index) if result_choice is not None else None */ - __Pyx_TraceLine(471,0,__PYX_ERR(0, 471, __pyx_L1_error)) + __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error)) goto __pyx_L12_break; - /* "cpp_process.pyx":470 + /* "cpp_process.pyx":475 * result_index = i * * if score_cutoff == 100: # <<<<<<<<<<<<<< @@ -8564,23 +9216,23 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject */ } - /* "cpp_process.pyx":463 + /* "cpp_process.pyx":468 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff and score > result_score: # <<<<<<<<<<<<<< - * kwargs["score_cutoff"] = score_cutoff * score_cutoff = score + * kwargs["score_cutoff"] = score */ } - /* "cpp_process.pyx":457 + /* "cpp_process.pyx":462 * break * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error)) + __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error)) __pyx_L11_continue:; } __pyx_L12_break:; @@ -8588,20 +9240,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject } __pyx_L3:; - /* "cpp_process.pyx":473 + /* "cpp_process.pyx":478 * break * * return (result_choice, result_score, result_index) if result_choice is not None else None # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error)) + __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_t_3 = (__pyx_v_result_choice != Py_None); if ((__pyx_t_3 != 0)) { - __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_result_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_result_choice); __Pyx_GIVEREF(__pyx_v_result_choice); @@ -8622,7 +9274,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "cpp_process.pyx":431 + /* "cpp_process.pyx":436 * * * cdef inline py_extractOne_list(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -8649,7 +9301,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject return __pyx_r; } -/* "cpp_process.pyx":476 +/* "cpp_process.pyx":481 * * * def extractOne(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -8657,7 +9309,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extractOne_list(PyObject * Find the best match in a list of choices. When multiple elements have the same similarity, */ -static PyObject *__pyx_pf_11cpp_process_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_11cpp_process_9__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -8667,14 +9319,14 @@ static PyObject *__pyx_pf_11cpp_process_7__defaults__(CYTHON_UNUSED PyObject *__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); - __Pyx_TraceCall("__defaults__", __pyx_f[0], 476, 0, __PYX_ERR(0, 476, __pyx_L1_error)); + __Pyx_TraceCall("__defaults__", __pyx_f[0], 481, 0, __PYX_ERR(0, 481, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -8707,7 +9359,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cpp_process_extractOne, "\n Find the best match in a list of choices. When multiple elements have the same similarity,\n the first element is returned.\n\n Parameters\n ----------\n query : str\n string we want to find\n choices : Iterable\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n Tuple[str, Any, Any]\n Returns the best match in form of a Tuple with 3 elements. The values stored in the\n tuple depend on the types of the input arguments.\n\n * The first element is always the `choice`, which is the value thats compared to the query.\n\n * The second value repre""sents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n None\n When no choice has a `similarity >= score_cutoff`/`distance <= score_cutoff` None is returned\n\n Examples\n --------\n\n >>> from rapidfuzz.process import extractOne\n >>> from rapidfuzz.string_metric import levenshtein, normalized_levenshtein\n >>> from rapidfuzz.fuzz import ratio\n\n extractOne can be used with normalized edit distances.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abcd\", 75.0, 1)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=normalized_levenshtein)\n (\"abcd\", 75.0, 1)\n\n extractOne can be used with edit distances as well.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein)\n (\"abce\", 1, 0)\n\n additional settings of the scorer can be passed as keyword arguments to extractOne\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abcde\", 2, 1)\n\n when a mapping is used for the choices the key of the choi""ce is returned instead of the List index\n\n >>> extractOne(\"abcd\", {\"key\": \"abce\"}, scorer=ratio)\n (\"abcd\", 75.0, \"key\")\n\n By default each string is preprocessed using `utils.default_process`, which lowercases the strings,\n replaces non alphanumeric characters with whitespaces and trims whitespaces from start and end of them.\n This behavior can be changed by passing a custom function, or None/False to disable the behavior. Preprocessing\n can take a significant part of the runtime, so it makes sense to disable it, when it is not required.\n\n\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio)\n (\"abcD\", 100.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=None)\n (\"abcD\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=lambda s: s.upper())\n (\"abcD\", 100.0, 0)\n\n When only results with a similarity above a certain threshold are relevant, the parameter score_cutoff can be\n used to filter out results with a lower similarity. This threshold is used by some of the scorers to exit early,\n when they are sure, that the similarity is below the threshold.\n For normalized edit distances all results with a similarity below score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abce\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio, score_cutoff=80)\n None\n\n For edit distances all results with an edit distance above the score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abce\", 2, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2), score_cutoff=1)\n None\n\n "); +PyDoc_STRVAR(__pyx_doc_11cpp_process_extractOne, "\n Find the best match in a list of choices. When multiple elements have the same similarity,\n the first element is returned.\n\n Parameters\n ----------\n query : Sequence[Hashable]\n string we want to find\n choices : Iterable[Sequence[Hashable]] | Mapping[Sequence[Hashable]]\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n Tuple[Sequence[Hashable], Any, Any]\n Returns the best match in form of a Tuple with 3 elements. The values stored in the\n tuple depend on the types of the input arguments.\n\n * The first element is always the `choice`, whi""ch is the value thats compared to the query.\n\n * The second value represents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n None\n When no choice has a `similarity >= score_cutoff`/`distance <= score_cutoff` None is returned\n\n Examples\n --------\n\n >>> from rapidfuzz.process import extractOne\n >>> from rapidfuzz.string_metric import levenshtein, normalized_levenshtein\n >>> from rapidfuzz.fuzz import ratio\n\n extractOne can be used with normalized edit distances.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abcd\", 75.0, 1)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=normalized_levenshtein)\n (\"abcd\", 75.0, 1)\n\n extractOne can be used with edit distances as well.\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein)\n (\"abce\", 1, 0)\n\n additional settings of the scorer can be passed as keyword arguments to extractOne\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (""\"abcde\", 2, 1)\n\n when a mapping is used for the choices the key of the choice is returned instead of the List index\n\n >>> extractOne(\"abcd\", {\"key\": \"abce\"}, scorer=ratio)\n (\"abcd\", 75.0, \"key\")\n\n By default each string is preprocessed using `utils.default_process`, which lowercases the strings,\n replaces non alphanumeric characters with whitespaces and trims whitespaces from start and end of them.\n This behavior can be changed by passing a custom function, or None/False to disable the behavior. Preprocessing\n can take a significant part of the runtime, so it makes sense to disable it, when it is not required.\n\n\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio)\n (\"abcD\", 100.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=None)\n (\"abcD\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abdD\"], scorer=ratio, processor=lambda s: s.upper())\n (\"abcD\", 100.0, 0)\n\n When only results with a similarity above a certain threshold are relevant, the parameter score_cutoff can be\n used to filter out results with a lower similarity. This threshold is used by some of the scorers to exit early,\n when they are sure, that the similarity is below the threshold.\n For normalized edit distances all results with a similarity below score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio)\n (\"abce\", 75.0, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=ratio, score_cutoff=80)\n None\n\n For edit distances all results with an edit distance above the score_cutoff are filtered out\n\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2))\n (\"abce\", 2, 0)\n >>> extractOne(\"abcd\", [\"abce\"], scorer=levenshtein, weights=(1,1,2), score_cutoff=1)\n None\n\n "); static PyMethodDef __pyx_mdef_11cpp_process_1extractOne = {"extractOne", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cpp_process_1extractOne, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cpp_process_extractOne}; static PyObject *__pyx_pw_11cpp_process_1extractOne(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -8759,14 +9411,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_choices)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("extractOne", 1, 2, 2, 1); __PYX_ERR(0, 476, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extractOne", 1, 2, 2, 1); __PYX_ERR(0, 481, __pyx_L3_error) } } if (kw_args > 0 && (kw_args <= 3)) { @@ -8774,12 +9426,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 2; index < 5 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extractOne") < 0)) __PYX_ERR(0, 476, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extractOne") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -8795,7 +9447,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extractOne", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 476, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extractOne", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("cpp_process.extractOne", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -8835,65 +9487,65 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_TraceFrameInit(__pyx_codeobj__2) __Pyx_RefNannySetupContext("extractOne", 0); - __Pyx_TraceCall("extractOne", __pyx_f[0], 476, 0, __PYX_ERR(0, 476, __pyx_L1_error)); + __Pyx_TraceCall("extractOne", __pyx_f[0], 481, 0, __PYX_ERR(0, 481, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_query); __Pyx_INCREF(__pyx_v_processor); - /* "cpp_process.pyx":595 + /* "cpp_process.pyx":600 * """ * * cdef int def_process = 0 # <<<<<<<<<<<<<< * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext */ - __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error)) + __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error)) __pyx_v_def_process = 0; - /* "cpp_process.pyx":598 + /* "cpp_process.pyx":603 * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 # <<<<<<<<<<<<<< * cdef size_t c_max = -1 * */ - __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error)) + __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error)) __pyx_v_c_score_cutoff = 0.0; - /* "cpp_process.pyx":599 + /* "cpp_process.pyx":604 * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 * cdef size_t c_max = -1 # <<<<<<<<<<<<<< * * if query is None: */ - __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error)) + __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error)) __pyx_v_c_max = ((size_t)-1L); - /* "cpp_process.pyx":601 + /* "cpp_process.pyx":606 * cdef size_t c_max = -1 * * if query is None: # <<<<<<<<<<<<<< * return None * */ - __Pyx_TraceLine(601,0,__PYX_ERR(0, 601, __pyx_L1_error)) + __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_query == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":602 + /* "cpp_process.pyx":607 * * if query is None: * return None # <<<<<<<<<<<<<< * * # preprocess the query */ - __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error)) + __Pyx_TraceLine(607,0,__PYX_ERR(0, 607, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "cpp_process.pyx":601 + /* "cpp_process.pyx":606 * cdef size_t c_max = -1 * * if query is None: # <<<<<<<<<<<<<< @@ -8902,39 +9554,39 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":605 + /* "cpp_process.pyx":610 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< * def_process = 1 * # since this call is only performed once it is not very expensive to */ - __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_v_processor == __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":606 + /* "cpp_process.pyx":611 * # preprocess the query * if processor is default_process: * def_process = 1 # <<<<<<<<<<<<<< * # since this call is only performed once it is not very expensive to * # make it in Python */ - __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error)) + __Pyx_TraceLine(611,0,__PYX_ERR(0, 611, __pyx_L1_error)) __pyx_v_def_process = 1; - /* "cpp_process.pyx":609 + /* "cpp_process.pyx":614 * # since this call is only performed once it is not very expensive to * # make it in Python * query = processor(query) # <<<<<<<<<<<<<< * processor = None * elif callable(processor): */ - __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error)) + __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_4 = __pyx_v_processor; __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -8952,25 +9604,25 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_query}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":610 + /* "cpp_process.pyx":615 * # make it in Python * query = processor(query) * processor = None # <<<<<<<<<<<<<< * elif callable(processor): * query = processor(query) */ - __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error)) + __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); - /* "cpp_process.pyx":605 + /* "cpp_process.pyx":610 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< @@ -8980,26 +9632,26 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx goto __pyx_L4; } - /* "cpp_process.pyx":611 + /* "cpp_process.pyx":616 * query = processor(query) * processor = None * elif callable(processor): # <<<<<<<<<<<<<< * query = processor(query) * elif processor: */ - __Pyx_TraceLine(611,0,__PYX_ERR(0, 611, __pyx_L1_error)) - __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_TraceLine(616,0,__PYX_ERR(0, 616, __pyx_L1_error)) + __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 616, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":612 + /* "cpp_process.pyx":617 * processor = None * elif callable(processor): * query = processor(query) # <<<<<<<<<<<<<< * elif processor: * def_process = 1 */ - __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error)) + __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_4 = __pyx_v_processor; __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -9013,70 +9665,6 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx __pyx_t_6 = 1; } } - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_query}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_3); - __pyx_t_3 = 0; - - /* "cpp_process.pyx":611 - * query = processor(query) - * processor = None - * elif callable(processor): # <<<<<<<<<<<<<< - * query = processor(query) - * elif processor: - */ - goto __pyx_L4; - } - - /* "cpp_process.pyx":613 - * elif callable(processor): - * query = processor(query) - * elif processor: # <<<<<<<<<<<<<< - * def_process = 1 - * # since this call is only performed once it is not very expensive to - */ - __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 613, __pyx_L1_error) - if (__pyx_t_2) { - - /* "cpp_process.pyx":614 - * query = processor(query) - * elif processor: - * def_process = 1 # <<<<<<<<<<<<<< - * # since this call is only performed once it is not very expensive to - * # make it in Python - */ - __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error)) - __pyx_v_def_process = 1; - - /* "cpp_process.pyx":617 - * # since this call is only performed once it is not very expensive to - * # make it in Python - * query = default_process(query) # <<<<<<<<<<<<<< - * processor = None - * # query might be e.g. False - */ - __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_query}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); @@ -9088,18 +9676,82 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":618 + /* "cpp_process.pyx":616 + * query = processor(query) + * processor = None + * elif callable(processor): # <<<<<<<<<<<<<< + * query = processor(query) + * elif processor: + */ + goto __pyx_L4; + } + + /* "cpp_process.pyx":618 + * elif callable(processor): + * query = processor(query) + * elif processor: # <<<<<<<<<<<<<< + * def_process = 1 + * # since this call is only performed once it is not very expensive to + */ + __Pyx_TraceLine(618,0,__PYX_ERR(0, 618, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 618, __pyx_L1_error) + if (__pyx_t_2) { + + /* "cpp_process.pyx":619 + * query = processor(query) + * elif processor: + * def_process = 1 # <<<<<<<<<<<<<< + * # since this call is only performed once it is not very expensive to + * # make it in Python + */ + __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error)) + __pyx_v_def_process = 1; + + /* "cpp_process.pyx":622 + * # since this call is only performed once it is not very expensive to + * # make it in Python + * query = default_process(query) # <<<<<<<<<<<<<< + * processor = None + * # query might be e.g. False + */ + __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_query}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_3); + __pyx_t_3 = 0; + + /* "cpp_process.pyx":623 * # make it in Python * query = default_process(query) * processor = None # <<<<<<<<<<<<<< * # query might be e.g. False * else: */ - __Pyx_TraceLine(618,0,__PYX_ERR(0, 618, __pyx_L1_error)) + __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); - /* "cpp_process.pyx":613 + /* "cpp_process.pyx":618 * elif callable(processor): * query = processor(query) * elif processor: # <<<<<<<<<<<<<< @@ -9109,76 +9761,76 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx goto __pyx_L4; } - /* "cpp_process.pyx":621 + /* "cpp_process.pyx":626 * # query might be e.g. False * else: * processor = None # <<<<<<<<<<<<<< * * if IsIntegratedScorer(scorer): */ - __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error)) + __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error)) /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); } __pyx_L4:; - /* "cpp_process.pyx":623 + /* "cpp_process.pyx":628 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< * # directly use the C++ implementation if possible * # normalized distance implemented in C++ */ - __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error)) + __Pyx_TraceLine(628,0,__PYX_ERR(0, 628, __pyx_L1_error)) __pyx_t_2 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":626 + /* "cpp_process.pyx":631 * # directly use the C++ implementation if possible * # normalized distance implemented in C++ * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: */ - __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error)) - __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error) __pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7); - /* "cpp_process.pyx":627 + /* "cpp_process.pyx":632 * # normalized distance implemented in C++ * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None: * c_score_cutoff = score_cutoff */ - __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error)) + __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error)) __pyx_v_ScorerContext = __pyx_f_11cpp_process_CachedScorerInit(__pyx_v_scorer, __pyx_v_query_context, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":628 + /* "cpp_process.pyx":633 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: */ - __Pyx_TraceLine(628,0,__PYX_ERR(0, 628, __pyx_L1_error)) + __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_score_cutoff != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":629 + /* "cpp_process.pyx":634 * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") */ - __Pyx_TraceLine(629,0,__PYX_ERR(0, 629, __pyx_L1_error)) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error)) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 634, __pyx_L1_error) __pyx_v_c_score_cutoff = __pyx_t_8; - /* "cpp_process.pyx":628 + /* "cpp_process.pyx":633 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -9187,14 +9839,14 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":630 + /* "cpp_process.pyx":635 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * */ - __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error)) + __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_c_score_cutoff < 0.0) != 0); if (!__pyx_t_2) { } else { @@ -9206,21 +9858,21 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx __pyx_L8_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "cpp_process.pyx":631 + /* "cpp_process.pyx":636 * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 631, __pyx_L1_error) + __PYX_ERR(0, 636, __pyx_L1_error) - /* "cpp_process.pyx":630 + /* "cpp_process.pyx":635 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< @@ -9229,34 +9881,34 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":633 + /* "cpp_process.pyx":638 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return extractOne_dict(move(ScorerContext), choices, processor, c_score_cutoff) * else: */ - __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error)) - __pyx_t_1 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error)) + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 638, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":634 + /* "cpp_process.pyx":639 * * if hasattr(choices, "items"): * return extractOne_dict(move(ScorerContext), choices, processor, c_score_cutoff) # <<<<<<<<<<<<<< * else: * return extractOne_list(move(ScorerContext), choices, processor, c_score_cutoff) */ - __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error)) + __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_extractOne_dict(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_extractOne_dict(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":633 + /* "cpp_process.pyx":638 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -9265,24 +9917,24 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":636 + /* "cpp_process.pyx":641 * return extractOne_dict(move(ScorerContext), choices, processor, c_score_cutoff) * else: * return extractOne_list(move(ScorerContext), choices, processor, c_score_cutoff) # <<<<<<<<<<<<<< * * if IsIntegratedDistance(scorer): */ - __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error)) + __Pyx_TraceLine(641,0,__PYX_ERR(0, 641, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_extractOne_list(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_extractOne_list(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":623 + /* "cpp_process.pyx":628 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< @@ -9291,46 +9943,46 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":638 + /* "cpp_process.pyx":643 * return extractOne_list(move(ScorerContext), choices, processor, c_score_cutoff) * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< * # distance implemented in C++ * query_context = conv_sequence(query) */ - __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error)) + __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error)) __pyx_t_2 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":640 + /* "cpp_process.pyx":645 * if IsIntegratedDistance(scorer): * # distance implemented in C++ * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: */ - __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error)) - __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L1_error) __pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7); - /* "cpp_process.pyx":641 + /* "cpp_process.pyx":646 * # distance implemented in C++ * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff */ - __Pyx_TraceLine(641,0,__PYX_ERR(0, 641, __pyx_L1_error)) + __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error)) __pyx_v_DistanceContext = __pyx_f_11cpp_process_CachedDistanceInit(__pyx_v_scorer, __pyx_v_query_context, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":642 + /* "cpp_process.pyx":647 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< * c_max = score_cutoff * */ - __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error)) + __Pyx_TraceLine(647,0,__PYX_ERR(0, 647, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_score_cutoff != Py_None); __pyx_t_9 = (__pyx_t_1 != 0); if (__pyx_t_9) { @@ -9338,26 +9990,26 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __pyx_t_9; goto __pyx_L13_bool_binop_done; } - __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_9; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":643 + /* "cpp_process.pyx":648 * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_TraceLine(648,0,__PYX_ERR(0, 648, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_v_c_max = __pyx_t_10; - /* "cpp_process.pyx":642 + /* "cpp_process.pyx":647 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< @@ -9366,34 +10018,34 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":645 + /* "cpp_process.pyx":650 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return extractOne_distance_dict(move(DistanceContext), choices, processor, c_max) * else: */ - __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error)) - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error)) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 650, __pyx_L1_error) __pyx_t_9 = (__pyx_t_2 != 0); if (__pyx_t_9) { - /* "cpp_process.pyx":646 + /* "cpp_process.pyx":651 * * if hasattr(choices, "items"): * return extractOne_distance_dict(move(DistanceContext), choices, processor, c_max) # <<<<<<<<<<<<<< * else: * return extractOne_distance_list(move(DistanceContext), choices, processor, c_max) */ - __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error)) + __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_extractOne_distance_dict(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_extractOne_distance_dict(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":645 + /* "cpp_process.pyx":650 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -9402,24 +10054,24 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":648 + /* "cpp_process.pyx":653 * return extractOne_distance_dict(move(DistanceContext), choices, processor, c_max) * else: * return extractOne_distance_list(move(DistanceContext), choices, processor, c_max) # <<<<<<<<<<<<<< * * # the scorer has to be called through Python */ - __Pyx_TraceLine(648,0,__PYX_ERR(0, 648, __pyx_L1_error)) + __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_extractOne_distance_list(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_extractOne_distance_list(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_v_c_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":638 + /* "cpp_process.pyx":643 * return extractOne_list(move(ScorerContext), choices, processor, c_score_cutoff) * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< @@ -9428,30 +10080,30 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":651 + /* "cpp_process.pyx":656 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * */ - __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error)) + __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error)) __pyx_t_9 = (__pyx_v_score_cutoff != Py_None); __pyx_t_2 = (__pyx_t_9 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":652 + /* "cpp_process.pyx":657 * # the scorer has to be called through Python * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error)) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_TraceLine(657,0,__PYX_ERR(0, 657, __pyx_L1_error)) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error) __pyx_v_c_score_cutoff = __pyx_t_8; - /* "cpp_process.pyx":651 + /* "cpp_process.pyx":656 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -9460,34 +10112,34 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":654 + /* "cpp_process.pyx":659 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return py_extractOne_dict(query, choices, scorer, processor, c_score_cutoff, kwargs) * else: */ - __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error)) - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error)) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 659, __pyx_L1_error) __pyx_t_9 = (__pyx_t_2 != 0); if (__pyx_t_9) { - /* "cpp_process.pyx":655 + /* "cpp_process.pyx":660 * * if hasattr(choices, "items"): * return py_extractOne_dict(query, choices, scorer, processor, c_score_cutoff, kwargs) # <<<<<<<<<<<<<< * else: * return py_extractOne_list(query, choices, scorer, processor, c_score_cutoff, kwargs) */ - __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error)) + __Pyx_TraceLine(660,0,__PYX_ERR(0, 660, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_py_extractOne_dict(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_py_extractOne_dict(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":654 + /* "cpp_process.pyx":659 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -9496,24 +10148,24 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx */ } - /* "cpp_process.pyx":657 + /* "cpp_process.pyx":662 * return py_extractOne_dict(query, choices, scorer, processor, c_score_cutoff, kwargs) * else: * return py_extractOne_list(query, choices, scorer, processor, c_score_cutoff, kwargs) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(657,0,__PYX_ERR(0, 657, __pyx_L1_error)) + __Pyx_TraceLine(662,0,__PYX_ERR(0, 662, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_11cpp_process_py_extractOne_list(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_3 = __pyx_f_11cpp_process_py_extractOne_list(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":476 + /* "cpp_process.pyx":481 * * * def extractOne(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -9537,7 +10189,7 @@ static PyObject *__pyx_pf_11cpp_process_extractOne(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "cpp_process.pyx":660 +/* "cpp_process.pyx":665 * * * cdef inline extract_dict(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< @@ -9589,71 +10241,71 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_dict", 0); - __Pyx_TraceCall("extract_dict", __pyx_f[0], 660, 0, __PYX_ERR(0, 660, __pyx_L1_error)); + __Pyx_TraceCall("extract_dict", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error)); - /* "cpp_process.pyx":661 + /* "cpp_process.pyx":666 * * cdef inline extract_dict(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): * cdef double score = 0.0 # <<<<<<<<<<<<<< * cdef size_t i * # todo storing 32 Byte per element is a bit wasteful */ - __Pyx_TraceLine(661,0,__PYX_ERR(0, 661, __pyx_L1_error)) + __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) __pyx_v_score = 0.0; - /* "cpp_process.pyx":666 + /* "cpp_process.pyx":671 * # maybe store only key and access the corresponding element when building the list * cdef vector[DictMatchScorerElem] results * results.reserve(len(choices)) # <<<<<<<<<<<<<< * cdef list result_list * */ - __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 671, __pyx_L1_error) try { __pyx_v_results.reserve(((size_t)__pyx_t_1)); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 666, __pyx_L1_error) + __PYX_ERR(0, 671, __pyx_L1_error) } - /* "cpp_process.pyx":669 + /* "cpp_process.pyx":674 * cdef list result_list * * try: # <<<<<<<<<<<<<< * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): */ - __Pyx_TraceLine(669,0,__PYX_ERR(0, 669, __pyx_L1_error)) + __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error)) /*try:*/ { - /* "cpp_process.pyx":670 + /* "cpp_process.pyx":675 * * try: * if processor is not None: # <<<<<<<<<<<<<< * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: */ - __Pyx_TraceLine(670,0,__PYX_ERR(0, 670, __pyx_L4_error)) + __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":671 + /* "cpp_process.pyx":676 * try: * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L4_error)) + __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L4_error)) __pyx_t_4 = 0; __pyx_t_1 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 671, __pyx_L4_error) + __PYX_ERR(0, 676, __pyx_L4_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L4_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_8; @@ -9661,7 +10313,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_1, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 671, __pyx_L4_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 676, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -9671,29 +10323,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":672 + /* "cpp_process.pyx":677 * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(672,0,__PYX_ERR(0, 672, __pyx_L4_error)) + __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":673 + /* "cpp_process.pyx":678 * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(673,0,__PYX_ERR(0, 673, __pyx_L4_error)) + __Pyx_TraceLine(678,0,__PYX_ERR(0, 678, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":672 + /* "cpp_process.pyx":677 * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< @@ -9702,14 +10354,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo */ } - /* "cpp_process.pyx":675 + /* "cpp_process.pyx":680 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L4_error)) + __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L4_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_11 = NULL; __pyx_t_10 = 0; @@ -9727,36 +10379,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_choice}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 675, __pyx_L4_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 680, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":676 + /* "cpp_process.pyx":681 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L4_error)) + __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_proc_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":677 + /* "cpp_process.pyx":682 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) */ - __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L4_error)) + __Pyx_TraceLine(682,0,__PYX_ERR(0, 682, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":676 + /* "cpp_process.pyx":681 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -9765,62 +10417,62 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo */ } - /* "cpp_process.pyx":679 + /* "cpp_process.pyx":684 * continue * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(679,0,__PYX_ERR(0, 679, __pyx_L4_error)) - __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L4_error) + __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L4_error)) + __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L4_error) try { __pyx_t_13 = __pyx_v_context.ratio(__pyx_t_12, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 679, __pyx_L4_error) + __PYX_ERR(0, 684, __pyx_L4_error) } __pyx_v_score = __pyx_t_13; - /* "cpp_process.pyx":681 + /* "cpp_process.pyx":686 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it */ - __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L4_error)) + __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L4_error)) __pyx_t_3 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":684 + /* "cpp_process.pyx":689 * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) # <<<<<<<<<<<<<< * Py_INCREF(choice_key) * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) */ - __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L4_error)) + __Pyx_TraceLine(689,0,__PYX_ERR(0, 689, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":685 + /* "cpp_process.pyx":690 * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) * Py_INCREF(choice_key) # <<<<<<<<<<<<<< * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) * else: */ - __Pyx_TraceLine(685,0,__PYX_ERR(0, 685, __pyx_L4_error)) + __Pyx_TraceLine(690,0,__PYX_ERR(0, 690, __pyx_L4_error)) Py_INCREF(__pyx_v_choice_key); - /* "cpp_process.pyx":686 + /* "cpp_process.pyx":691 * Py_INCREF(choice) * Py_INCREF(choice_key) * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) # <<<<<<<<<<<<<< * else: * for i, (choice_key, choice) in enumerate(choices.items()): */ - __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L4_error)) + __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L4_error)) __pyx_t_14.score = __pyx_v_score; __pyx_t_14.index = __pyx_v_i; __pyx_t_14.choice = ((PyObject *)__pyx_v_choice); @@ -9829,10 +10481,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __pyx_v_results.push_back(__pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 686, __pyx_L4_error) + __PYX_ERR(0, 691, __pyx_L4_error) } - /* "cpp_process.pyx":681 + /* "cpp_process.pyx":686 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -9844,7 +10496,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":670 + /* "cpp_process.pyx":675 * * try: * if processor is not None: # <<<<<<<<<<<<<< @@ -9854,22 +10506,22 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo goto __pyx_L6; } - /* "cpp_process.pyx":688 + /* "cpp_process.pyx":693 * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) * else: * for i, (choice_key, choice) in enumerate(choices.items()): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L4_error)) + __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L4_error)) /*else*/ { __pyx_t_4 = 0; __pyx_t_6 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 688, __pyx_L4_error) + __PYX_ERR(0, 693, __pyx_L4_error) } - __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_1), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L4_error) + __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_1), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 693, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_9; @@ -9877,7 +10529,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_1, &__pyx_t_6, &__pyx_t_9, &__pyx_t_8, NULL, __pyx_t_7); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 688, __pyx_L4_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 693, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_9); @@ -9887,29 +10539,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":689 + /* "cpp_process.pyx":694 * else: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(689,0,__PYX_ERR(0, 689, __pyx_L4_error)) + __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":690 + /* "cpp_process.pyx":695 * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(choice), score_cutoff) */ - __Pyx_TraceLine(690,0,__PYX_ERR(0, 690, __pyx_L4_error)) + __Pyx_TraceLine(695,0,__PYX_ERR(0, 695, __pyx_L4_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":689 + /* "cpp_process.pyx":694 * else: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< @@ -9918,62 +10570,62 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo */ } - /* "cpp_process.pyx":692 + /* "cpp_process.pyx":697 * continue * * score = context.ratio(conv_sequence(choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L4_error)) - __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L4_error) + __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L4_error)) + __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L4_error) try { __pyx_t_13 = __pyx_v_context.ratio(__pyx_t_12, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 692, __pyx_L4_error) + __PYX_ERR(0, 697, __pyx_L4_error) } __pyx_v_score = __pyx_t_13; - /* "cpp_process.pyx":694 + /* "cpp_process.pyx":699 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it */ - __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L4_error)) + __Pyx_TraceLine(699,0,__PYX_ERR(0, 699, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":697 + /* "cpp_process.pyx":702 * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) # <<<<<<<<<<<<<< * Py_INCREF(choice_key) * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) */ - __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L4_error)) + __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":698 + /* "cpp_process.pyx":703 * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) * Py_INCREF(choice_key) # <<<<<<<<<<<<<< * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) * */ - __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L4_error)) + __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L4_error)) Py_INCREF(__pyx_v_choice_key); - /* "cpp_process.pyx":699 + /* "cpp_process.pyx":704 * Py_INCREF(choice) * Py_INCREF(choice_key) * results.push_back(DictMatchScorerElem(score, i, choice, choice_key)) # <<<<<<<<<<<<<< * * # due to score_cutoff not always completely filled */ - __Pyx_TraceLine(699,0,__PYX_ERR(0, 699, __pyx_L4_error)) + __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L4_error)) __pyx_t_14.score = __pyx_v_score; __pyx_t_14.index = __pyx_v_i; __pyx_t_14.choice = ((PyObject *)__pyx_v_choice); @@ -9982,10 +10634,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __pyx_v_results.push_back(__pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 699, __pyx_L4_error) + __PYX_ERR(0, 704, __pyx_L4_error) } - /* "cpp_process.pyx":694 + /* "cpp_process.pyx":699 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -9999,28 +10651,28 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo } __pyx_L6:; - /* "cpp_process.pyx":702 + /* "cpp_process.pyx":707 * * # due to score_cutoff not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< * limit = results.size() * */ - __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L4_error)) + __Pyx_TraceLine(707,0,__PYX_ERR(0, 707, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit > __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":703 + /* "cpp_process.pyx":708 * # due to score_cutoff not always completely filled * if limit > results.size(): * limit = results.size() # <<<<<<<<<<<<<< * * if limit >= results.size(): */ - __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L4_error)) + __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L4_error)) __pyx_v_limit = __pyx_v_results.size(); - /* "cpp_process.pyx":702 + /* "cpp_process.pyx":707 * * # due to score_cutoff not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< @@ -10029,33 +10681,33 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo */ } - /* "cpp_process.pyx":705 + /* "cpp_process.pyx":710 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) * else: */ - __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L4_error)) + __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit >= __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":706 + /* "cpp_process.pyx":711 * * if limit >= results.size(): * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) # <<<<<<<<<<<<<< * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) */ - __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L4_error)) + __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L4_error)) try { std::sort ::iterator,ExtractScorerComp>(__pyx_v_results.begin(), __pyx_v_results.end(), __pyx_t_15); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 706, __pyx_L4_error) + __PYX_ERR(0, 711, __pyx_L4_error) } - /* "cpp_process.pyx":705 + /* "cpp_process.pyx":710 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< @@ -10065,78 +10717,78 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo goto __pyx_L17; } - /* "cpp_process.pyx":708 + /* "cpp_process.pyx":713 * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) # <<<<<<<<<<<<<< * results.resize(limit) * */ - __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L4_error)) + __Pyx_TraceLine(713,0,__PYX_ERR(0, 713, __pyx_L4_error)) /*else*/ { try { std::partial_sort ::iterator,ExtractScorerComp>(__pyx_v_results.begin(), (__pyx_v_results.begin() + ((ptrdiff_t)__pyx_v_limit)), __pyx_v_results.end(), __pyx_t_15); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 708, __pyx_L4_error) + __PYX_ERR(0, 713, __pyx_L4_error) } - /* "cpp_process.pyx":709 + /* "cpp_process.pyx":714 * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) * results.resize(limit) # <<<<<<<<<<<<<< * * # copy elements into Python List */ - __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L4_error)) + __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L4_error)) try { __pyx_v_results.resize(__pyx_v_limit); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 709, __pyx_L4_error) + __PYX_ERR(0, 714, __pyx_L4_error) } } __pyx_L17:; - /* "cpp_process.pyx":712 + /* "cpp_process.pyx":717 * * # copy elements into Python List * result_list = PyList_New(limit) # <<<<<<<<<<<<<< * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].key) */ - __Pyx_TraceLine(712,0,__PYX_ERR(0, 712, __pyx_L4_error)) - __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L4_error) + __Pyx_TraceLine(717,0,__PYX_ERR(0, 717, __pyx_L4_error)) + __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_result_list = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":713 + /* "cpp_process.pyx":718 * # copy elements into Python List * result_list = PyList_New(limit) * for i in range(limit): # <<<<<<<<<<<<<< * result_item = (results[i].choice, results[i].score, results[i].key) * Py_INCREF(result_item) */ - __Pyx_TraceLine(713,0,__PYX_ERR(0, 713, __pyx_L4_error)) + __Pyx_TraceLine(718,0,__PYX_ERR(0, 718, __pyx_L4_error)) __pyx_t_4 = __pyx_v_limit; __pyx_t_16 = __pyx_t_4; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "cpp_process.pyx":714 + /* "cpp_process.pyx":719 * result_list = PyList_New(limit) * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].key) # <<<<<<<<<<<<<< * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) */ - __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L4_error)) + __Pyx_TraceLine(719,0,__PYX_ERR(0, 719, __pyx_L4_error)) __pyx_t_18 = (__pyx_v_results[__pyx_v_i]).choice; - __pyx_t_5 = PyFloat_FromDouble((__pyx_v_results[__pyx_v_i]).score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L4_error) + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_results[__pyx_v_i]).score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_19 = (__pyx_v_results[__pyx_v_i]).key; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 719, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_t_18)); __Pyx_GIVEREF(((PyObject *)__pyx_t_18)); @@ -10150,36 +10802,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __Pyx_XDECREF_SET(__pyx_v_result_item, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "cpp_process.pyx":715 + /* "cpp_process.pyx":720 * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].key) * Py_INCREF(result_item) # <<<<<<<<<<<<<< * PyList_SET_ITEM(result_list, i, result_item) * */ - __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L4_error)) + __Pyx_TraceLine(720,0,__PYX_ERR(0, 720, __pyx_L4_error)) Py_INCREF(__pyx_v_result_item); - /* "cpp_process.pyx":716 + /* "cpp_process.pyx":721 * result_item = (results[i].choice, results[i].score, results[i].key) * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) # <<<<<<<<<<<<<< * * finally: */ - __Pyx_TraceLine(716,0,__PYX_ERR(0, 716, __pyx_L4_error)) + __Pyx_TraceLine(721,0,__PYX_ERR(0, 721, __pyx_L4_error)) PyList_SET_ITEM(__pyx_v_result_list, ((Py_ssize_t)__pyx_v_i), __pyx_v_result_item); } } - /* "cpp_process.pyx":720 + /* "cpp_process.pyx":725 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(720,0,__PYX_ERR(0, 720, __pyx_L4_error)) + __Pyx_TraceLine(725,0,__PYX_ERR(0, 725, __pyx_L4_error)) /*finally:*/ { /*normal exit:*/{ __pyx_t_20 = __pyx_v_results.begin(); @@ -10189,40 +10841,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo ++__pyx_t_20; __pyx_v_item = __pyx_t_14; - /* "cpp_process.pyx":721 + /* "cpp_process.pyx":726 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * Py_DECREF(item.key) * */ - __Pyx_TraceLine(721,0,__PYX_ERR(0, 721, __pyx_L1_error)) + __Pyx_TraceLine(726,0,__PYX_ERR(0, 726, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":722 + /* "cpp_process.pyx":727 * for item in results: * Py_DECREF(item.choice) * Py_DECREF(item.key) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error)) + __Pyx_TraceLine(727,0,__PYX_ERR(0, 727, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.key); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":720 + /* "cpp_process.pyx":725 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(720,0,__PYX_ERR(0, 720, __pyx_L1_error)) + __Pyx_TraceLine(725,0,__PYX_ERR(0, 725, __pyx_L1_error)) } goto __pyx_L5; } @@ -10252,40 +10904,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo ++__pyx_t_20; __pyx_v_item = __pyx_t_14; - /* "cpp_process.pyx":721 + /* "cpp_process.pyx":726 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * Py_DECREF(item.key) * */ - __Pyx_TraceLine(721,0,__PYX_ERR(0, 721, __pyx_L23_error)) + __Pyx_TraceLine(726,0,__PYX_ERR(0, 726, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":722 + /* "cpp_process.pyx":727 * for item in results: * Py_DECREF(item.choice) * Py_DECREF(item.key) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L23_error)) + __Pyx_TraceLine(727,0,__PYX_ERR(0, 727, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.key); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":720 + /* "cpp_process.pyx":725 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(720,0,__PYX_ERR(0, 720, __pyx_L23_error)) + __Pyx_TraceLine(725,0,__PYX_ERR(0, 725, __pyx_L23_error)) } } if (PY_MAJOR_VERSION >= 3) { @@ -10317,20 +10969,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo __pyx_L5:; } - /* "cpp_process.pyx":724 + /* "cpp_process.pyx":729 * Py_DECREF(item.key) * * return result_list # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(724,0,__PYX_ERR(0, 724, __pyx_L1_error)) + __Pyx_TraceLine(729,0,__PYX_ERR(0, 729, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result_list); __pyx_r = __pyx_v_result_list; goto __pyx_L0; - /* "cpp_process.pyx":660 + /* "cpp_process.pyx":665 * * * cdef inline extract_dict(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< @@ -10358,7 +11010,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_dict(CachedScorerCo return __pyx_r; } -/* "cpp_process.pyx":727 +/* "cpp_process.pyx":732 * * * cdef inline extract_distance_dict(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< @@ -10409,61 +11061,61 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_distance_dict", 0); - __Pyx_TraceCall("extract_distance_dict", __pyx_f[0], 727, 0, __PYX_ERR(0, 727, __pyx_L1_error)); + __Pyx_TraceCall("extract_distance_dict", __pyx_f[0], 732, 0, __PYX_ERR(0, 732, __pyx_L1_error)); - /* "cpp_process.pyx":733 + /* "cpp_process.pyx":738 * # maybe store only key and access the corresponding element when building the list * cdef vector[DictMatchDistanceElem] results * results.reserve(len(choices)) # <<<<<<<<<<<<<< * cdef list result_list * */ - __Pyx_TraceLine(733,0,__PYX_ERR(0, 733, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_TraceLine(738,0,__PYX_ERR(0, 738, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 738, __pyx_L1_error) try { __pyx_v_results.reserve(((size_t)__pyx_t_1)); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 733, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) } - /* "cpp_process.pyx":736 + /* "cpp_process.pyx":741 * cdef list result_list * * try: # <<<<<<<<<<<<<< * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): */ - __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error)) + __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error)) /*try:*/ { - /* "cpp_process.pyx":737 + /* "cpp_process.pyx":742 * * try: * if processor is not None: # <<<<<<<<<<<<<< * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: */ - __Pyx_TraceLine(737,0,__PYX_ERR(0, 737, __pyx_L4_error)) + __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":738 + /* "cpp_process.pyx":743 * try: * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(738,0,__PYX_ERR(0, 738, __pyx_L4_error)) + __Pyx_TraceLine(743,0,__PYX_ERR(0, 743, __pyx_L4_error)) __pyx_t_4 = 0; __pyx_t_1 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 738, __pyx_L4_error) + __PYX_ERR(0, 743, __pyx_L4_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 738, __pyx_L4_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 743, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_8; @@ -10471,7 +11123,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_1, &__pyx_t_8, &__pyx_t_9, NULL, __pyx_t_7); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 738, __pyx_L4_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 743, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -10481,29 +11133,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":739 + /* "cpp_process.pyx":744 * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(739,0,__PYX_ERR(0, 739, __pyx_L4_error)) + __Pyx_TraceLine(744,0,__PYX_ERR(0, 744, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":740 + /* "cpp_process.pyx":745 * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(740,0,__PYX_ERR(0, 740, __pyx_L4_error)) + __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":739 + /* "cpp_process.pyx":744 * if processor is not None: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< @@ -10512,14 +11164,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache */ } - /* "cpp_process.pyx":742 + /* "cpp_process.pyx":747 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L4_error)) + __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L4_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_11 = NULL; __pyx_t_10 = 0; @@ -10537,36 +11189,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_choice}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 742, __pyx_L4_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":743 + /* "cpp_process.pyx":748 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(743,0,__PYX_ERR(0, 743, __pyx_L4_error)) + __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_proc_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":744 + /* "cpp_process.pyx":749 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(proc_choice), max_) */ - __Pyx_TraceLine(744,0,__PYX_ERR(0, 744, __pyx_L4_error)) + __Pyx_TraceLine(749,0,__PYX_ERR(0, 749, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":743 + /* "cpp_process.pyx":748 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -10575,62 +11227,62 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache */ } - /* "cpp_process.pyx":746 + /* "cpp_process.pyx":751 * continue * * distance = context.ratio(conv_sequence(proc_choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_: */ - __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L4_error)) - __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L4_error) + __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L4_error)) + __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L4_error) try { __pyx_t_13 = __pyx_v_context.ratio(__pyx_t_12, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 746, __pyx_L4_error) + __PYX_ERR(0, 751, __pyx_L4_error) } __pyx_v_distance = __pyx_t_13; - /* "cpp_process.pyx":748 + /* "cpp_process.pyx":753 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it */ - __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L4_error)) + __Pyx_TraceLine(753,0,__PYX_ERR(0, 753, __pyx_L4_error)) __pyx_t_3 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":751 + /* "cpp_process.pyx":756 * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) # <<<<<<<<<<<<<< * Py_INCREF(choice_key) * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) */ - __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L4_error)) + __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":752 + /* "cpp_process.pyx":757 * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) * Py_INCREF(choice_key) # <<<<<<<<<<<<<< * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) * else: */ - __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L4_error)) + __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L4_error)) Py_INCREF(__pyx_v_choice_key); - /* "cpp_process.pyx":753 + /* "cpp_process.pyx":758 * Py_INCREF(choice) * Py_INCREF(choice_key) * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) # <<<<<<<<<<<<<< * else: * for i, (choice_key, choice) in enumerate(choices.items()): */ - __Pyx_TraceLine(753,0,__PYX_ERR(0, 753, __pyx_L4_error)) + __Pyx_TraceLine(758,0,__PYX_ERR(0, 758, __pyx_L4_error)) __pyx_t_14.distance = __pyx_v_distance; __pyx_t_14.index = __pyx_v_i; __pyx_t_14.choice = ((PyObject *)__pyx_v_choice); @@ -10639,10 +11291,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __pyx_v_results.push_back(__pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 753, __pyx_L4_error) + __PYX_ERR(0, 758, __pyx_L4_error) } - /* "cpp_process.pyx":748 + /* "cpp_process.pyx":753 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< @@ -10654,7 +11306,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":737 + /* "cpp_process.pyx":742 * * try: * if processor is not None: # <<<<<<<<<<<<<< @@ -10664,22 +11316,22 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache goto __pyx_L6; } - /* "cpp_process.pyx":755 + /* "cpp_process.pyx":760 * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) * else: * for i, (choice_key, choice) in enumerate(choices.items()): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L4_error)) + __Pyx_TraceLine(760,0,__PYX_ERR(0, 760, __pyx_L4_error)) /*else*/ { __pyx_t_4 = 0; __pyx_t_6 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 755, __pyx_L4_error) + __PYX_ERR(0, 760, __pyx_L4_error) } - __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_1), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 755, __pyx_L4_error) + __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_1), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_9; @@ -10687,7 +11339,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_1, &__pyx_t_6, &__pyx_t_9, &__pyx_t_8, NULL, __pyx_t_7); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 755, __pyx_L4_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 760, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_9); @@ -10697,29 +11349,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":756 + /* "cpp_process.pyx":761 * else: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L4_error)) + __Pyx_TraceLine(761,0,__PYX_ERR(0, 761, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":757 + /* "cpp_process.pyx":762 * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(choice), max_) */ - __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L4_error)) + __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L4_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":756 + /* "cpp_process.pyx":761 * else: * for i, (choice_key, choice) in enumerate(choices.items()): * if choice is None: # <<<<<<<<<<<<<< @@ -10728,62 +11380,62 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache */ } - /* "cpp_process.pyx":759 + /* "cpp_process.pyx":764 * continue * * distance = context.ratio(conv_sequence(choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_: */ - __Pyx_TraceLine(759,0,__PYX_ERR(0, 759, __pyx_L4_error)) - __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L4_error) + __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L4_error)) + __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L4_error) try { __pyx_t_13 = __pyx_v_context.ratio(__pyx_t_12, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 759, __pyx_L4_error) + __PYX_ERR(0, 764, __pyx_L4_error) } __pyx_v_distance = __pyx_t_13; - /* "cpp_process.pyx":761 + /* "cpp_process.pyx":766 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it */ - __Pyx_TraceLine(761,0,__PYX_ERR(0, 761, __pyx_L4_error)) + __Pyx_TraceLine(766,0,__PYX_ERR(0, 766, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":764 + /* "cpp_process.pyx":769 * # especially the key object might be created on the fly by e.g. pandas.Dataframe * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) # <<<<<<<<<<<<<< * Py_INCREF(choice_key) * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) */ - __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L4_error)) + __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":765 + /* "cpp_process.pyx":770 * # so we need to ensure Python does not deallocate it * Py_INCREF(choice) * Py_INCREF(choice_key) # <<<<<<<<<<<<<< * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) * */ - __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L4_error)) + __Pyx_TraceLine(770,0,__PYX_ERR(0, 770, __pyx_L4_error)) Py_INCREF(__pyx_v_choice_key); - /* "cpp_process.pyx":766 + /* "cpp_process.pyx":771 * Py_INCREF(choice) * Py_INCREF(choice_key) * results.push_back(DictMatchDistanceElem(distance, i, choice, choice_key)) # <<<<<<<<<<<<<< * * # due to max_ not always completely filled */ - __Pyx_TraceLine(766,0,__PYX_ERR(0, 766, __pyx_L4_error)) + __Pyx_TraceLine(771,0,__PYX_ERR(0, 771, __pyx_L4_error)) __pyx_t_14.distance = __pyx_v_distance; __pyx_t_14.index = __pyx_v_i; __pyx_t_14.choice = ((PyObject *)__pyx_v_choice); @@ -10792,10 +11444,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __pyx_v_results.push_back(__pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 766, __pyx_L4_error) + __PYX_ERR(0, 771, __pyx_L4_error) } - /* "cpp_process.pyx":761 + /* "cpp_process.pyx":766 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< @@ -10809,28 +11461,28 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache } __pyx_L6:; - /* "cpp_process.pyx":769 + /* "cpp_process.pyx":774 * * # due to max_ not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< * limit = results.size() * */ - __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L4_error)) + __Pyx_TraceLine(774,0,__PYX_ERR(0, 774, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit > __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":770 + /* "cpp_process.pyx":775 * # due to max_ not always completely filled * if limit > results.size(): * limit = results.size() # <<<<<<<<<<<<<< * * if limit >= results.size(): */ - __Pyx_TraceLine(770,0,__PYX_ERR(0, 770, __pyx_L4_error)) + __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L4_error)) __pyx_v_limit = __pyx_v_results.size(); - /* "cpp_process.pyx":769 + /* "cpp_process.pyx":774 * * # due to max_ not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< @@ -10839,33 +11491,33 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache */ } - /* "cpp_process.pyx":772 + /* "cpp_process.pyx":777 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) * else: */ - __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L4_error)) + __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit >= __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":773 + /* "cpp_process.pyx":778 * * if limit >= results.size(): * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) # <<<<<<<<<<<<<< * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) */ - __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L4_error)) + __Pyx_TraceLine(778,0,__PYX_ERR(0, 778, __pyx_L4_error)) try { std::sort ::iterator,ExtractDistanceComp>(__pyx_v_results.begin(), __pyx_v_results.end(), __pyx_t_15); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 773, __pyx_L4_error) + __PYX_ERR(0, 778, __pyx_L4_error) } - /* "cpp_process.pyx":772 + /* "cpp_process.pyx":777 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< @@ -10875,78 +11527,78 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache goto __pyx_L17; } - /* "cpp_process.pyx":775 + /* "cpp_process.pyx":780 * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) # <<<<<<<<<<<<<< * results.resize(limit) * */ - __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L4_error)) + __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L4_error)) /*else*/ { try { std::partial_sort ::iterator,ExtractDistanceComp>(__pyx_v_results.begin(), (__pyx_v_results.begin() + ((ptrdiff_t)__pyx_v_limit)), __pyx_v_results.end(), __pyx_t_15); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 775, __pyx_L4_error) + __PYX_ERR(0, 780, __pyx_L4_error) } - /* "cpp_process.pyx":776 + /* "cpp_process.pyx":781 * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) * results.resize(limit) # <<<<<<<<<<<<<< * * # copy elements into Python List */ - __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L4_error)) + __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L4_error)) try { __pyx_v_results.resize(__pyx_v_limit); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 776, __pyx_L4_error) + __PYX_ERR(0, 781, __pyx_L4_error) } } __pyx_L17:; - /* "cpp_process.pyx":779 + /* "cpp_process.pyx":784 * * # copy elements into Python List * result_list = PyList_New(limit) # <<<<<<<<<<<<<< * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].key) */ - __Pyx_TraceLine(779,0,__PYX_ERR(0, 779, __pyx_L4_error)) - __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L4_error) + __Pyx_TraceLine(784,0,__PYX_ERR(0, 784, __pyx_L4_error)) + __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 784, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_result_list = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":780 + /* "cpp_process.pyx":785 * # copy elements into Python List * result_list = PyList_New(limit) * for i in range(limit): # <<<<<<<<<<<<<< * result_item = (results[i].choice, results[i].distance, results[i].key) * Py_INCREF(result_item) */ - __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L4_error)) + __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L4_error)) __pyx_t_4 = __pyx_v_limit; __pyx_t_13 = __pyx_t_4; for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "cpp_process.pyx":781 + /* "cpp_process.pyx":786 * result_list = PyList_New(limit) * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].key) # <<<<<<<<<<<<<< * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) */ - __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L4_error)) + __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L4_error)) __pyx_t_17 = (__pyx_v_results[__pyx_v_i]).choice; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L4_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_18 = (__pyx_v_results[__pyx_v_i]).key; - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 781, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 786, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_t_17)); __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); @@ -10960,36 +11612,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __Pyx_XDECREF_SET(__pyx_v_result_item, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "cpp_process.pyx":782 + /* "cpp_process.pyx":787 * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].key) * Py_INCREF(result_item) # <<<<<<<<<<<<<< * PyList_SET_ITEM(result_list, i, result_item) * */ - __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L4_error)) + __Pyx_TraceLine(787,0,__PYX_ERR(0, 787, __pyx_L4_error)) Py_INCREF(__pyx_v_result_item); - /* "cpp_process.pyx":783 + /* "cpp_process.pyx":788 * result_item = (results[i].choice, results[i].distance, results[i].key) * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) # <<<<<<<<<<<<<< * * finally: */ - __Pyx_TraceLine(783,0,__PYX_ERR(0, 783, __pyx_L4_error)) + __Pyx_TraceLine(788,0,__PYX_ERR(0, 788, __pyx_L4_error)) PyList_SET_ITEM(__pyx_v_result_list, ((Py_ssize_t)__pyx_v_i), __pyx_v_result_item); } } - /* "cpp_process.pyx":787 + /* "cpp_process.pyx":792 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(787,0,__PYX_ERR(0, 787, __pyx_L4_error)) + __Pyx_TraceLine(792,0,__PYX_ERR(0, 792, __pyx_L4_error)) /*finally:*/ { /*normal exit:*/{ __pyx_t_19 = __pyx_v_results.begin(); @@ -10999,40 +11651,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache ++__pyx_t_19; __pyx_v_item = __pyx_t_14; - /* "cpp_process.pyx":788 + /* "cpp_process.pyx":793 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * Py_DECREF(item.key) * */ - __Pyx_TraceLine(788,0,__PYX_ERR(0, 788, __pyx_L1_error)) + __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":789 + /* "cpp_process.pyx":794 * for item in results: * Py_DECREF(item.choice) * Py_DECREF(item.key) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(789,0,__PYX_ERR(0, 789, __pyx_L1_error)) + __Pyx_TraceLine(794,0,__PYX_ERR(0, 794, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.key); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":787 + /* "cpp_process.pyx":792 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(787,0,__PYX_ERR(0, 787, __pyx_L1_error)) + __Pyx_TraceLine(792,0,__PYX_ERR(0, 792, __pyx_L1_error)) } goto __pyx_L5; } @@ -11062,40 +11714,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache ++__pyx_t_19; __pyx_v_item = __pyx_t_14; - /* "cpp_process.pyx":788 + /* "cpp_process.pyx":793 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * Py_DECREF(item.key) * */ - __Pyx_TraceLine(788,0,__PYX_ERR(0, 788, __pyx_L23_error)) + __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":789 + /* "cpp_process.pyx":794 * for item in results: * Py_DECREF(item.choice) * Py_DECREF(item.key) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(789,0,__PYX_ERR(0, 789, __pyx_L23_error)) + __Pyx_TraceLine(794,0,__PYX_ERR(0, 794, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.key); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":787 + /* "cpp_process.pyx":792 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * Py_DECREF(item.key) */ - __Pyx_TraceLine(787,0,__PYX_ERR(0, 787, __pyx_L23_error)) + __Pyx_TraceLine(792,0,__PYX_ERR(0, 792, __pyx_L23_error)) } } if (PY_MAJOR_VERSION >= 3) { @@ -11127,20 +11779,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache __pyx_L5:; } - /* "cpp_process.pyx":791 + /* "cpp_process.pyx":796 * Py_DECREF(item.key) * * return result_list # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(791,0,__PYX_ERR(0, 791, __pyx_L1_error)) + __Pyx_TraceLine(796,0,__PYX_ERR(0, 796, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result_list); __pyx_r = __pyx_v_result_list; goto __pyx_L0; - /* "cpp_process.pyx":727 + /* "cpp_process.pyx":732 * * * cdef inline extract_distance_dict(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< @@ -11168,7 +11820,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_dict(Cache return __pyx_r; } -/* "cpp_process.pyx":794 +/* "cpp_process.pyx":799 * * * cdef inline extract_list(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< @@ -11218,89 +11870,89 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_list", 0); - __Pyx_TraceCall("extract_list", __pyx_f[0], 794, 0, __PYX_ERR(0, 794, __pyx_L1_error)); + __Pyx_TraceCall("extract_list", __pyx_f[0], 799, 0, __PYX_ERR(0, 799, __pyx_L1_error)); - /* "cpp_process.pyx":795 + /* "cpp_process.pyx":800 * * cdef inline extract_list(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): * cdef double score = 0.0 # <<<<<<<<<<<<<< * cdef size_t i * # todo possibly a smaller vector would be good to reduce memory usage */ - __Pyx_TraceLine(795,0,__PYX_ERR(0, 795, __pyx_L1_error)) + __Pyx_TraceLine(800,0,__PYX_ERR(0, 800, __pyx_L1_error)) __pyx_v_score = 0.0; - /* "cpp_process.pyx":799 + /* "cpp_process.pyx":804 * # todo possibly a smaller vector would be good to reduce memory usage * cdef vector[ListMatchScorerElem] results * results.reserve(len(choices)) # <<<<<<<<<<<<<< * cdef list result_list * */ - __Pyx_TraceLine(799,0,__PYX_ERR(0, 799, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 799, __pyx_L1_error) + __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 804, __pyx_L1_error) try { __pyx_v_results.reserve(((size_t)__pyx_t_1)); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 799, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) } - /* "cpp_process.pyx":802 + /* "cpp_process.pyx":807 * cdef list result_list * * try: # <<<<<<<<<<<<<< * if processor is not None: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(802,0,__PYX_ERR(0, 802, __pyx_L1_error)) + __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error)) /*try:*/ { - /* "cpp_process.pyx":803 + /* "cpp_process.pyx":808 * * try: * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(803,0,__PYX_ERR(0, 803, __pyx_L4_error)) + __Pyx_TraceLine(808,0,__PYX_ERR(0, 808, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":804 + /* "cpp_process.pyx":809 * try: * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L4_error)) + __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L4_error)) __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_5 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L4_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 809, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 809, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -11310,7 +11962,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 804, __pyx_L4_error) + else __PYX_ERR(0, 809, __pyx_L4_error) } break; } @@ -11321,29 +11973,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":805 + /* "cpp_process.pyx":810 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(805,0,__PYX_ERR(0, 805, __pyx_L4_error)) + __Pyx_TraceLine(810,0,__PYX_ERR(0, 810, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":806 + /* "cpp_process.pyx":811 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(806,0,__PYX_ERR(0, 806, __pyx_L4_error)) + __Pyx_TraceLine(811,0,__PYX_ERR(0, 811, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":805 + /* "cpp_process.pyx":810 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -11352,14 +12004,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":808 + /* "cpp_process.pyx":813 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(808,0,__PYX_ERR(0, 808, __pyx_L4_error)) + __Pyx_TraceLine(813,0,__PYX_ERR(0, 813, __pyx_L4_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -11377,36 +12029,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L4_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":809 + /* "cpp_process.pyx":814 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L4_error)) + __Pyx_TraceLine(814,0,__PYX_ERR(0, 814, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_proc_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":810 + /* "cpp_process.pyx":815 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) */ - __Pyx_TraceLine(810,0,__PYX_ERR(0, 810, __pyx_L4_error)) + __Pyx_TraceLine(815,0,__PYX_ERR(0, 815, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":809 + /* "cpp_process.pyx":814 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -11415,52 +12067,52 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":812 + /* "cpp_process.pyx":817 * continue * * score = context.ratio(conv_sequence(proc_choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(812,0,__PYX_ERR(0, 812, __pyx_L4_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L4_error) + __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L4_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L4_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 812, __pyx_L4_error) + __PYX_ERR(0, 817, __pyx_L4_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":814 + /* "cpp_process.pyx":819 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * Py_INCREF(choice) * results.push_back(ListMatchScorerElem(score, i, choice)) */ - __Pyx_TraceLine(814,0,__PYX_ERR(0, 814, __pyx_L4_error)) + __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L4_error)) __pyx_t_3 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":815 + /* "cpp_process.pyx":820 * * if score >= score_cutoff: * Py_INCREF(choice) # <<<<<<<<<<<<<< * results.push_back(ListMatchScorerElem(score, i, choice)) * else: */ - __Pyx_TraceLine(815,0,__PYX_ERR(0, 815, __pyx_L4_error)) + __Pyx_TraceLine(820,0,__PYX_ERR(0, 820, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":816 + /* "cpp_process.pyx":821 * if score >= score_cutoff: * Py_INCREF(choice) * results.push_back(ListMatchScorerElem(score, i, choice)) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(816,0,__PYX_ERR(0, 816, __pyx_L4_error)) + __Pyx_TraceLine(821,0,__PYX_ERR(0, 821, __pyx_L4_error)) __pyx_t_13.score = __pyx_v_score; __pyx_t_13.index = __pyx_v_i; __pyx_t_13.choice = ((PyObject *)__pyx_v_choice); @@ -11468,10 +12120,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __pyx_v_results.push_back(__pyx_t_13); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 816, __pyx_L4_error) + __PYX_ERR(0, 821, __pyx_L4_error) } - /* "cpp_process.pyx":814 + /* "cpp_process.pyx":819 * score = context.ratio(conv_sequence(proc_choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -11480,19 +12132,19 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":804 + /* "cpp_process.pyx":809 * try: * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L4_error)) + __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L4_error)) __pyx_L7_continue:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":803 + /* "cpp_process.pyx":808 * * try: * if processor is not None: # <<<<<<<<<<<<<< @@ -11502,40 +12154,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo goto __pyx_L6; } - /* "cpp_process.pyx":818 + /* "cpp_process.pyx":823 * results.push_back(ListMatchScorerElem(score, i, choice)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L4_error)) + __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L4_error)) /*else*/ { __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_5 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 823, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 823, __pyx_L4_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 823, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 823, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 823, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 823, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -11545,7 +12197,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 818, __pyx_L4_error) + else __PYX_ERR(0, 823, __pyx_L4_error) } break; } @@ -11556,29 +12208,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":819 + /* "cpp_process.pyx":824 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L4_error)) + __Pyx_TraceLine(824,0,__PYX_ERR(0, 824, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":820 + /* "cpp_process.pyx":825 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = context.ratio(conv_sequence(choice), score_cutoff) */ - __Pyx_TraceLine(820,0,__PYX_ERR(0, 820, __pyx_L4_error)) + __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L4_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":819 + /* "cpp_process.pyx":824 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -11587,52 +12239,52 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":822 + /* "cpp_process.pyx":827 * continue * * score = context.ratio(conv_sequence(choice), score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L4_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 822, __pyx_L4_error) + __Pyx_TraceLine(827,0,__PYX_ERR(0, 827, __pyx_L4_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L4_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 822, __pyx_L4_error) + __PYX_ERR(0, 827, __pyx_L4_error) } __pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":824 + /* "cpp_process.pyx":829 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * Py_INCREF(choice) * results.push_back(ListMatchScorerElem(score, i, choice)) */ - __Pyx_TraceLine(824,0,__PYX_ERR(0, 824, __pyx_L4_error)) + __Pyx_TraceLine(829,0,__PYX_ERR(0, 829, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_score >= __pyx_v_score_cutoff) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":825 + /* "cpp_process.pyx":830 * * if score >= score_cutoff: * Py_INCREF(choice) # <<<<<<<<<<<<<< * results.push_back(ListMatchScorerElem(score, i, choice)) * */ - __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L4_error)) + __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":826 + /* "cpp_process.pyx":831 * if score >= score_cutoff: * Py_INCREF(choice) * results.push_back(ListMatchScorerElem(score, i, choice)) # <<<<<<<<<<<<<< * * # due to score_cutoff not always completely filled */ - __Pyx_TraceLine(826,0,__PYX_ERR(0, 826, __pyx_L4_error)) + __Pyx_TraceLine(831,0,__PYX_ERR(0, 831, __pyx_L4_error)) __pyx_t_13.score = __pyx_v_score; __pyx_t_13.index = __pyx_v_i; __pyx_t_13.choice = ((PyObject *)__pyx_v_choice); @@ -11640,10 +12292,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __pyx_v_results.push_back(__pyx_t_13); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 826, __pyx_L4_error) + __PYX_ERR(0, 831, __pyx_L4_error) } - /* "cpp_process.pyx":824 + /* "cpp_process.pyx":829 * score = context.ratio(conv_sequence(choice), score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -11652,42 +12304,42 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":818 + /* "cpp_process.pyx":823 * results.push_back(ListMatchScorerElem(score, i, choice)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L4_error)) + __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L4_error)) __pyx_L12_continue:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L6:; - /* "cpp_process.pyx":829 + /* "cpp_process.pyx":834 * * # due to score_cutoff not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< * limit = results.size() * */ - __Pyx_TraceLine(829,0,__PYX_ERR(0, 829, __pyx_L4_error)) + __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit > __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":830 + /* "cpp_process.pyx":835 * # due to score_cutoff not always completely filled * if limit > results.size(): * limit = results.size() # <<<<<<<<<<<<<< * * if limit >= results.size(): */ - __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L4_error)) + __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L4_error)) __pyx_v_limit = __pyx_v_results.size(); - /* "cpp_process.pyx":829 + /* "cpp_process.pyx":834 * * # due to score_cutoff not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< @@ -11696,33 +12348,33 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo */ } - /* "cpp_process.pyx":832 + /* "cpp_process.pyx":837 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) * else: */ - __Pyx_TraceLine(832,0,__PYX_ERR(0, 832, __pyx_L4_error)) + __Pyx_TraceLine(837,0,__PYX_ERR(0, 837, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit >= __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":833 + /* "cpp_process.pyx":838 * * if limit >= results.size(): * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) # <<<<<<<<<<<<<< * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) */ - __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L4_error)) + __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L4_error)) try { std::sort ::iterator,ExtractScorerComp>(__pyx_v_results.begin(), __pyx_v_results.end(), __pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 833, __pyx_L4_error) + __PYX_ERR(0, 838, __pyx_L4_error) } - /* "cpp_process.pyx":832 + /* "cpp_process.pyx":837 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< @@ -11732,79 +12384,79 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo goto __pyx_L17; } - /* "cpp_process.pyx":835 + /* "cpp_process.pyx":840 * algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) # <<<<<<<<<<<<<< * results.resize(limit) * */ - __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L4_error)) + __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L4_error)) /*else*/ { try { std::partial_sort ::iterator,ExtractScorerComp>(__pyx_v_results.begin(), (__pyx_v_results.begin() + ((ptrdiff_t)__pyx_v_limit)), __pyx_v_results.end(), __pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 835, __pyx_L4_error) + __PYX_ERR(0, 840, __pyx_L4_error) } - /* "cpp_process.pyx":836 + /* "cpp_process.pyx":841 * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) * results.resize(limit) # <<<<<<<<<<<<<< * * # copy elements into Python List */ - __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L4_error)) + __Pyx_TraceLine(841,0,__PYX_ERR(0, 841, __pyx_L4_error)) try { __pyx_v_results.resize(__pyx_v_limit); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 836, __pyx_L4_error) + __PYX_ERR(0, 841, __pyx_L4_error) } } __pyx_L17:; - /* "cpp_process.pyx":839 + /* "cpp_process.pyx":844 * * # copy elements into Python List * result_list = PyList_New(limit) # <<<<<<<<<<<<<< * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].index) */ - __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L4_error)) - __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L4_error) + __Pyx_TraceLine(844,0,__PYX_ERR(0, 844, __pyx_L4_error)) + __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_result_list = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":840 + /* "cpp_process.pyx":845 * # copy elements into Python List * result_list = PyList_New(limit) * for i in range(limit): # <<<<<<<<<<<<<< * result_item = (results[i].choice, results[i].score, results[i].index) * Py_INCREF(result_item) */ - __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L4_error)) + __Pyx_TraceLine(845,0,__PYX_ERR(0, 845, __pyx_L4_error)) __pyx_t_4 = __pyx_v_limit; __pyx_t_15 = __pyx_t_4; for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_i = __pyx_t_16; - /* "cpp_process.pyx":841 + /* "cpp_process.pyx":846 * result_list = PyList_New(limit) * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].index) # <<<<<<<<<<<<<< * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) */ - __Pyx_TraceLine(841,0,__PYX_ERR(0, 841, __pyx_L4_error)) + __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L4_error)) __pyx_t_17 = (__pyx_v_results[__pyx_v_i]).choice; - __pyx_t_5 = PyFloat_FromDouble((__pyx_v_results[__pyx_v_i]).score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L4_error) + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_results[__pyx_v_i]).score); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 846, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 846, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_t_17)); __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); @@ -11818,36 +12470,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __Pyx_XDECREF_SET(__pyx_v_result_item, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "cpp_process.pyx":842 + /* "cpp_process.pyx":847 * for i in range(limit): * result_item = (results[i].choice, results[i].score, results[i].index) * Py_INCREF(result_item) # <<<<<<<<<<<<<< * PyList_SET_ITEM(result_list, i, result_item) * */ - __Pyx_TraceLine(842,0,__PYX_ERR(0, 842, __pyx_L4_error)) + __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L4_error)) Py_INCREF(__pyx_v_result_item); - /* "cpp_process.pyx":843 + /* "cpp_process.pyx":848 * result_item = (results[i].choice, results[i].score, results[i].index) * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) # <<<<<<<<<<<<<< * * finally: */ - __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L4_error)) + __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L4_error)) PyList_SET_ITEM(__pyx_v_result_list, ((Py_ssize_t)__pyx_v_i), __pyx_v_result_item); } } - /* "cpp_process.pyx":847 + /* "cpp_process.pyx":852 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L4_error)) + __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L4_error)) /*finally:*/ { /*normal exit:*/{ __pyx_t_18 = __pyx_v_results.begin(); @@ -11857,27 +12509,27 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo ++__pyx_t_18; __pyx_v_item = __pyx_t_13; - /* "cpp_process.pyx":848 + /* "cpp_process.pyx":853 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error)) + __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":847 + /* "cpp_process.pyx":852 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error)) + __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error)) } goto __pyx_L5; } @@ -11907,27 +12559,27 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo ++__pyx_t_18; __pyx_v_item = __pyx_t_13; - /* "cpp_process.pyx":848 + /* "cpp_process.pyx":853 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L23_error)) + __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":847 + /* "cpp_process.pyx":852 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L23_error)) + __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L23_error)) } } if (PY_MAJOR_VERSION >= 3) { @@ -11959,20 +12611,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo __pyx_L5:; } - /* "cpp_process.pyx":850 + /* "cpp_process.pyx":855 * Py_DECREF(item.choice) * * return result_list # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error)) + __Pyx_TraceLine(855,0,__PYX_ERR(0, 855, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result_list); __pyx_r = __pyx_v_result_list; goto __pyx_L0; - /* "cpp_process.pyx":794 + /* "cpp_process.pyx":799 * * * cdef inline extract_list(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< @@ -11999,7 +12651,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_list(CachedScorerCo return __pyx_r; } -/* "cpp_process.pyx":853 +/* "cpp_process.pyx":858 * * * cdef inline extract_distance_list(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< @@ -12048,79 +12700,79 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_distance_list", 0); - __Pyx_TraceCall("extract_distance_list", __pyx_f[0], 853, 0, __PYX_ERR(0, 853, __pyx_L1_error)); + __Pyx_TraceCall("extract_distance_list", __pyx_f[0], 858, 0, __PYX_ERR(0, 858, __pyx_L1_error)); - /* "cpp_process.pyx":858 + /* "cpp_process.pyx":863 * # todo possibly a smaller vector would be good to reduce memory usage * cdef vector[ListMatchDistanceElem] results * results.reserve(len(choices)) # <<<<<<<<<<<<<< * cdef list result_list * */ - __Pyx_TraceLine(858,0,__PYX_ERR(0, 858, __pyx_L1_error)) - __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_TraceLine(863,0,__PYX_ERR(0, 863, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 863, __pyx_L1_error) try { __pyx_v_results.reserve(((size_t)__pyx_t_1)); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 858, __pyx_L1_error) + __PYX_ERR(0, 863, __pyx_L1_error) } - /* "cpp_process.pyx":861 + /* "cpp_process.pyx":866 * cdef list result_list * * try: # <<<<<<<<<<<<<< * if processor is not None: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(861,0,__PYX_ERR(0, 861, __pyx_L1_error)) + __Pyx_TraceLine(866,0,__PYX_ERR(0, 866, __pyx_L1_error)) /*try:*/ { - /* "cpp_process.pyx":862 + /* "cpp_process.pyx":867 * * try: * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(862,0,__PYX_ERR(0, 862, __pyx_L4_error)) + __Pyx_TraceLine(867,0,__PYX_ERR(0, 867, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":863 + /* "cpp_process.pyx":868 * try: * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(863,0,__PYX_ERR(0, 863, __pyx_L4_error)) + __Pyx_TraceLine(868,0,__PYX_ERR(0, 868, __pyx_L4_error)) __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_5 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 868, __pyx_L4_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 868, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 868, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 868, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 868, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -12130,7 +12782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 863, __pyx_L4_error) + else __PYX_ERR(0, 868, __pyx_L4_error) } break; } @@ -12141,29 +12793,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":864 + /* "cpp_process.pyx":869 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L4_error)) + __Pyx_TraceLine(869,0,__PYX_ERR(0, 869, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":865 + /* "cpp_process.pyx":870 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(865,0,__PYX_ERR(0, 865, __pyx_L4_error)) + __Pyx_TraceLine(870,0,__PYX_ERR(0, 870, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":864 + /* "cpp_process.pyx":869 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -12172,14 +12824,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":867 + /* "cpp_process.pyx":872 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(867,0,__PYX_ERR(0, 867, __pyx_L4_error)) + __Pyx_TraceLine(872,0,__PYX_ERR(0, 872, __pyx_L4_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -12197,36 +12849,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 867, __pyx_L4_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":868 + /* "cpp_process.pyx":873 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(868,0,__PYX_ERR(0, 868, __pyx_L4_error)) + __Pyx_TraceLine(873,0,__PYX_ERR(0, 873, __pyx_L4_error)) __pyx_t_2 = (__pyx_v_proc_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":869 + /* "cpp_process.pyx":874 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(proc_choice), max_) */ - __Pyx_TraceLine(869,0,__PYX_ERR(0, 869, __pyx_L4_error)) + __Pyx_TraceLine(874,0,__PYX_ERR(0, 874, __pyx_L4_error)) goto __pyx_L7_continue; - /* "cpp_process.pyx":868 + /* "cpp_process.pyx":873 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -12235,52 +12887,52 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":871 + /* "cpp_process.pyx":876 * continue * * distance = context.ratio(conv_sequence(proc_choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_: */ - __Pyx_TraceLine(871,0,__PYX_ERR(0, 871, __pyx_L4_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 871, __pyx_L4_error) + __Pyx_TraceLine(876,0,__PYX_ERR(0, 876, __pyx_L4_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L4_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 871, __pyx_L4_error) + __PYX_ERR(0, 876, __pyx_L4_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":873 + /* "cpp_process.pyx":878 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< * Py_INCREF(choice) * results.push_back(ListMatchDistanceElem(distance, i, choice)) */ - __Pyx_TraceLine(873,0,__PYX_ERR(0, 873, __pyx_L4_error)) + __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L4_error)) __pyx_t_3 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":874 + /* "cpp_process.pyx":879 * * if distance <= max_: * Py_INCREF(choice) # <<<<<<<<<<<<<< * results.push_back(ListMatchDistanceElem(distance, i, choice)) * else: */ - __Pyx_TraceLine(874,0,__PYX_ERR(0, 874, __pyx_L4_error)) + __Pyx_TraceLine(879,0,__PYX_ERR(0, 879, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":875 + /* "cpp_process.pyx":880 * if distance <= max_: * Py_INCREF(choice) * results.push_back(ListMatchDistanceElem(distance, i, choice)) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(875,0,__PYX_ERR(0, 875, __pyx_L4_error)) + __Pyx_TraceLine(880,0,__PYX_ERR(0, 880, __pyx_L4_error)) __pyx_t_13.distance = __pyx_v_distance; __pyx_t_13.index = __pyx_v_i; __pyx_t_13.choice = ((PyObject *)__pyx_v_choice); @@ -12288,10 +12940,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __pyx_v_results.push_back(__pyx_t_13); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 875, __pyx_L4_error) + __PYX_ERR(0, 880, __pyx_L4_error) } - /* "cpp_process.pyx":873 + /* "cpp_process.pyx":878 * distance = context.ratio(conv_sequence(proc_choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< @@ -12300,19 +12952,19 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":863 + /* "cpp_process.pyx":868 * try: * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(863,0,__PYX_ERR(0, 863, __pyx_L4_error)) + __Pyx_TraceLine(868,0,__PYX_ERR(0, 868, __pyx_L4_error)) __pyx_L7_continue:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":862 + /* "cpp_process.pyx":867 * * try: * if processor is not None: # <<<<<<<<<<<<<< @@ -12322,40 +12974,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache goto __pyx_L6; } - /* "cpp_process.pyx":877 + /* "cpp_process.pyx":882 * results.push_back(ListMatchDistanceElem(distance, i, choice)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(877,0,__PYX_ERR(0, 877, __pyx_L4_error)) + __Pyx_TraceLine(882,0,__PYX_ERR(0, 882, __pyx_L4_error)) /*else*/ { __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_5 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L4_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 882, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 882, __pyx_L4_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L4_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -12365,7 +13017,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 877, __pyx_L4_error) + else __PYX_ERR(0, 882, __pyx_L4_error) } break; } @@ -12376,29 +13028,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":878 + /* "cpp_process.pyx":883 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L4_error)) + __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L4_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":879 + /* "cpp_process.pyx":884 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = context.ratio(conv_sequence(choice), max_) */ - __Pyx_TraceLine(879,0,__PYX_ERR(0, 879, __pyx_L4_error)) + __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L4_error)) goto __pyx_L12_continue; - /* "cpp_process.pyx":878 + /* "cpp_process.pyx":883 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -12407,52 +13059,52 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":881 + /* "cpp_process.pyx":886 * continue * * distance = context.ratio(conv_sequence(choice), max_) # <<<<<<<<<<<<<< * * if distance <= max_: */ - __Pyx_TraceLine(881,0,__PYX_ERR(0, 881, __pyx_L4_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L4_error) + __Pyx_TraceLine(886,0,__PYX_ERR(0, 886, __pyx_L4_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L4_error) try { __pyx_t_12 = __pyx_v_context.ratio(__pyx_t_11, __pyx_v_max_); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 881, __pyx_L4_error) + __PYX_ERR(0, 886, __pyx_L4_error) } __pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":883 + /* "cpp_process.pyx":888 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< * Py_INCREF(choice) * results.push_back(ListMatchDistanceElem(distance, i, choice)) */ - __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L4_error)) + __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_distance <= __pyx_v_max_) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":884 + /* "cpp_process.pyx":889 * * if distance <= max_: * Py_INCREF(choice) # <<<<<<<<<<<<<< * results.push_back(ListMatchDistanceElem(distance, i, choice)) * */ - __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L4_error)) + __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L4_error)) Py_INCREF(__pyx_v_choice); - /* "cpp_process.pyx":885 + /* "cpp_process.pyx":890 * if distance <= max_: * Py_INCREF(choice) * results.push_back(ListMatchDistanceElem(distance, i, choice)) # <<<<<<<<<<<<<< * * # due to max_ not always completely filled */ - __Pyx_TraceLine(885,0,__PYX_ERR(0, 885, __pyx_L4_error)) + __Pyx_TraceLine(890,0,__PYX_ERR(0, 890, __pyx_L4_error)) __pyx_t_13.distance = __pyx_v_distance; __pyx_t_13.index = __pyx_v_i; __pyx_t_13.choice = ((PyObject *)__pyx_v_choice); @@ -12460,10 +13112,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __pyx_v_results.push_back(__pyx_t_13); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 885, __pyx_L4_error) + __PYX_ERR(0, 890, __pyx_L4_error) } - /* "cpp_process.pyx":883 + /* "cpp_process.pyx":888 * distance = context.ratio(conv_sequence(choice), max_) * * if distance <= max_: # <<<<<<<<<<<<<< @@ -12472,42 +13124,42 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":877 + /* "cpp_process.pyx":882 * results.push_back(ListMatchDistanceElem(distance, i, choice)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(877,0,__PYX_ERR(0, 877, __pyx_L4_error)) + __Pyx_TraceLine(882,0,__PYX_ERR(0, 882, __pyx_L4_error)) __pyx_L12_continue:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L6:; - /* "cpp_process.pyx":888 + /* "cpp_process.pyx":893 * * # due to max_ not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< * limit = results.size() * */ - __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L4_error)) + __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit > __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":889 + /* "cpp_process.pyx":894 * # due to max_ not always completely filled * if limit > results.size(): * limit = results.size() # <<<<<<<<<<<<<< * * if limit >= results.size(): */ - __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L4_error)) + __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L4_error)) __pyx_v_limit = __pyx_v_results.size(); - /* "cpp_process.pyx":888 + /* "cpp_process.pyx":893 * * # due to max_ not always completely filled * if limit > results.size(): # <<<<<<<<<<<<<< @@ -12516,33 +13168,33 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache */ } - /* "cpp_process.pyx":891 + /* "cpp_process.pyx":896 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) * else: */ - __Pyx_TraceLine(891,0,__PYX_ERR(0, 891, __pyx_L4_error)) + __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L4_error)) __pyx_t_2 = ((__pyx_v_limit >= __pyx_v_results.size()) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":892 + /* "cpp_process.pyx":897 * * if limit >= results.size(): * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) # <<<<<<<<<<<<<< * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) */ - __Pyx_TraceLine(892,0,__PYX_ERR(0, 892, __pyx_L4_error)) + __Pyx_TraceLine(897,0,__PYX_ERR(0, 897, __pyx_L4_error)) try { std::sort ::iterator,ExtractDistanceComp>(__pyx_v_results.begin(), __pyx_v_results.end(), __pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 892, __pyx_L4_error) + __PYX_ERR(0, 897, __pyx_L4_error) } - /* "cpp_process.pyx":891 + /* "cpp_process.pyx":896 * limit = results.size() * * if limit >= results.size(): # <<<<<<<<<<<<<< @@ -12552,79 +13204,79 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache goto __pyx_L17; } - /* "cpp_process.pyx":894 + /* "cpp_process.pyx":899 * algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) # <<<<<<<<<<<<<< * results.resize(limit) * */ - __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L4_error)) + __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L4_error)) /*else*/ { try { std::partial_sort ::iterator,ExtractDistanceComp>(__pyx_v_results.begin(), (__pyx_v_results.begin() + ((ptrdiff_t)__pyx_v_limit)), __pyx_v_results.end(), __pyx_t_14); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 894, __pyx_L4_error) + __PYX_ERR(0, 899, __pyx_L4_error) } - /* "cpp_process.pyx":895 + /* "cpp_process.pyx":900 * else: * algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) * results.resize(limit) # <<<<<<<<<<<<<< * * # copy elements into Python List */ - __Pyx_TraceLine(895,0,__PYX_ERR(0, 895, __pyx_L4_error)) + __Pyx_TraceLine(900,0,__PYX_ERR(0, 900, __pyx_L4_error)) try { __pyx_v_results.resize(__pyx_v_limit); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 895, __pyx_L4_error) + __PYX_ERR(0, 900, __pyx_L4_error) } } __pyx_L17:; - /* "cpp_process.pyx":898 + /* "cpp_process.pyx":903 * * # copy elements into Python List * result_list = PyList_New(limit) # <<<<<<<<<<<<<< * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].index) */ - __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L4_error)) - __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L4_error) + __Pyx_TraceLine(903,0,__PYX_ERR(0, 903, __pyx_L4_error)) + __pyx_t_5 = PyList_New(((Py_ssize_t)__pyx_v_limit)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_result_list = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "cpp_process.pyx":899 + /* "cpp_process.pyx":904 * # copy elements into Python List * result_list = PyList_New(limit) * for i in range(limit): # <<<<<<<<<<<<<< * result_item = (results[i].choice, results[i].distance, results[i].index) * Py_INCREF(result_item) */ - __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L4_error)) + __Pyx_TraceLine(904,0,__PYX_ERR(0, 904, __pyx_L4_error)) __pyx_t_4 = __pyx_v_limit; __pyx_t_12 = __pyx_t_4; for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_12; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; - /* "cpp_process.pyx":900 + /* "cpp_process.pyx":905 * result_list = PyList_New(limit) * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].index) # <<<<<<<<<<<<<< * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) */ - __Pyx_TraceLine(900,0,__PYX_ERR(0, 900, __pyx_L4_error)) + __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L4_error)) __pyx_t_16 = (__pyx_v_results[__pyx_v_i]).choice; - __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 900, __pyx_L4_error) + __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).distance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyInt_FromSize_t((__pyx_v_results[__pyx_v_i]).index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 905, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 900, __pyx_L4_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 905, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_t_16)); __Pyx_GIVEREF(((PyObject *)__pyx_t_16)); @@ -12638,36 +13290,36 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __Pyx_XDECREF_SET(__pyx_v_result_item, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "cpp_process.pyx":901 + /* "cpp_process.pyx":906 * for i in range(limit): * result_item = (results[i].choice, results[i].distance, results[i].index) * Py_INCREF(result_item) # <<<<<<<<<<<<<< * PyList_SET_ITEM(result_list, i, result_item) * */ - __Pyx_TraceLine(901,0,__PYX_ERR(0, 901, __pyx_L4_error)) + __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L4_error)) Py_INCREF(__pyx_v_result_item); - /* "cpp_process.pyx":902 + /* "cpp_process.pyx":907 * result_item = (results[i].choice, results[i].distance, results[i].index) * Py_INCREF(result_item) * PyList_SET_ITEM(result_list, i, result_item) # <<<<<<<<<<<<<< * * finally: */ - __Pyx_TraceLine(902,0,__PYX_ERR(0, 902, __pyx_L4_error)) + __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L4_error)) PyList_SET_ITEM(__pyx_v_result_list, ((Py_ssize_t)__pyx_v_i), __pyx_v_result_item); } } - /* "cpp_process.pyx":906 + /* "cpp_process.pyx":911 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L4_error)) + __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L4_error)) /*finally:*/ { /*normal exit:*/{ __pyx_t_17 = __pyx_v_results.begin(); @@ -12677,27 +13329,27 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache ++__pyx_t_17; __pyx_v_item = __pyx_t_13; - /* "cpp_process.pyx":907 + /* "cpp_process.pyx":912 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L1_error)) + __Pyx_TraceLine(912,0,__PYX_ERR(0, 912, __pyx_L1_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":906 + /* "cpp_process.pyx":911 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error)) + __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error)) } goto __pyx_L5; } @@ -12727,27 +13379,27 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache ++__pyx_t_17; __pyx_v_item = __pyx_t_13; - /* "cpp_process.pyx":907 + /* "cpp_process.pyx":912 * # decref all reference counts * for item in results: * Py_DECREF(item.choice) # <<<<<<<<<<<<<< * * return result_list */ - __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L23_error)) + __Pyx_TraceLine(912,0,__PYX_ERR(0, 912, __pyx_L23_error)) __pyx_t_8 = ((PyObject *)__pyx_v_item.choice); __Pyx_INCREF(__pyx_t_8); Py_DECREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":906 + /* "cpp_process.pyx":911 * finally: * # decref all reference counts * for item in results: # <<<<<<<<<<<<<< * Py_DECREF(item.choice) * */ - __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L23_error)) + __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L23_error)) } } if (PY_MAJOR_VERSION >= 3) { @@ -12779,20 +13431,20 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache __pyx_L5:; } - /* "cpp_process.pyx":909 + /* "cpp_process.pyx":914 * Py_DECREF(item.choice) * * return result_list # <<<<<<<<<<<<<< * * cdef inline py_extract_dict(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): */ - __Pyx_TraceLine(909,0,__PYX_ERR(0, 909, __pyx_L1_error)) + __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result_list); __pyx_r = __pyx_v_result_list; goto __pyx_L0; - /* "cpp_process.pyx":853 + /* "cpp_process.pyx":858 * * * cdef inline extract_distance_list(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< @@ -12819,7 +13471,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_extract_distance_list(Cache return __pyx_r; } -/* "cpp_process.pyx":940 +/* "cpp_process.pyx":945 * result_list.append((choice, score, choice_key)) * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) # <<<<<<<<<<<<<< @@ -12873,12 +13525,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 940, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda") < 0)) __PYX_ERR(0, 945, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -12889,7 +13541,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 940, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 945, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cpp_process.py_extract_dict.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12911,9 +13563,9 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 0); - __Pyx_TraceCall("lambda", __pyx_f[0], 940, 0, __PYX_ERR(0, 940, __pyx_L1_error)); + __Pyx_TraceCall("lambda", __pyx_f[0], 945, 0, __PYX_ERR(0, 945, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12931,7 +13583,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "cpp_process.pyx":911 +/* "cpp_process.pyx":916 * return result_list * * cdef inline py_extract_dict(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -12962,89 +13614,89 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("py_extract_dict", 0); - __Pyx_TraceCall("py_extract_dict", __pyx_f[0], 911, 0, __PYX_ERR(0, 911, __pyx_L1_error)); + __Pyx_TraceCall("py_extract_dict", __pyx_f[0], 916, 0, __PYX_ERR(0, 916, __pyx_L1_error)); - /* "cpp_process.pyx":912 + /* "cpp_process.pyx":917 * * cdef inline py_extract_dict(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): * cdef object score = None # <<<<<<<<<<<<<< * # todo working directly with a list is relatively slow * # also it is not very memory efficient to allocate space for all elements even when only */ - __Pyx_TraceLine(912,0,__PYX_ERR(0, 912, __pyx_L1_error)) + __Pyx_TraceLine(917,0,__PYX_ERR(0, 917, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_score = Py_None; - /* "cpp_process.pyx":916 + /* "cpp_process.pyx":921 * # also it is not very memory efficient to allocate space for all elements even when only * # a part is used. This should be optimised in the future * cdef list result_list = [] # <<<<<<<<<<<<<< * * kwargs["processor"] = None */ - __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error)) - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error)) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":918 + /* "cpp_process.pyx":923 * cdef list result_list = [] * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = score_cutoff * */ - __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error)) + __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 918, __pyx_L1_error) + __PYX_ERR(0, 923, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 918, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 923, __pyx_L1_error) - /* "cpp_process.pyx":919 + /* "cpp_process.pyx":924 * * kwargs["processor"] = None * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error) + __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 919, __pyx_L1_error) + __PYX_ERR(0, 924, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 919, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":921 + /* "cpp_process.pyx":926 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error)) + __Pyx_TraceLine(926,0,__PYX_ERR(0, 926, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":922 + /* "cpp_process.pyx":927 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error)) + __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error)) __pyx_t_4 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 922, __pyx_L1_error) + __PYX_ERR(0, 927, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; @@ -13052,7 +13704,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 922, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_7); @@ -13060,29 +13712,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":923 + /* "cpp_process.pyx":928 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error)) + __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":924 + /* "cpp_process.pyx":929 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error)) + __Pyx_TraceLine(929,0,__PYX_ERR(0, 929, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":923 + /* "cpp_process.pyx":928 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -13091,14 +13743,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ */ } - /* "cpp_process.pyx":926 + /* "cpp_process.pyx":931 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(926,0,__PYX_ERR(0, 926, __pyx_L1_error)) + __Pyx_TraceLine(931,0,__PYX_ERR(0, 931, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_7 = __pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -13116,11 +13768,11 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 926, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -13130,42 +13782,42 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __pyx_t_8 = 0; if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 926, __pyx_L1_error) + __PYX_ERR(0, 931, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":928 + /* "cpp_process.pyx":933 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * result_list.append((choice, score, choice_key)) * else: */ - __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_TraceLine(933,0,__PYX_ERR(0, 933, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "cpp_process.pyx":929 + /* "cpp_process.pyx":934 * * if score >= score_cutoff: * result_list.append((choice, score, choice_key)) # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(929,0,__PYX_ERR(0, 929, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_TraceLine(934,0,__PYX_ERR(0, 934, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_choice); __Pyx_GIVEREF(__pyx_v_choice); @@ -13176,10 +13828,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __Pyx_INCREF(__pyx_v_choice_key); __Pyx_GIVEREF(__pyx_v_choice_key); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_choice_key); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":928 + /* "cpp_process.pyx":933 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -13191,7 +13843,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":921 + /* "cpp_process.pyx":926 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -13201,21 +13853,21 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ goto __pyx_L3; } - /* "cpp_process.pyx":931 + /* "cpp_process.pyx":936 * result_list.append((choice, score, choice_key)) * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(931,0,__PYX_ERR(0, 931, __pyx_L1_error)) + __Pyx_TraceLine(936,0,__PYX_ERR(0, 936, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; if (unlikely(__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 931, __pyx_L1_error) + __PYX_ERR(0, 936, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_8; @@ -13223,7 +13875,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_10, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 931, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_choice_key, __pyx_t_8); @@ -13231,29 +13883,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":932 + /* "cpp_process.pyx":937 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(932,0,__PYX_ERR(0, 932, __pyx_L1_error)) + __Pyx_TraceLine(937,0,__PYX_ERR(0, 937, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":933 + /* "cpp_process.pyx":938 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(933,0,__PYX_ERR(0, 933, __pyx_L1_error)) + __Pyx_TraceLine(938,0,__PYX_ERR(0, 938, __pyx_L1_error)) goto __pyx_L8_continue; - /* "cpp_process.pyx":932 + /* "cpp_process.pyx":937 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -13262,15 +13914,15 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ */ } - /* "cpp_process.pyx":935 + /* "cpp_process.pyx":940 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error)) - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 935, __pyx_L1_error) + __Pyx_TraceLine(940,0,__PYX_ERR(0, 940, __pyx_L1_error)) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -13280,42 +13932,42 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_choice); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 935, __pyx_L1_error) + __PYX_ERR(0, 940, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":937 + /* "cpp_process.pyx":942 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * result_list.append((choice, score, choice_key)) * */ - __Pyx_TraceLine(937,0,__PYX_ERR(0, 937, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_TraceLine(942,0,__PYX_ERR(0, 942, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":938 + /* "cpp_process.pyx":943 * * if score >= score_cutoff: * result_list.append((choice, score, choice_key)) # <<<<<<<<<<<<<< * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) */ - __Pyx_TraceLine(938,0,__PYX_ERR(0, 938, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_choice); __Pyx_GIVEREF(__pyx_v_choice); @@ -13326,10 +13978,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __Pyx_INCREF(__pyx_v_choice_key); __Pyx_GIVEREF(__pyx_v_choice_key); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_choice_key); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":937 + /* "cpp_process.pyx":942 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -13343,23 +13995,23 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ } __pyx_L3:; - /* "cpp_process.pyx":940 + /* "cpp_process.pyx":945 * result_list.append((choice, score, choice_key)) * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(940,0,__PYX_ERR(0, 940, __pyx_L1_error)) + __Pyx_TraceLine(945,0,__PYX_ERR(0, 945, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_heapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_heapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlargest); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlargest); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -13367,13 +14019,13 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __Pyx_GIVEREF(__pyx_v_result_list); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_result_list); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_15py_extract_dict_lambda, 0, __pyx_n_s_py_extract_dict_locals_lambda, NULL, __pyx_n_s_cpp_process, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_15py_extract_dict_lambda, 0, __pyx_n_s_py_extract_dict_locals_lambda, NULL, __pyx_n_s_cpp_process, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(0, 940, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -13382,7 +14034,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ __pyx_t_10 = 0; goto __pyx_L0; - /* "cpp_process.pyx":911 + /* "cpp_process.pyx":916 * return result_list * * cdef inline py_extract_dict(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -13409,7 +14061,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_dict(PyObject *_ return __pyx_r; } -/* "cpp_process.pyx":973 +/* "cpp_process.pyx":978 * result_list.append((choice, score, i)) * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) # <<<<<<<<<<<<<< @@ -13463,12 +14115,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 973, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda1") < 0)) __PYX_ERR(0, 978, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -13479,7 +14131,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda1", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 973, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda1", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 978, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cpp_process.py_extract_list.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -13501,9 +14153,9 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); - __Pyx_TraceCall("lambda1", __pyx_f[0], 973, 0, __PYX_ERR(0, 973, __pyx_L1_error)); + __Pyx_TraceCall("lambda1", __pyx_f[0], 978, 0, __PYX_ERR(0, 978, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13521,7 +14173,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "cpp_process.pyx":943 +/* "cpp_process.pyx":948 * * * cdef inline py_extract_list(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -13552,108 +14204,108 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("py_extract_list", 0); - __Pyx_TraceCall("py_extract_list", __pyx_f[0], 943, 0, __PYX_ERR(0, 943, __pyx_L1_error)); + __Pyx_TraceCall("py_extract_list", __pyx_f[0], 948, 0, __PYX_ERR(0, 948, __pyx_L1_error)); - /* "cpp_process.pyx":944 + /* "cpp_process.pyx":949 * * cdef inline py_extract_list(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): * cdef object score = None # <<<<<<<<<<<<<< * # todo working directly with a list is relatively slow * # also it is not very memory efficient to allocate space for all elements even when only */ - __Pyx_TraceLine(944,0,__PYX_ERR(0, 944, __pyx_L1_error)) + __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error)) __Pyx_INCREF(Py_None); __pyx_v_score = Py_None; - /* "cpp_process.pyx":948 + /* "cpp_process.pyx":953 * # also it is not very memory efficient to allocate space for all elements even when only * # a part is used. This should be optimised in the future * cdef list result_list = [] # <<<<<<<<<<<<<< * cdef size_t i * */ - __Pyx_TraceLine(948,0,__PYX_ERR(0, 948, __pyx_L1_error)) - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __Pyx_TraceLine(953,0,__PYX_ERR(0, 953, __pyx_L1_error)) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":951 + /* "cpp_process.pyx":956 * cdef size_t i * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = score_cutoff * */ - __Pyx_TraceLine(951,0,__PYX_ERR(0, 951, __pyx_L1_error)) + __Pyx_TraceLine(956,0,__PYX_ERR(0, 956, __pyx_L1_error)) if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 951, __pyx_L1_error) + __PYX_ERR(0, 956, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 951, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 956, __pyx_L1_error) - /* "cpp_process.pyx":952 + /* "cpp_process.pyx":957 * * kwargs["processor"] = None * kwargs["score_cutoff"] = score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(952,0,__PYX_ERR(0, 952, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) + __Pyx_TraceLine(957,0,__PYX_ERR(0, 957, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 952, __pyx_L1_error) + __PYX_ERR(0, 957, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 952, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":954 + /* "cpp_process.pyx":959 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error)) + __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":955 + /* "cpp_process.pyx":960 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error)) + __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error)) __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_1 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 960, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 960, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -13663,7 +14315,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 955, __pyx_L1_error) + else __PYX_ERR(0, 960, __pyx_L1_error) } break; } @@ -13674,29 +14326,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":956 + /* "cpp_process.pyx":961 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(956,0,__PYX_ERR(0, 956, __pyx_L1_error)) + __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error)) __pyx_t_3 = (__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":957 + /* "cpp_process.pyx":962 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(957,0,__PYX_ERR(0, 957, __pyx_L1_error)) + __Pyx_TraceLine(962,0,__PYX_ERR(0, 962, __pyx_L1_error)) goto __pyx_L4_continue; - /* "cpp_process.pyx":956 + /* "cpp_process.pyx":961 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -13705,14 +14357,14 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ */ } - /* "cpp_process.pyx":959 + /* "cpp_process.pyx":964 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error)) + __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_8 = __pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -13730,11 +14382,11 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -13744,44 +14396,44 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __pyx_t_7 = 0; if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 959, __pyx_L1_error) + __PYX_ERR(0, 964, __pyx_L1_error) } - __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":961 + /* "cpp_process.pyx":966 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * result_list.append((choice, score, i)) * else: */ - __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 961, __pyx_L1_error) + __Pyx_TraceLine(966,0,__PYX_ERR(0, 966, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "cpp_process.pyx":962 + /* "cpp_process.pyx":967 * * if score >= score_cutoff: * result_list.append((choice, score, i)) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(962,0,__PYX_ERR(0, 962, __pyx_L1_error)) - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_TraceLine(967,0,__PYX_ERR(0, 967, __pyx_L1_error)) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_choice); __Pyx_GIVEREF(__pyx_v_choice); @@ -13792,10 +14444,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_9); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_9); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":961 + /* "cpp_process.pyx":966 * score = scorer(query, processor(choice), **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -13804,19 +14456,19 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ */ } - /* "cpp_process.pyx":955 + /* "cpp_process.pyx":960 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error)) + __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error)) __pyx_L4_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":954 + /* "cpp_process.pyx":959 * kwargs["score_cutoff"] = score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -13826,40 +14478,40 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ goto __pyx_L3; } - /* "cpp_process.pyx":964 + /* "cpp_process.pyx":969 * result_list.append((choice, score, i)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error)) + __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error)) /*else*/ { __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { __pyx_t_1 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 969, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 969, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -13869,7 +14521,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 964, __pyx_L1_error) + else __PYX_ERR(0, 969, __pyx_L1_error) } break; } @@ -13880,29 +14532,29 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":965 + /* "cpp_process.pyx":970 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error)) + __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":966 + /* "cpp_process.pyx":971 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(966,0,__PYX_ERR(0, 966, __pyx_L1_error)) + __Pyx_TraceLine(971,0,__PYX_ERR(0, 971, __pyx_L1_error)) goto __pyx_L8_continue; - /* "cpp_process.pyx":965 + /* "cpp_process.pyx":970 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -13911,15 +14563,15 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ */ } - /* "cpp_process.pyx":968 + /* "cpp_process.pyx":973 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error)) - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error) + __Pyx_TraceLine(973,0,__PYX_ERR(0, 973, __pyx_L1_error)) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); @@ -13929,44 +14581,44 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_choice); if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 968, __pyx_L1_error) + __PYX_ERR(0, 973, __pyx_L1_error) } - __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_7 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":970 + /* "cpp_process.pyx":975 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * result_list.append((choice, score, i)) * */ - __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 970, __pyx_L1_error) + __Pyx_TraceLine(975,0,__PYX_ERR(0, 975, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(__pyx_v_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":971 + /* "cpp_process.pyx":976 * * if score >= score_cutoff: * result_list.append((choice, score, i)) # <<<<<<<<<<<<<< * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) */ - __Pyx_TraceLine(971,0,__PYX_ERR(0, 971, __pyx_L1_error)) - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 971, __pyx_L1_error) + __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error)) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_choice); __Pyx_GIVEREF(__pyx_v_choice); @@ -13977,10 +14629,10 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":970 + /* "cpp_process.pyx":975 * score = scorer(query, choice, **kwargs) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -13989,37 +14641,37 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ */ } - /* "cpp_process.pyx":964 + /* "cpp_process.pyx":969 * result_list.append((choice, score, i)) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error)) + __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error)) __pyx_L8_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; - /* "cpp_process.pyx":973 + /* "cpp_process.pyx":978 * result_list.append((choice, score, i)) * * return heapq.nlargest(limit, result_list, key=lambda i: i[1]) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(973,0,__PYX_ERR(0, 973, __pyx_L1_error)) + __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_heapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_heapq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlargest); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nlargest); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); @@ -14027,13 +14679,13 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __Pyx_GIVEREF(__pyx_v_result_list); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_result_list); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_15py_extract_list_lambda1, 0, __pyx_n_s_py_extract_list_locals_lambda, NULL, __pyx_n_s_cpp_process, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_15py_extract_list_lambda1, 0, __pyx_n_s_py_extract_list_locals_lambda, NULL, __pyx_n_s_cpp_process, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 973, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -14042,7 +14694,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ __pyx_t_9 = 0; goto __pyx_L0; - /* "cpp_process.pyx":943 + /* "cpp_process.pyx":948 * * * cdef inline py_extract_list(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< @@ -14068,7 +14720,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ return __pyx_r; } -/* "cpp_process.pyx":976 +/* "cpp_process.pyx":981 * * * def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -14076,7 +14728,7 @@ static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_extract_list(PyObject *_ * Find the best matches in a list of choices. The list is sorted by the similarity. */ -static PyObject *__pyx_pf_11cpp_process_9__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_11cpp_process_11__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -14086,15 +14738,15 @@ static PyObject *__pyx_pf_11cpp_process_9__defaults__(CYTHON_UNUSED PyObject *__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); - __Pyx_TraceCall("__defaults__", __pyx_f[0], 976, 0, __PYX_ERR(0, 976, __pyx_L1_error)); + __Pyx_TraceCall("__defaults__", __pyx_f[0], 981, 0, __PYX_ERR(0, 981, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 976, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 976, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, ((PyObject *)__pyx_int_5)) < 0) __PYX_ERR(0, 976, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 976, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_limit, ((PyObject *)__pyx_int_5)) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -14127,7 +14779,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cpp_process_2extract, "\n Find the best matches in a list of choices. The list is sorted by the similarity.\n When multiple choices have the same similarity, they are sorted by their index\n\n Parameters\n ----------\n query : str\n string we want to find\n choices : Iterable\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n limit : int\n maximum amount of results to return\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n List[Tuple[str, Any, Any]]\n The return type is always a List of Tuples with 3 elements. However the values stored in the\n tuple depend on the types of the input arguments.\n\n * The first"" element is always the `choice`, which is the value thats compared to the query.\n\n * The second value represents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= max` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n The list is sorted by `score_cutoff` or `max` depending on the scorer used. The first element in the list\n has the `highest similarity`/`smallest distance`.\n\n "); +PyDoc_STRVAR(__pyx_doc_11cpp_process_2extract, "\n Find the best matches in a list of choices. The list is sorted by the similarity.\n When multiple choices have the same similarity, they are sorted by their index\n\n Parameters\n ----------\n query : Sequence[Hashable]\n string we want to find\n choices : Collection[Sequence[Hashable]] | Mapping[Sequence[Hashable]]\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n limit : int\n maximum amount of results to return\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n List[Tuple[Sequence[Hashable], Any, Any]]\n The return type is always a List of Tuples with 3 elements. However the values stored in the""\n tuple depend on the types of the input arguments.\n\n * The first element is always the `choice`, which is the value thats compared to the query.\n\n * The second value represents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= max` are returned.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are returned.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n The list is sorted by `score_cutoff` or `max` depending on the scorer used. The first element in the list\n has the `highest similarity`/`smallest distance`.\n\n "); static PyMethodDef __pyx_mdef_11cpp_process_3extract = {"extract", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cpp_process_3extract, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cpp_process_2extract}; static PyObject *__pyx_pw_11cpp_process_3extract(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -14181,14 +14833,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_choices)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("extract", 1, 2, 2, 1); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extract", 1, 2, 2, 1); __PYX_ERR(0, 981, __pyx_L3_error) } } if (kw_args > 0 && (kw_args <= 4)) { @@ -14196,12 +14848,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 2; index < 6 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extract") < 0)) __PYX_ERR(0, 976, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extract") < 0)) __PYX_ERR(0, 981, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14218,7 +14870,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 976, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extract", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 981, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("cpp_process.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -14259,69 +14911,69 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s int __pyx_clineno = 0; __Pyx_TraceFrameInit(__pyx_codeobj__4) __Pyx_RefNannySetupContext("extract", 0); - __Pyx_TraceCall("extract", __pyx_f[0], 976, 0, __PYX_ERR(0, 976, __pyx_L1_error)); + __Pyx_TraceCall("extract", __pyx_f[0], 981, 0, __PYX_ERR(0, 981, __pyx_L1_error)); __Pyx_INCREF(__pyx_v_query); __Pyx_INCREF(__pyx_v_processor); __Pyx_INCREF(__pyx_v_limit); - /* "cpp_process.pyx":1037 + /* "cpp_process.pyx":1042 * * """ * cdef int def_process = 0 # <<<<<<<<<<<<<< * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext */ - __Pyx_TraceLine(1037,0,__PYX_ERR(0, 1037, __pyx_L1_error)) + __Pyx_TraceLine(1042,0,__PYX_ERR(0, 1042, __pyx_L1_error)) __pyx_v_def_process = 0; - /* "cpp_process.pyx":1040 + /* "cpp_process.pyx":1045 * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 # <<<<<<<<<<<<<< * cdef size_t c_max = -1 * */ - __Pyx_TraceLine(1040,0,__PYX_ERR(0, 1040, __pyx_L1_error)) + __Pyx_TraceLine(1045,0,__PYX_ERR(0, 1045, __pyx_L1_error)) __pyx_v_c_score_cutoff = 0.0; - /* "cpp_process.pyx":1041 + /* "cpp_process.pyx":1046 * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 * cdef size_t c_max = -1 # <<<<<<<<<<<<<< * * if query is None: */ - __Pyx_TraceLine(1041,0,__PYX_ERR(0, 1041, __pyx_L1_error)) + __Pyx_TraceLine(1046,0,__PYX_ERR(0, 1046, __pyx_L1_error)) __pyx_v_c_max = ((size_t)-1L); - /* "cpp_process.pyx":1043 + /* "cpp_process.pyx":1048 * cdef size_t c_max = -1 * * if query is None: # <<<<<<<<<<<<<< * return [] * */ - __Pyx_TraceLine(1043,0,__PYX_ERR(0, 1043, __pyx_L1_error)) + __Pyx_TraceLine(1048,0,__PYX_ERR(0, 1048, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_query == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1044 + /* "cpp_process.pyx":1049 * * if query is None: * return [] # <<<<<<<<<<<<<< * * if limit is None or limit > len(choices): */ - __Pyx_TraceLine(1044,0,__PYX_ERR(0, 1044, __pyx_L1_error)) + __Pyx_TraceLine(1049,0,__PYX_ERR(0, 1049, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "cpp_process.pyx":1043 + /* "cpp_process.pyx":1048 * cdef size_t c_max = -1 * * if query is None: # <<<<<<<<<<<<<< @@ -14330,14 +14982,14 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1046 + /* "cpp_process.pyx":1051 * return [] * * if limit is None or limit > len(choices): # <<<<<<<<<<<<<< * limit = len(choices) * */ - __Pyx_TraceLine(1046,0,__PYX_ERR(0, 1046, __pyx_L1_error)) + __Pyx_TraceLine(1051,0,__PYX_ERR(0, 1051, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_limit == Py_None); __pyx_t_4 = (__pyx_t_1 != 0); if (!__pyx_t_4) { @@ -14345,32 +14997,32 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_5 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1046, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_limit, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_limit, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":1047 + /* "cpp_process.pyx":1052 * * if limit is None or limit > len(choices): * limit = len(choices) # <<<<<<<<<<<<<< * * # preprocess the query */ - __Pyx_TraceLine(1047,0,__PYX_ERR(0, 1047, __pyx_L1_error)) - __pyx_t_5 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1047, __pyx_L1_error) - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_TraceLine(1052,0,__PYX_ERR(0, 1052, __pyx_L1_error)) + __pyx_t_5 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_limit, __pyx_t_6); __pyx_t_6 = 0; - /* "cpp_process.pyx":1046 + /* "cpp_process.pyx":1051 * return [] * * if limit is None or limit > len(choices): # <<<<<<<<<<<<<< @@ -14379,39 +15031,39 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1050 + /* "cpp_process.pyx":1055 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< * def_process = 1 * # since this call is only performed once it is not very expensive to */ - __Pyx_TraceLine(1050,0,__PYX_ERR(0, 1050, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_default_process); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_TraceLine(1055,0,__PYX_ERR(0, 1055, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_default_process); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__pyx_v_processor == __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { - /* "cpp_process.pyx":1051 + /* "cpp_process.pyx":1056 * # preprocess the query * if processor is default_process: * def_process = 1 # <<<<<<<<<<<<<< * # since this call is only performed once it is not very expensive to * # make it in Python */ - __Pyx_TraceLine(1051,0,__PYX_ERR(0, 1051, __pyx_L1_error)) + __Pyx_TraceLine(1056,0,__PYX_ERR(0, 1056, __pyx_L1_error)) __pyx_v_def_process = 1; - /* "cpp_process.pyx":1054 + /* "cpp_process.pyx":1059 * # since this call is only performed once it is not very expensive to * # make it in Python * query = processor(query) # <<<<<<<<<<<<<< * processor = None * elif callable(processor): */ - __Pyx_TraceLine(1054,0,__PYX_ERR(0, 1054, __pyx_L1_error)) + __Pyx_TraceLine(1059,0,__PYX_ERR(0, 1059, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_3 = __pyx_v_processor; __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -14429,25 +15081,25 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_query}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1054, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6); __pyx_t_6 = 0; - /* "cpp_process.pyx":1055 + /* "cpp_process.pyx":1060 * # make it in Python * query = processor(query) * processor = None # <<<<<<<<<<<<<< * elif callable(processor): * query = processor(query) */ - __Pyx_TraceLine(1055,0,__PYX_ERR(0, 1055, __pyx_L1_error)) + __Pyx_TraceLine(1060,0,__PYX_ERR(0, 1060, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); - /* "cpp_process.pyx":1050 + /* "cpp_process.pyx":1055 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< @@ -14457,26 +15109,26 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L7; } - /* "cpp_process.pyx":1056 + /* "cpp_process.pyx":1061 * query = processor(query) * processor = None * elif callable(processor): # <<<<<<<<<<<<<< * query = processor(query) * elif processor: */ - __Pyx_TraceLine(1056,0,__PYX_ERR(0, 1056, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1056, __pyx_L1_error) + __Pyx_TraceLine(1061,0,__PYX_ERR(0, 1061, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1061, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1057 + /* "cpp_process.pyx":1062 * processor = None * elif callable(processor): * query = processor(query) # <<<<<<<<<<<<<< * elif processor: * def_process = 1 */ - __Pyx_TraceLine(1057,0,__PYX_ERR(0, 1057, __pyx_L1_error)) + __Pyx_TraceLine(1062,0,__PYX_ERR(0, 1062, __pyx_L1_error)) __Pyx_INCREF(__pyx_v_processor); __pyx_t_3 = __pyx_v_processor; __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -14490,70 +15142,6 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_8 = 1; } } - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_query}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1057, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6); - __pyx_t_6 = 0; - - /* "cpp_process.pyx":1056 - * query = processor(query) - * processor = None - * elif callable(processor): # <<<<<<<<<<<<<< - * query = processor(query) - * elif processor: - */ - goto __pyx_L7; - } - - /* "cpp_process.pyx":1058 - * elif callable(processor): - * query = processor(query) - * elif processor: # <<<<<<<<<<<<<< - * def_process = 1 - * # since this call is only performed once it is not very expensive to - */ - __Pyx_TraceLine(1058,0,__PYX_ERR(0, 1058, __pyx_L1_error)) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) - if (__pyx_t_2) { - - /* "cpp_process.pyx":1059 - * query = processor(query) - * elif processor: - * def_process = 1 # <<<<<<<<<<<<<< - * # since this call is only performed once it is not very expensive to - * # make it in Python - */ - __Pyx_TraceLine(1059,0,__PYX_ERR(0, 1059, __pyx_L1_error)) - __pyx_v_def_process = 1; - - /* "cpp_process.pyx":1062 - * # since this call is only performed once it is not very expensive to - * # make it in Python - * query = default_process(query) # <<<<<<<<<<<<<< - * processor = None - * # query might be e.g. False - */ - __Pyx_TraceLine(1062,0,__PYX_ERR(0, 1062, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; - } - } { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_query}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); @@ -14565,18 +15153,82 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6); __pyx_t_6 = 0; - /* "cpp_process.pyx":1063 + /* "cpp_process.pyx":1061 + * query = processor(query) + * processor = None + * elif callable(processor): # <<<<<<<<<<<<<< + * query = processor(query) + * elif processor: + */ + goto __pyx_L7; + } + + /* "cpp_process.pyx":1063 + * elif callable(processor): + * query = processor(query) + * elif processor: # <<<<<<<<<<<<<< + * def_process = 1 + * # since this call is only performed once it is not very expensive to + */ + __Pyx_TraceLine(1063,0,__PYX_ERR(0, 1063, __pyx_L1_error)) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) + if (__pyx_t_2) { + + /* "cpp_process.pyx":1064 + * query = processor(query) + * elif processor: + * def_process = 1 # <<<<<<<<<<<<<< + * # since this call is only performed once it is not very expensive to + * # make it in Python + */ + __Pyx_TraceLine(1064,0,__PYX_ERR(0, 1064, __pyx_L1_error)) + __pyx_v_def_process = 1; + + /* "cpp_process.pyx":1067 + * # since this call is only performed once it is not very expensive to + * # make it in Python + * query = default_process(query) # <<<<<<<<<<<<<< + * processor = None + * # query might be e.g. False + */ + __Pyx_TraceLine(1067,0,__PYX_ERR(0, 1067, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_process); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_query}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1068 * # make it in Python * query = default_process(query) * processor = None # <<<<<<<<<<<<<< * # query might be e.g. False * else: */ - __Pyx_TraceLine(1063,0,__PYX_ERR(0, 1063, __pyx_L1_error)) + __Pyx_TraceLine(1068,0,__PYX_ERR(0, 1068, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); - /* "cpp_process.pyx":1058 + /* "cpp_process.pyx":1063 * elif callable(processor): * query = processor(query) * elif processor: # <<<<<<<<<<<<<< @@ -14586,76 +15238,76 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s goto __pyx_L7; } - /* "cpp_process.pyx":1066 + /* "cpp_process.pyx":1071 * # query might be e.g. False * else: * processor = None # <<<<<<<<<<<<<< * * if IsIntegratedScorer(scorer): */ - __Pyx_TraceLine(1066,0,__PYX_ERR(0, 1066, __pyx_L1_error)) + __Pyx_TraceLine(1071,0,__PYX_ERR(0, 1071, __pyx_L1_error)) /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_processor, Py_None); } __pyx_L7:; - /* "cpp_process.pyx":1068 + /* "cpp_process.pyx":1073 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< * # directly use the C++ implementation if possible * query_context = conv_sequence(query) */ - __Pyx_TraceLine(1068,0,__PYX_ERR(0, 1068, __pyx_L1_error)) + __Pyx_TraceLine(1073,0,__PYX_ERR(0, 1073, __pyx_L1_error)) __pyx_t_2 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1070 + /* "cpp_process.pyx":1075 * if IsIntegratedScorer(scorer): * # directly use the C++ implementation if possible * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: */ - __Pyx_TraceLine(1070,0,__PYX_ERR(0, 1070, __pyx_L1_error)) - __pyx_t_9 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_TraceLine(1075,0,__PYX_ERR(0, 1075, __pyx_L1_error)) + __pyx_t_9 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1075, __pyx_L1_error) __pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9); - /* "cpp_process.pyx":1071 + /* "cpp_process.pyx":1076 * # directly use the C++ implementation if possible * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None: * c_score_cutoff = score_cutoff */ - __Pyx_TraceLine(1071,0,__PYX_ERR(0, 1071, __pyx_L1_error)) + __Pyx_TraceLine(1076,0,__PYX_ERR(0, 1076, __pyx_L1_error)) __pyx_v_ScorerContext = __pyx_f_11cpp_process_CachedScorerInit(__pyx_v_scorer, __pyx_v_query_context, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":1072 + /* "cpp_process.pyx":1077 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: */ - __Pyx_TraceLine(1072,0,__PYX_ERR(0, 1072, __pyx_L1_error)) + __Pyx_TraceLine(1077,0,__PYX_ERR(0, 1077, __pyx_L1_error)) __pyx_t_2 = (__pyx_v_score_cutoff != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { - /* "cpp_process.pyx":1073 + /* "cpp_process.pyx":1078 * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") */ - __Pyx_TraceLine(1073,0,__PYX_ERR(0, 1073, __pyx_L1_error)) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_TraceLine(1078,0,__PYX_ERR(0, 1078, __pyx_L1_error)) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1078, __pyx_L1_error) __pyx_v_c_score_cutoff = __pyx_t_10; - /* "cpp_process.pyx":1072 + /* "cpp_process.pyx":1077 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -14664,14 +15316,14 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1074 + /* "cpp_process.pyx":1079 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * */ - __Pyx_TraceLine(1074,0,__PYX_ERR(0, 1074, __pyx_L1_error)) + __Pyx_TraceLine(1079,0,__PYX_ERR(0, 1079, __pyx_L1_error)) __pyx_t_2 = ((__pyx_v_c_score_cutoff < 0.0) != 0); if (!__pyx_t_2) { } else { @@ -14683,21 +15335,21 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s __pyx_L11_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "cpp_process.pyx":1075 + /* "cpp_process.pyx":1080 * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1075,0,__PYX_ERR(0, 1075, __pyx_L1_error)) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1075, __pyx_L1_error) + __Pyx_TraceLine(1080,0,__PYX_ERR(0, 1080, __pyx_L1_error)) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 1075, __pyx_L1_error) + __PYX_ERR(0, 1080, __pyx_L1_error) - /* "cpp_process.pyx":1074 + /* "cpp_process.pyx":1079 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< @@ -14706,35 +15358,35 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1077 + /* "cpp_process.pyx":1082 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return extract_dict(move(ScorerContext), choices, processor, limit, c_score_cutoff) * else: */ - __Pyx_TraceLine(1077,0,__PYX_ERR(0, 1077, __pyx_L1_error)) - __pyx_t_4 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_TraceLine(1082,0,__PYX_ERR(0, 1082, __pyx_L1_error)) + __pyx_t_4 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1082, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1078 + /* "cpp_process.pyx":1083 * * if hasattr(choices, "items"): * return extract_dict(move(ScorerContext), choices, processor, limit, c_score_cutoff) # <<<<<<<<<<<<<< * else: * return extract_list(move(ScorerContext), choices, processor, limit, c_score_cutoff) */ - __Pyx_TraceLine(1078,0,__PYX_ERR(0, 1078, __pyx_L1_error)) + __Pyx_TraceLine(1083,0,__PYX_ERR(0, 1083, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1078, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_extract_dict(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_extract_dict(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cpp_process.pyx":1077 + /* "cpp_process.pyx":1082 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -14743,25 +15395,25 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1080 + /* "cpp_process.pyx":1085 * return extract_dict(move(ScorerContext), choices, processor, limit, c_score_cutoff) * else: * return extract_list(move(ScorerContext), choices, processor, limit, c_score_cutoff) # <<<<<<<<<<<<<< * * if IsIntegratedDistance(scorer): */ - __Pyx_TraceLine(1080,0,__PYX_ERR(0, 1080, __pyx_L1_error)) + __Pyx_TraceLine(1085,0,__PYX_ERR(0, 1085, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_extract_list(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_extract_list(cython_std::move(__pyx_v_ScorerContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":1068 + /* "cpp_process.pyx":1073 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< @@ -14770,46 +15422,46 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1082 + /* "cpp_process.pyx":1087 * return extract_list(move(ScorerContext), choices, processor, limit, c_score_cutoff) * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< * # distance implemented in C++ * query_context = conv_sequence(query) */ - __Pyx_TraceLine(1082,0,__PYX_ERR(0, 1082, __pyx_L1_error)) + __Pyx_TraceLine(1087,0,__PYX_ERR(0, 1087, __pyx_L1_error)) __pyx_t_2 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1084 + /* "cpp_process.pyx":1089 * if IsIntegratedDistance(scorer): * # distance implemented in C++ * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: */ - __Pyx_TraceLine(1084,0,__PYX_ERR(0, 1084, __pyx_L1_error)) - __pyx_t_9 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_TraceLine(1089,0,__PYX_ERR(0, 1089, __pyx_L1_error)) + __pyx_t_9 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L1_error) __pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9); - /* "cpp_process.pyx":1085 + /* "cpp_process.pyx":1090 * # distance implemented in C++ * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff */ - __Pyx_TraceLine(1085,0,__PYX_ERR(0, 1085, __pyx_L1_error)) + __Pyx_TraceLine(1090,0,__PYX_ERR(0, 1090, __pyx_L1_error)) __pyx_v_DistanceContext = __pyx_f_11cpp_process_CachedDistanceInit(__pyx_v_scorer, __pyx_v_query_context, __pyx_v_def_process, __pyx_v_kwargs); - /* "cpp_process.pyx":1086 + /* "cpp_process.pyx":1091 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< * c_max = score_cutoff * */ - __Pyx_TraceLine(1086,0,__PYX_ERR(0, 1086, __pyx_L1_error)) + __Pyx_TraceLine(1091,0,__PYX_ERR(0, 1091, __pyx_L1_error)) __pyx_t_4 = (__pyx_v_score_cutoff != Py_None); __pyx_t_1 = (__pyx_t_4 != 0); if (__pyx_t_1) { @@ -14817,26 +15469,26 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s __pyx_t_2 = __pyx_t_1; goto __pyx_L16_bool_binop_done; } - __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1086, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_process.pyx":1087 + /* "cpp_process.pyx":1092 * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1087,0,__PYX_ERR(0, 1087, __pyx_L1_error)) - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error) + __Pyx_TraceLine(1092,0,__PYX_ERR(0, 1092, __pyx_L1_error)) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error) __pyx_v_c_max = __pyx_t_11; - /* "cpp_process.pyx":1086 + /* "cpp_process.pyx":1091 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< @@ -14845,35 +15497,35 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1089 + /* "cpp_process.pyx":1094 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return extract_distance_dict(move(DistanceContext), choices, processor, limit, c_max) * else: */ - __Pyx_TraceLine(1089,0,__PYX_ERR(0, 1089, __pyx_L1_error)) - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1089, __pyx_L1_error) + __Pyx_TraceLine(1094,0,__PYX_ERR(0, 1094, __pyx_L1_error)) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1094, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1090 + /* "cpp_process.pyx":1095 * * if hasattr(choices, "items"): * return extract_distance_dict(move(DistanceContext), choices, processor, limit, c_max) # <<<<<<<<<<<<<< * else: * return extract_distance_list(move(DistanceContext), choices, processor, limit, c_max) */ - __Pyx_TraceLine(1090,0,__PYX_ERR(0, 1090, __pyx_L1_error)) + __Pyx_TraceLine(1095,0,__PYX_ERR(0, 1095, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_extract_distance_dict(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_extract_distance_dict(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cpp_process.pyx":1089 + /* "cpp_process.pyx":1094 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -14882,25 +15534,25 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1092 + /* "cpp_process.pyx":1097 * return extract_distance_dict(move(DistanceContext), choices, processor, limit, c_max) * else: * return extract_distance_list(move(DistanceContext), choices, processor, limit, c_max) # <<<<<<<<<<<<<< * * # the scorer has to be called through Python */ - __Pyx_TraceLine(1092,0,__PYX_ERR(0, 1092, __pyx_L1_error)) + __Pyx_TraceLine(1097,0,__PYX_ERR(0, 1097, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_extract_distance_list(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1092, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_extract_distance_list(cython_std::move(__pyx_v_DistanceContext), __pyx_v_choices, __pyx_v_processor, __pyx_t_11, __pyx_v_c_max); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":1082 + /* "cpp_process.pyx":1087 * return extract_list(move(ScorerContext), choices, processor, limit, c_score_cutoff) * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< @@ -14909,30 +15561,30 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1095 + /* "cpp_process.pyx":1100 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * */ - __Pyx_TraceLine(1095,0,__PYX_ERR(0, 1095, __pyx_L1_error)) + __Pyx_TraceLine(1100,0,__PYX_ERR(0, 1100, __pyx_L1_error)) __pyx_t_1 = (__pyx_v_score_cutoff != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1096 + /* "cpp_process.pyx":1101 * # the scorer has to be called through Python * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1096,0,__PYX_ERR(0, 1096, __pyx_L1_error)) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __Pyx_TraceLine(1101,0,__PYX_ERR(0, 1101, __pyx_L1_error)) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L1_error) __pyx_v_c_score_cutoff = __pyx_t_10; - /* "cpp_process.pyx":1095 + /* "cpp_process.pyx":1100 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -14941,35 +15593,35 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1098 + /* "cpp_process.pyx":1103 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * return py_extract_dict(query, choices, scorer, processor, limit, c_score_cutoff, kwargs) * else: */ - __Pyx_TraceLine(1098,0,__PYX_ERR(0, 1098, __pyx_L1_error)) - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_TraceLine(1103,0,__PYX_ERR(0, 1103, __pyx_L1_error)) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_choices, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1103, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1099 + /* "cpp_process.pyx":1104 * * if hasattr(choices, "items"): * return py_extract_dict(query, choices, scorer, processor, limit, c_score_cutoff, kwargs) # <<<<<<<<<<<<<< * else: * return py_extract_list(query, choices, scorer, processor, limit, c_score_cutoff, kwargs) */ - __Pyx_TraceLine(1099,0,__PYX_ERR(0, 1099, __pyx_L1_error)) + __Pyx_TraceLine(1104,0,__PYX_ERR(0, 1104, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_py_extract_dict(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_py_extract_dict(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "cpp_process.pyx":1098 + /* "cpp_process.pyx":1103 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -14978,25 +15630,25 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s */ } - /* "cpp_process.pyx":1101 + /* "cpp_process.pyx":1106 * return py_extract_dict(query, choices, scorer, processor, limit, c_score_cutoff, kwargs) * else: * return py_extract_list(query, choices, scorer, processor, limit, c_score_cutoff, kwargs) # <<<<<<<<<<<<<< * * */ - __Pyx_TraceLine(1101,0,__PYX_ERR(0, 1101, __pyx_L1_error)) + __Pyx_TraceLine(1106,0,__PYX_ERR(0, 1106, __pyx_L1_error)) /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L1_error) - __pyx_t_6 = __pyx_f_11cpp_process_py_extract_list(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_v_limit); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_6 = __pyx_f_11cpp_process_py_extract_list(__pyx_v_query, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_t_11, __pyx_v_c_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } - /* "cpp_process.pyx":976 + /* "cpp_process.pyx":981 * * * def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -15022,7 +15674,7 @@ static PyObject *__pyx_pf_11cpp_process_2extract(CYTHON_UNUSED PyObject *__pyx_s } static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1104 +/* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -15030,7 +15682,7 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ * Find the best match in a list of choices */ -static PyObject *__pyx_pf_11cpp_process_11__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_11cpp_process_13__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_TraceDeclarations __Pyx_RefNannyDeclarations @@ -15040,14 +15692,14 @@ static PyObject *__pyx_pf_11cpp_process_11__defaults__(CYTHON_UNUSED PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); - __Pyx_TraceCall("__defaults__", __pyx_f[0], 1104, 0, __PYX_ERR(0, 1104, __pyx_L1_error)); + __Pyx_TraceCall("__defaults__", __pyx_f[0], 1109, 0, __PYX_ERR(0, 1109, __pyx_L1_error)); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_processor) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -15080,7 +15732,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cpp_process_4extract_iter, "\n Find the best match in a list of choices\n\n Parameters\n ----------\n query : str\n string we want to find\n choices : Iterable\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Yields\n -------\n Tuple[str, Any, Any]\n Yields similarity between the query and each choice in form of a Tuple with 3 elements.\n The values stored in the tuple depend on the types of the input arguments.\n\n * The first element is always the current `choice`, which is the value thats compared to the query.\n\n * The second value represents the similarity calculated by the scorer. Thi""s can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= max` are yielded.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are yielded.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n "); +PyDoc_STRVAR(__pyx_doc_11cpp_process_4extract_iter, "\n Find the best match in a list of choices\n\n Parameters\n ----------\n query : Sequence[Hashable]\n string we want to find\n choices : Iterable[Sequence[Hashable]] | Mapping[Sequence[Hashable]]\n list of all strings the query should be compared with or dict with a mapping\n {: }\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance), or\n a custom function, which returns a normalized edit distance.\n fuzz.WRatio is used by default.\n processor : Callable, optional\n Optional callable that reformats the strings.\n utils.default_process is used by default, which lowercases the strings and trims whitespace\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are ignored. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are ignored. For edit distances this defaults to\n -1, while for normalized edit distances this defaults to 0.0, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Yields\n -------\n Tuple[Sequence[Hashable], Any, Any]\n Yields similarity between the query and each choice in form of a Tuple with 3 elements.\n The values stored in the tuple depend on the types of the input arguments.\n\n * The first element is always the current `choice`, which is the value thats compared to the query.\n""\n * The second value represents the similarity calculated by the scorer. This can be:\n\n * An edit distance (distance is 0 for a perfect match and > 0 for non perfect matches).\n In this case only choices which have a `distance <= max` are yielded.\n An example of a scorer with this behavior is `string_metric.levenshtein`.\n * A normalized edit distance (similarity is a score between 0 and 100, with 100 being a perfect match).\n In this case only choices which have a `similarity >= score_cutoff` are yielded.\n An example of a scorer with this behavior is `string_metric.normalized_levenshtein`.\n\n Note, that for all scorers, which are not provided by RapidFuzz, only normalized edit distances are supported.\n\n * The third parameter depends on the type of the `choices` argument it is:\n\n * The `index of choice` when choices is a simple iterable like a list\n * The `key of choice` when choices is a mapping like a dict, or a pandas Series\n\n "); static PyMethodDef __pyx_mdef_11cpp_process_5extract_iter = {"extract_iter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cpp_process_5extract_iter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cpp_process_4extract_iter}; static PyObject *__pyx_pw_11cpp_process_5extract_iter(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -15132,14 +15784,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_choices)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("extract_iter", 1, 2, 2, 1); __PYX_ERR(0, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extract_iter", 1, 2, 2, 1); __PYX_ERR(0, 1109, __pyx_L3_error) } } if (kw_args > 0 && (kw_args <= 3)) { @@ -15147,12 +15799,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 2; index < 5 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extract_iter") < 0)) __PYX_ERR(0, 1104, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "extract_iter") < 0)) __PYX_ERR(0, 1109, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15168,7 +15820,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("extract_iter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("extract_iter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1109, __pyx_L3_error) __pyx_L3_error:; __Pyx_CLEAR(__pyx_v_kwargs); __Pyx_AddTraceback("cpp_process.extract_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15201,7 +15853,7 @@ static PyObject *__pyx_pf_11cpp_process_4extract_iter(CYTHON_UNUSED PyObject *__ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct__extract_iter *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1104, __pyx_L1_error) + __PYX_ERR(0, 1109, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15224,7 +15876,7 @@ static PyObject *__pyx_pf_11cpp_process_4extract_iter(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_6generator, __pyx_codeobj__5, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter, __pyx_n_s_extract_iter, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_6generator, __pyx_codeobj__5, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter, __pyx_n_s_extract_iter, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -15247,7 +15899,7 @@ static PyObject *__pyx_pf_11cpp_process_4extract_iter(CYTHON_UNUSED PyObject *__ } static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1165 +/* "cpp_process.pyx":1170 * cdef size_t c_max = -1 * * def extract_iter_dict(): # <<<<<<<<<<<<<< @@ -15283,7 +15935,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_extract_iter_dict(PyObjec if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_1_extract_iter_dict *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1165, __pyx_L1_error) + __PYX_ERR(0, 1170, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15291,7 +15943,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_extract_iter_dict(PyObjec __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_locals_extract_iter, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_locals_extract_iter, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -15329,7 +15981,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iter_dict", 0); - __Pyx_TraceCall("extract_iter_dict", __pyx_f[0], 1165, 0, __PYX_ERR(0, 1165, __pyx_L1_error)); + __Pyx_TraceCall("extract_iter_dict", __pyx_f[0], 1170, 0, __PYX_ERR(0, 1170, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L10_resume_from_yield; @@ -15340,36 +15992,36 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1165, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1170, __pyx_L1_error) - /* "cpp_process.pyx":1173 + /* "cpp_process.pyx":1178 * cdef double score * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(1173,0,__PYX_ERR(0, 1173, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1173, __pyx_L1_error) } + __Pyx_TraceLine(1178,0,__PYX_ERR(0, 1178, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1178, __pyx_L1_error) } __pyx_t_1 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1174 + /* "cpp_process.pyx":1179 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1174,0,__PYX_ERR(0, 1174, __pyx_L1_error)) + __Pyx_TraceLine(1179,0,__PYX_ERR(0, 1179, __pyx_L1_error)) __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1174, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1179, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1174, __pyx_L1_error) + __PYX_ERR(0, 1179, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -15377,7 +16029,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -15389,29 +16041,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1175 + /* "cpp_process.pyx":1180 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1175,0,__PYX_ERR(0, 1175, __pyx_L1_error)) + __Pyx_TraceLine(1180,0,__PYX_ERR(0, 1180, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1176 + /* "cpp_process.pyx":1181 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(1176,0,__PYX_ERR(0, 1176, __pyx_L1_error)) + __Pyx_TraceLine(1181,0,__PYX_ERR(0, 1181, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1175 + /* "cpp_process.pyx":1180 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -15420,15 +16072,15 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti */ } - /* "cpp_process.pyx":1178 + /* "cpp_process.pyx":1183 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(1178,0,__PYX_ERR(0, 1178, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1178, __pyx_L1_error) } + __Pyx_TraceLine(1183,0,__PYX_ERR(0, 1183, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1183, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_7 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -15446,7 +16098,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -15455,29 +16107,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1179 + /* "cpp_process.pyx":1184 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1179,0,__PYX_ERR(0, 1179, __pyx_L1_error)) + __Pyx_TraceLine(1184,0,__PYX_ERR(0, 1184, __pyx_L1_error)) __pyx_t_1 = (__pyx_cur_scope->__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1180 + /* "cpp_process.pyx":1185 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) */ - __Pyx_TraceLine(1180,0,__PYX_ERR(0, 1180, __pyx_L1_error)) + __Pyx_TraceLine(1185,0,__PYX_ERR(0, 1185, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1179 + /* "cpp_process.pyx":1184 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -15486,51 +16138,51 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti */ } - /* "cpp_process.pyx":1182 + /* "cpp_process.pyx":1187 * continue * * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(1182,0,__PYX_ERR(0, 1182, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_TraceLine(1187,0,__PYX_ERR(0, 1187, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1187, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ScorerContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1182, __pyx_L1_error) + __PYX_ERR(0, 1187, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":1184 + /* "cpp_process.pyx":1189 * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, choice_key) * else: */ - __Pyx_TraceLine(1184,0,__PYX_ERR(0, 1184, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_TraceLine(1189,0,__PYX_ERR(0, 1189, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff)) { __Pyx_RaiseClosureNameError("score_cutoff"); __PYX_ERR(0, 1184, __pyx_L1_error) } - __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff)) { __Pyx_RaiseClosureNameError("score_cutoff"); __PYX_ERR(0, 1189, __pyx_L1_error) } + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "cpp_process.pyx":1185 + /* "cpp_process.pyx":1190 * * if score >= score_cutoff: * yield (choice, score, choice_key) # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(1185,0,__PYX_ERR(0, 1185, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1185, __pyx_L1_error) + __Pyx_TraceLine(1190,0,__PYX_ERR(0, 1190, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1185, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -15562,9 +16214,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1185, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1190, __pyx_L1_error) - /* "cpp_process.pyx":1184 + /* "cpp_process.pyx":1189 * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -15576,7 +16228,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":1173 + /* "cpp_process.pyx":1178 * cdef double score * * if processor is not None: # <<<<<<<<<<<<<< @@ -15586,22 +16238,22 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti goto __pyx_L4; } - /* "cpp_process.pyx":1187 + /* "cpp_process.pyx":1192 * yield (choice, score, choice_key) * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1187,0,__PYX_ERR(0, 1187, __pyx_L1_error)) + __Pyx_TraceLine(1192,0,__PYX_ERR(0, 1192, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1187, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1192, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1187, __pyx_L1_error) + __PYX_ERR(0, 1192, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1187, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_8; @@ -15609,7 +16261,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1187, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -15621,29 +16273,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":1188 + /* "cpp_process.pyx":1193 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1188,0,__PYX_ERR(0, 1188, __pyx_L1_error)) + __Pyx_TraceLine(1193,0,__PYX_ERR(0, 1193, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1189 + /* "cpp_process.pyx":1194 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) */ - __Pyx_TraceLine(1189,0,__PYX_ERR(0, 1189, __pyx_L1_error)) + __Pyx_TraceLine(1194,0,__PYX_ERR(0, 1194, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":1188 + /* "cpp_process.pyx":1193 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -15652,51 +16304,51 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti */ } - /* "cpp_process.pyx":1191 + /* "cpp_process.pyx":1196 * continue * * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) # <<<<<<<<<<<<<< * * if score >= score_cutoff: */ - __Pyx_TraceLine(1191,0,__PYX_ERR(0, 1191, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_TraceLine(1196,0,__PYX_ERR(0, 1196, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ScorerContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1191, __pyx_L1_error) + __PYX_ERR(0, 1196, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":1193 + /* "cpp_process.pyx":1198 * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, choice_key) * */ - __Pyx_TraceLine(1193,0,__PYX_ERR(0, 1193, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_TraceLine(1198,0,__PYX_ERR(0, 1198, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff)) { __Pyx_RaiseClosureNameError("score_cutoff"); __PYX_ERR(0, 1193, __pyx_L1_error) } - __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1193, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff)) { __Pyx_RaiseClosureNameError("score_cutoff"); __PYX_ERR(0, 1198, __pyx_L1_error) } + __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_score_cutoff, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_1) { - /* "cpp_process.pyx":1194 + /* "cpp_process.pyx":1199 * * if score >= score_cutoff: * yield (choice, score, choice_key) # <<<<<<<<<<<<<< * * def extract_iter_list(): */ - __Pyx_TraceLine(1194,0,__PYX_ERR(0, 1194, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_TraceLine(1199,0,__PYX_ERR(0, 1199, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -15728,9 +16380,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1199, __pyx_L1_error) - /* "cpp_process.pyx":1193 + /* "cpp_process.pyx":1198 * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) * * if score >= score_cutoff: # <<<<<<<<<<<<<< @@ -15745,7 +16397,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1165 + /* "cpp_process.pyx":1170 * cdef size_t c_max = -1 * * def extract_iter_dict(): # <<<<<<<<<<<<<< @@ -15776,7 +16428,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_2generator1(__pyx_Corouti } static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1196 +/* "cpp_process.pyx":1201 * yield (choice, score, choice_key) * * def extract_iter_list(): # <<<<<<<<<<<<<< @@ -15812,7 +16464,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_3extract_iter_list(PyObje if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_2_extract_iter_list *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1196, __pyx_L1_error) + __PYX_ERR(0, 1201, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15820,7 +16472,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_3extract_iter_list(PyObje __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_locals_extract_iter_2, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_locals_extract_iter_2, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -15858,7 +16510,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iter_list", 0); - __Pyx_TraceCall("extract_iter_list", __pyx_f[0], 1196, 0, __PYX_ERR(0, 1196, __pyx_L1_error)); + __Pyx_TraceCall("extract_iter_list", __pyx_f[0], 1201, 0, __PYX_ERR(0, 1201, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L10_resume_from_yield; @@ -15869,55 +16521,55 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1201, __pyx_L1_error) - /* "cpp_process.pyx":1205 + /* "cpp_process.pyx":1210 * cdef double score * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(1205,0,__PYX_ERR(0, 1205, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1205, __pyx_L1_error) } + __Pyx_TraceLine(1210,0,__PYX_ERR(0, 1210, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1210, __pyx_L1_error) } __pyx_t_1 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1206 + /* "cpp_process.pyx":1211 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1206,0,__PYX_ERR(0, 1206, __pyx_L1_error)) + __Pyx_TraceLine(1211,0,__PYX_ERR(0, 1211, __pyx_L1_error)) __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1206, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1211, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -15927,7 +16579,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1206, __pyx_L1_error) + else __PYX_ERR(0, 1211, __pyx_L1_error) } break; } @@ -15940,29 +16592,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __pyx_cur_scope->__pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":1207 + /* "cpp_process.pyx":1212 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1207,0,__PYX_ERR(0, 1207, __pyx_L1_error)) + __Pyx_TraceLine(1212,0,__PYX_ERR(0, 1212, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1208 + /* "cpp_process.pyx":1213 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(1208,0,__PYX_ERR(0, 1208, __pyx_L1_error)) + __Pyx_TraceLine(1213,0,__PYX_ERR(0, 1213, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1207 + /* "cpp_process.pyx":1212 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -15971,15 +16623,15 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti */ } - /* "cpp_process.pyx":1210 + /* "cpp_process.pyx":1215 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(1210,0,__PYX_ERR(0, 1210, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1210, __pyx_L1_error) } + __Pyx_TraceLine(1215,0,__PYX_ERR(0, 1215, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1215, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_8 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -15997,7 +16649,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1210, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -16006,29 +16658,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":1211 + /* "cpp_process.pyx":1216 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1211,0,__PYX_ERR(0, 1211, __pyx_L1_error)) + __Pyx_TraceLine(1216,0,__PYX_ERR(0, 1216, __pyx_L1_error)) __pyx_t_1 = (__pyx_cur_scope->__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1212 + /* "cpp_process.pyx":1217 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) */ - __Pyx_TraceLine(1212,0,__PYX_ERR(0, 1212, __pyx_L1_error)) + __Pyx_TraceLine(1217,0,__PYX_ERR(0, 1217, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1211 + /* "cpp_process.pyx":1216 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -16037,47 +16689,47 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti */ } - /* "cpp_process.pyx":1214 + /* "cpp_process.pyx":1219 * continue * * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1214,0,__PYX_ERR(0, 1214, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error) + __Pyx_TraceLine(1219,0,__PYX_ERR(0, 1219, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ScorerContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1214, __pyx_L1_error) + __PYX_ERR(0, 1219, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":1216 + /* "cpp_process.pyx":1221 * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, i) * else: */ - __Pyx_TraceLine(1216,0,__PYX_ERR(0, 1216, __pyx_L1_error)) + __Pyx_TraceLine(1221,0,__PYX_ERR(0, 1221, __pyx_L1_error)) __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_score >= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1217 + /* "cpp_process.pyx":1222 * * if score >= c_score_cutoff: * yield (choice, score, i) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(1217,0,__PYX_ERR(0, 1217, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1217, __pyx_L1_error) + __Pyx_TraceLine(1222,0,__PYX_ERR(0, 1222, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -16109,9 +16761,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1217, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1222, __pyx_L1_error) - /* "cpp_process.pyx":1216 + /* "cpp_process.pyx":1221 * score = ScorerContext.ratio(conv_sequence(proc_choice), c_score_cutoff) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -16120,19 +16772,19 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti */ } - /* "cpp_process.pyx":1206 + /* "cpp_process.pyx":1211 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1206,0,__PYX_ERR(0, 1206, __pyx_L1_error)) + __Pyx_TraceLine(1211,0,__PYX_ERR(0, 1211, __pyx_L1_error)) __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpp_process.pyx":1205 + /* "cpp_process.pyx":1210 * cdef double score * * if processor is not None: # <<<<<<<<<<<<<< @@ -16142,41 +16794,41 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti goto __pyx_L4; } - /* "cpp_process.pyx":1219 + /* "cpp_process.pyx":1224 * yield (choice, score, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1219,0,__PYX_ERR(0, 1219, __pyx_L1_error)) + __Pyx_TraceLine(1224,0,__PYX_ERR(0, 1224, __pyx_L1_error)) /*else*/ { __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1219, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1224, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -16186,7 +16838,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1219, __pyx_L1_error) + else __PYX_ERR(0, 1224, __pyx_L1_error) } break; } @@ -16199,29 +16851,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __pyx_cur_scope->__pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":1220 + /* "cpp_process.pyx":1225 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1220,0,__PYX_ERR(0, 1220, __pyx_L1_error)) + __Pyx_TraceLine(1225,0,__PYX_ERR(0, 1225, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1221 + /* "cpp_process.pyx":1226 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) */ - __Pyx_TraceLine(1221,0,__PYX_ERR(0, 1221, __pyx_L1_error)) + __Pyx_TraceLine(1226,0,__PYX_ERR(0, 1226, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":1220 + /* "cpp_process.pyx":1225 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -16230,47 +16882,47 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti */ } - /* "cpp_process.pyx":1223 + /* "cpp_process.pyx":1228 * continue * * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1223,0,__PYX_ERR(0, 1223, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1223, __pyx_L1_error) + __Pyx_TraceLine(1228,0,__PYX_ERR(0, 1228, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_ScorerContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1223, __pyx_L1_error) + __PYX_ERR(0, 1228, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_score = __pyx_t_12; - /* "cpp_process.pyx":1225 + /* "cpp_process.pyx":1230 * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, i) * */ - __Pyx_TraceLine(1225,0,__PYX_ERR(0, 1225, __pyx_L1_error)) + __Pyx_TraceLine(1230,0,__PYX_ERR(0, 1230, __pyx_L1_error)) __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_score >= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1226 + /* "cpp_process.pyx":1231 * * if score >= c_score_cutoff: * yield (choice, score, i) # <<<<<<<<<<<<<< * * def extract_iter_distance_dict(): */ - __Pyx_TraceLine(1226,0,__PYX_ERR(0, 1226, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1226, __pyx_L1_error) + __Pyx_TraceLine(1231,0,__PYX_ERR(0, 1231, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_score); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -16302,9 +16954,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1226, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1231, __pyx_L1_error) - /* "cpp_process.pyx":1225 + /* "cpp_process.pyx":1230 * score = ScorerContext.ratio(conv_sequence(choice), c_score_cutoff) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -16313,14 +16965,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti */ } - /* "cpp_process.pyx":1219 + /* "cpp_process.pyx":1224 * yield (choice, score, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1219,0,__PYX_ERR(0, 1219, __pyx_L1_error)) + __Pyx_TraceLine(1224,0,__PYX_ERR(0, 1224, __pyx_L1_error)) __pyx_L11_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -16328,7 +16980,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1196 + /* "cpp_process.pyx":1201 * yield (choice, score, choice_key) * * def extract_iter_list(): # <<<<<<<<<<<<<< @@ -16359,7 +17011,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_5generator2(__pyx_Corouti } static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1228 +/* "cpp_process.pyx":1233 * yield (choice, score, i) * * def extract_iter_distance_dict(): # <<<<<<<<<<<<<< @@ -16395,7 +17047,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_6extract_iter_distance_di if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1228, __pyx_L1_error) + __PYX_ERR(0, 1233, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16403,7 +17055,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_6extract_iter_distance_di __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_8generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_locals_extract_iter_3, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_8generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_locals_extract_iter_3, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16441,7 +17093,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iter_distance_dict", 0); - __Pyx_TraceCall("extract_iter_distance_dict", __pyx_f[0], 1228, 0, __PYX_ERR(0, 1228, __pyx_L1_error)); + __Pyx_TraceCall("extract_iter_distance_dict", __pyx_f[0], 1233, 0, __PYX_ERR(0, 1233, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L10_resume_from_yield; @@ -16452,36 +17104,36 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1233, __pyx_L1_error) - /* "cpp_process.pyx":1236 + /* "cpp_process.pyx":1241 * cdef size_t distance * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(1236,0,__PYX_ERR(0, 1236, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1236, __pyx_L1_error) } + __Pyx_TraceLine(1241,0,__PYX_ERR(0, 1241, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1241, __pyx_L1_error) } __pyx_t_1 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1237 + /* "cpp_process.pyx":1242 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1237,0,__PYX_ERR(0, 1237, __pyx_L1_error)) + __Pyx_TraceLine(1242,0,__PYX_ERR(0, 1242, __pyx_L1_error)) __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1237, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1242, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1237, __pyx_L1_error) + __PYX_ERR(0, 1242, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -16489,7 +17141,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1237, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -16501,29 +17153,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1238 + /* "cpp_process.pyx":1243 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1238,0,__PYX_ERR(0, 1238, __pyx_L1_error)) + __Pyx_TraceLine(1243,0,__PYX_ERR(0, 1243, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1239 + /* "cpp_process.pyx":1244 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(1239,0,__PYX_ERR(0, 1239, __pyx_L1_error)) + __Pyx_TraceLine(1244,0,__PYX_ERR(0, 1244, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1238 + /* "cpp_process.pyx":1243 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -16532,15 +17184,15 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti */ } - /* "cpp_process.pyx":1241 + /* "cpp_process.pyx":1246 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(1241,0,__PYX_ERR(0, 1241, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1241, __pyx_L1_error) } + __Pyx_TraceLine(1246,0,__PYX_ERR(0, 1246, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1246, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_7 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -16558,7 +17210,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1241, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -16567,29 +17219,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1242 + /* "cpp_process.pyx":1247 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1242,0,__PYX_ERR(0, 1242, __pyx_L1_error)) + __Pyx_TraceLine(1247,0,__PYX_ERR(0, 1247, __pyx_L1_error)) __pyx_t_1 = (__pyx_cur_scope->__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1243 + /* "cpp_process.pyx":1248 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) */ - __Pyx_TraceLine(1243,0,__PYX_ERR(0, 1243, __pyx_L1_error)) + __Pyx_TraceLine(1248,0,__PYX_ERR(0, 1248, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1242 + /* "cpp_process.pyx":1247 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -16598,45 +17250,45 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti */ } - /* "cpp_process.pyx":1245 + /* "cpp_process.pyx":1250 * continue * * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) # <<<<<<<<<<<<<< * * if distance <= c_max: */ - __Pyx_TraceLine(1245,0,__PYX_ERR(0, 1245, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error) + __Pyx_TraceLine(1250,0,__PYX_ERR(0, 1250, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1250, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_DistanceContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1245, __pyx_L1_error) + __PYX_ERR(0, 1250, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":1247 + /* "cpp_process.pyx":1252 * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< * yield (choice, distance, choice_key) * else: */ - __Pyx_TraceLine(1247,0,__PYX_ERR(0, 1247, __pyx_L1_error)) + __Pyx_TraceLine(1252,0,__PYX_ERR(0, 1252, __pyx_L1_error)) __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_distance <= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1248 + /* "cpp_process.pyx":1253 * * if distance <= c_max: * yield (choice, distance, choice_key) # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(1248,0,__PYX_ERR(0, 1248, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_TraceLine(1253,0,__PYX_ERR(0, 1253, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -16668,9 +17320,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1248, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1253, __pyx_L1_error) - /* "cpp_process.pyx":1247 + /* "cpp_process.pyx":1252 * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< @@ -16682,7 +17334,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "cpp_process.pyx":1236 + /* "cpp_process.pyx":1241 * cdef size_t distance * * if processor is not None: # <<<<<<<<<<<<<< @@ -16692,22 +17344,22 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti goto __pyx_L4; } - /* "cpp_process.pyx":1250 + /* "cpp_process.pyx":1255 * yield (choice, distance, choice_key) * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1250,0,__PYX_ERR(0, 1250, __pyx_L1_error)) + __Pyx_TraceLine(1255,0,__PYX_ERR(0, 1255, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1250, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1255, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1250, __pyx_L1_error) + __PYX_ERR(0, 1255, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; @@ -16715,7 +17367,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_5, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1250, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -16727,29 +17379,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1251 + /* "cpp_process.pyx":1256 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1251,0,__PYX_ERR(0, 1251, __pyx_L1_error)) + __Pyx_TraceLine(1256,0,__PYX_ERR(0, 1256, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1252 + /* "cpp_process.pyx":1257 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = DistanceContext.ratio(conv_sequence(choice), c_max) */ - __Pyx_TraceLine(1252,0,__PYX_ERR(0, 1252, __pyx_L1_error)) + __Pyx_TraceLine(1257,0,__PYX_ERR(0, 1257, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":1251 + /* "cpp_process.pyx":1256 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -16758,45 +17410,45 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti */ } - /* "cpp_process.pyx":1254 + /* "cpp_process.pyx":1259 * continue * * distance = DistanceContext.ratio(conv_sequence(choice), c_max) # <<<<<<<<<<<<<< * * if distance <= c_max: */ - __Pyx_TraceLine(1254,0,__PYX_ERR(0, 1254, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_TraceLine(1259,0,__PYX_ERR(0, 1259, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_DistanceContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1254, __pyx_L1_error) + __PYX_ERR(0, 1259, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":1256 + /* "cpp_process.pyx":1261 * distance = DistanceContext.ratio(conv_sequence(choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< * yield (choice, distance, choice_key) * */ - __Pyx_TraceLine(1256,0,__PYX_ERR(0, 1256, __pyx_L1_error)) + __Pyx_TraceLine(1261,0,__PYX_ERR(0, 1261, __pyx_L1_error)) __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_distance <= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1257 + /* "cpp_process.pyx":1262 * * if distance <= c_max: * yield (choice, distance, choice_key) # <<<<<<<<<<<<<< * * def extract_iter_distance_list(): */ - __Pyx_TraceLine(1257,0,__PYX_ERR(0, 1257, __pyx_L1_error)) - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L1_error) + __Pyx_TraceLine(1262,0,__PYX_ERR(0, 1262, __pyx_L1_error)) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -16828,9 +17480,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1257, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1262, __pyx_L1_error) - /* "cpp_process.pyx":1256 + /* "cpp_process.pyx":1261 * distance = DistanceContext.ratio(conv_sequence(choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< @@ -16845,7 +17497,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1228 + /* "cpp_process.pyx":1233 * yield (choice, score, i) * * def extract_iter_distance_dict(): # <<<<<<<<<<<<<< @@ -16876,7 +17528,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_8generator3(__pyx_Corouti } static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1259 +/* "cpp_process.pyx":1264 * yield (choice, distance, choice_key) * * def extract_iter_distance_list(): # <<<<<<<<<<<<<< @@ -16912,7 +17564,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_9extract_iter_distance_li if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1259, __pyx_L1_error) + __PYX_ERR(0, 1264, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -16920,7 +17572,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_9extract_iter_distance_li __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_11generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_extract_iter_locals_extract_iter_4, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_11generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_extract_iter_locals_extract_iter_4, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16958,7 +17610,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iter_distance_list", 0); - __Pyx_TraceCall("extract_iter_distance_list", __pyx_f[0], 1259, 0, __PYX_ERR(0, 1259, __pyx_L1_error)); + __Pyx_TraceCall("extract_iter_distance_list", __pyx_f[0], 1264, 0, __PYX_ERR(0, 1264, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L10_resume_from_yield; @@ -16969,55 +17621,55 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1259, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1264, __pyx_L1_error) - /* "cpp_process.pyx":1268 + /* "cpp_process.pyx":1273 * cdef size_t distance * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(1268,0,__PYX_ERR(0, 1268, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1268, __pyx_L1_error) } + __Pyx_TraceLine(1273,0,__PYX_ERR(0, 1273, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1273, __pyx_L1_error) } __pyx_t_1 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1269 + /* "cpp_process.pyx":1274 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1269,0,__PYX_ERR(0, 1269, __pyx_L1_error)) + __Pyx_TraceLine(1274,0,__PYX_ERR(0, 1274, __pyx_L1_error)) __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1269, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1274, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -17027,7 +17679,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1269, __pyx_L1_error) + else __PYX_ERR(0, 1274, __pyx_L1_error) } break; } @@ -17040,29 +17692,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __pyx_cur_scope->__pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":1270 + /* "cpp_process.pyx":1275 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1270,0,__PYX_ERR(0, 1270, __pyx_L1_error)) + __Pyx_TraceLine(1275,0,__PYX_ERR(0, 1275, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1271 + /* "cpp_process.pyx":1276 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * proc_choice = processor(choice) */ - __Pyx_TraceLine(1271,0,__PYX_ERR(0, 1271, __pyx_L1_error)) + __Pyx_TraceLine(1276,0,__PYX_ERR(0, 1276, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1270 + /* "cpp_process.pyx":1275 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -17071,15 +17723,15 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout */ } - /* "cpp_process.pyx":1273 + /* "cpp_process.pyx":1278 * continue * * proc_choice = processor(choice) # <<<<<<<<<<<<<< * if proc_choice is None: * continue */ - __Pyx_TraceLine(1273,0,__PYX_ERR(0, 1273, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1273, __pyx_L1_error) } + __Pyx_TraceLine(1278,0,__PYX_ERR(0, 1278, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1278, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_8 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -17097,7 +17749,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -17106,29 +17758,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":1274 + /* "cpp_process.pyx":1279 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1274,0,__PYX_ERR(0, 1274, __pyx_L1_error)) + __Pyx_TraceLine(1279,0,__PYX_ERR(0, 1279, __pyx_L1_error)) __pyx_t_1 = (__pyx_cur_scope->__pyx_v_proc_choice == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1275 + /* "cpp_process.pyx":1280 * proc_choice = processor(choice) * if proc_choice is None: * continue # <<<<<<<<<<<<<< * * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) */ - __Pyx_TraceLine(1275,0,__PYX_ERR(0, 1275, __pyx_L1_error)) + __Pyx_TraceLine(1280,0,__PYX_ERR(0, 1280, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1274 + /* "cpp_process.pyx":1279 * * proc_choice = processor(choice) * if proc_choice is None: # <<<<<<<<<<<<<< @@ -17137,47 +17789,47 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout */ } - /* "cpp_process.pyx":1277 + /* "cpp_process.pyx":1282 * continue * * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) # <<<<<<<<<<<<<< * * if distance <= c_max: */ - __Pyx_TraceLine(1277,0,__PYX_ERR(0, 1277, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L1_error) + __Pyx_TraceLine(1282,0,__PYX_ERR(0, 1282, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_DistanceContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1277, __pyx_L1_error) + __PYX_ERR(0, 1282, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":1279 + /* "cpp_process.pyx":1284 * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< * yield (choice, distance, i) * else: */ - __Pyx_TraceLine(1279,0,__PYX_ERR(0, 1279, __pyx_L1_error)) + __Pyx_TraceLine(1284,0,__PYX_ERR(0, 1284, __pyx_L1_error)) __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_distance <= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max) != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1280 + /* "cpp_process.pyx":1285 * * if distance <= c_max: * yield (choice, distance, i) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(1280,0,__PYX_ERR(0, 1280, __pyx_L1_error)) - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L1_error) + __Pyx_TraceLine(1285,0,__PYX_ERR(0, 1285, __pyx_L1_error)) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -17209,9 +17861,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1285, __pyx_L1_error) - /* "cpp_process.pyx":1279 + /* "cpp_process.pyx":1284 * distance = DistanceContext.ratio(conv_sequence(proc_choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< @@ -17220,19 +17872,19 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout */ } - /* "cpp_process.pyx":1269 + /* "cpp_process.pyx":1274 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1269,0,__PYX_ERR(0, 1269, __pyx_L1_error)) + __Pyx_TraceLine(1274,0,__PYX_ERR(0, 1274, __pyx_L1_error)) __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpp_process.pyx":1268 + /* "cpp_process.pyx":1273 * cdef size_t distance * * if processor is not None: # <<<<<<<<<<<<<< @@ -17242,41 +17894,41 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout goto __pyx_L4; } - /* "cpp_process.pyx":1282 + /* "cpp_process.pyx":1287 * yield (choice, distance, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1282,0,__PYX_ERR(0, 1282, __pyx_L1_error)) + __Pyx_TraceLine(1287,0,__PYX_ERR(0, 1287, __pyx_L1_error)) /*else*/ { __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1282, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1287, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1282, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -17286,7 +17938,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1282, __pyx_L1_error) + else __PYX_ERR(0, 1287, __pyx_L1_error) } break; } @@ -17299,29 +17951,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __pyx_cur_scope->__pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); - /* "cpp_process.pyx":1283 + /* "cpp_process.pyx":1288 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1283,0,__PYX_ERR(0, 1283, __pyx_L1_error)) + __Pyx_TraceLine(1288,0,__PYX_ERR(0, 1288, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1284 + /* "cpp_process.pyx":1289 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * distance = DistanceContext.ratio(conv_sequence(choice), c_max) */ - __Pyx_TraceLine(1284,0,__PYX_ERR(0, 1284, __pyx_L1_error)) + __Pyx_TraceLine(1289,0,__PYX_ERR(0, 1289, __pyx_L1_error)) goto __pyx_L11_continue; - /* "cpp_process.pyx":1283 + /* "cpp_process.pyx":1288 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -17330,47 +17982,47 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout */ } - /* "cpp_process.pyx":1286 + /* "cpp_process.pyx":1291 * continue * * distance = DistanceContext.ratio(conv_sequence(choice), c_max) # <<<<<<<<<<<<<< * * if distance <= c_max: */ - __Pyx_TraceLine(1286,0,__PYX_ERR(0, 1286, __pyx_L1_error)) - __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1286, __pyx_L1_error) + __Pyx_TraceLine(1291,0,__PYX_ERR(0, 1291, __pyx_L1_error)) + __pyx_t_11 = __pyx_f_11cpp_process_conv_sequence(__pyx_cur_scope->__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1291, __pyx_L1_error) try { __pyx_t_12 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_DistanceContext.ratio(__pyx_t_11, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 1286, __pyx_L1_error) + __PYX_ERR(0, 1291, __pyx_L1_error) } __pyx_cur_scope->__pyx_v_distance = __pyx_t_12; - /* "cpp_process.pyx":1288 + /* "cpp_process.pyx":1293 * distance = DistanceContext.ratio(conv_sequence(choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< * yield (choice, distance, i) * */ - __Pyx_TraceLine(1288,0,__PYX_ERR(0, 1288, __pyx_L1_error)) + __Pyx_TraceLine(1293,0,__PYX_ERR(0, 1293, __pyx_L1_error)) __pyx_t_1 = ((__pyx_cur_scope->__pyx_v_distance <= __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_max) != 0); if (__pyx_t_1) { - /* "cpp_process.pyx":1289 + /* "cpp_process.pyx":1294 * * if distance <= c_max: * yield (choice, distance, i) # <<<<<<<<<<<<<< * * def py_extract_iter_dict(): */ - __Pyx_TraceLine(1289,0,__PYX_ERR(0, 1289, __pyx_L1_error)) - __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1289, __pyx_L1_error) + __Pyx_TraceLine(1294,0,__PYX_ERR(0, 1294, __pyx_L1_error)) + __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_distance); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -17402,9 +18054,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1289, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1294, __pyx_L1_error) - /* "cpp_process.pyx":1288 + /* "cpp_process.pyx":1293 * distance = DistanceContext.ratio(conv_sequence(choice), c_max) * * if distance <= c_max: # <<<<<<<<<<<<<< @@ -17413,14 +18065,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout */ } - /* "cpp_process.pyx":1282 + /* "cpp_process.pyx":1287 * yield (choice, distance, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1282,0,__PYX_ERR(0, 1282, __pyx_L1_error)) + __Pyx_TraceLine(1287,0,__PYX_ERR(0, 1287, __pyx_L1_error)) __pyx_L11_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -17428,7 +18080,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1259 + /* "cpp_process.pyx":1264 * yield (choice, distance, choice_key) * * def extract_iter_distance_list(): # <<<<<<<<<<<<<< @@ -17459,7 +18111,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_11generator4(__pyx_Corout } static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1291 +/* "cpp_process.pyx":1296 * yield (choice, distance, i) * * def py_extract_iter_dict(): # <<<<<<<<<<<<<< @@ -17495,7 +18147,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_12py_extract_iter_dict(Py if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1291, __pyx_L1_error) + __PYX_ERR(0, 1296, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -17503,7 +18155,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_12py_extract_iter_dict(Py __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_14generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_extract_iter_locals_py_extract_i, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_14generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_extract_iter_locals_py_extract_i, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -17539,7 +18191,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("py_extract_iter_dict", 0); - __Pyx_TraceCall("py_extract_iter_dict", __pyx_f[0], 1291, 0, __PYX_ERR(0, 1291, __pyx_L1_error)); + __Pyx_TraceCall("py_extract_iter_dict", __pyx_f[0], 1296, 0, __PYX_ERR(0, 1296, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L9_resume_from_yield; @@ -17550,69 +18202,69 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1291, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1296, __pyx_L1_error) - /* "cpp_process.pyx":1298 + /* "cpp_process.pyx":1303 * """ * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = c_score_cutoff * */ - __Pyx_TraceLine(1298,0,__PYX_ERR(0, 1298, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1298, __pyx_L1_error) } + __Pyx_TraceLine(1303,0,__PYX_ERR(0, 1303, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1303, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1298, __pyx_L1_error) + __PYX_ERR(0, 1303, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 1303, __pyx_L1_error) - /* "cpp_process.pyx":1299 + /* "cpp_process.pyx":1304 * * kwargs["processor"] = None * kwargs["score_cutoff"] = c_score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(1299,0,__PYX_ERR(0, 1299, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_TraceLine(1304,0,__PYX_ERR(0, 1304, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1299, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1304, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1299, __pyx_L1_error) + __PYX_ERR(0, 1304, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1301 + /* "cpp_process.pyx":1306 * kwargs["score_cutoff"] = c_score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for choice_key, choice in choices.items(): * if choice is None: */ - __Pyx_TraceLine(1301,0,__PYX_ERR(0, 1301, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1301, __pyx_L1_error) } + __Pyx_TraceLine(1306,0,__PYX_ERR(0, 1306, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1306, __pyx_L1_error) } __pyx_t_2 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1302 + /* "cpp_process.pyx":1307 * * if processor is not None: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1302,0,__PYX_ERR(0, 1302, __pyx_L1_error)) + __Pyx_TraceLine(1307,0,__PYX_ERR(0, 1307, __pyx_L1_error)) __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1302, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1307, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1302, __pyx_L1_error) + __PYX_ERR(0, 1307, __pyx_L1_error) } - __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1302, __pyx_L1_error) + __pyx_t_7 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_7; @@ -17620,7 +18272,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1302, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -17632,29 +18284,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1303 + /* "cpp_process.pyx":1308 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1303,0,__PYX_ERR(0, 1303, __pyx_L1_error)) + __Pyx_TraceLine(1308,0,__PYX_ERR(0, 1308, __pyx_L1_error)) __pyx_t_3 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1304 + /* "cpp_process.pyx":1309 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(1304,0,__PYX_ERR(0, 1304, __pyx_L1_error)) + __Pyx_TraceLine(1309,0,__PYX_ERR(0, 1309, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1303 + /* "cpp_process.pyx":1308 * if processor is not None: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -17663,17 +18315,17 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout */ } - /* "cpp_process.pyx":1306 + /* "cpp_process.pyx":1311 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1306,0,__PYX_ERR(0, 1306, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1306, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1306, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1306, __pyx_L1_error) } + __Pyx_TraceLine(1311,0,__PYX_ERR(0, 1311, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1311, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1311, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1311, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_7 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_10 = NULL; __pyx_t_9 = 0; @@ -17691,11 +18343,11 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); @@ -17703,14 +18355,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1306, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1311, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1306, __pyx_L1_error) + __PYX_ERR(0, 1311, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -17719,31 +18371,31 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":1308 + /* "cpp_process.pyx":1313 * score = scorer(query, processor(choice), **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, choice_key) * else: */ - __Pyx_TraceLine(1308,0,__PYX_ERR(0, 1308, __pyx_L1_error)) - __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1308, __pyx_L1_error) + __Pyx_TraceLine(1313,0,__PYX_ERR(0, 1313, __pyx_L1_error)) + __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "cpp_process.pyx":1309 + /* "cpp_process.pyx":1314 * * if score >= c_score_cutoff: * yield (choice, score, choice_key) # <<<<<<<<<<<<<< * else: * for choice_key, choice in choices.items(): */ - __Pyx_TraceLine(1309,0,__PYX_ERR(0, 1309, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1309, __pyx_L1_error) + __Pyx_TraceLine(1314,0,__PYX_ERR(0, 1314, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -17775,9 +18427,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1309, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1314, __pyx_L1_error) - /* "cpp_process.pyx":1308 + /* "cpp_process.pyx":1313 * score = scorer(query, processor(choice), **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -17789,7 +18441,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1301 + /* "cpp_process.pyx":1306 * kwargs["score_cutoff"] = c_score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -17799,22 +18451,22 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout goto __pyx_L4; } - /* "cpp_process.pyx":1311 + /* "cpp_process.pyx":1316 * yield (choice, score, choice_key) * else: * for choice_key, choice in choices.items(): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1311,0,__PYX_ERR(0, 1311, __pyx_L1_error)) + __Pyx_TraceLine(1316,0,__PYX_ERR(0, 1316, __pyx_L1_error)) /*else*/ { __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1311, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1316, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1311, __pyx_L1_error) + __PYX_ERR(0, 1316, __pyx_L1_error) } - __pyx_t_8 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_8 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_8; @@ -17822,7 +18474,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_5, &__pyx_t_8, &__pyx_t_10, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; - if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1311, __pyx_L1_error) + if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_choice_key); @@ -17834,29 +18486,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - /* "cpp_process.pyx":1312 + /* "cpp_process.pyx":1317 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1312,0,__PYX_ERR(0, 1312, __pyx_L1_error)) + __Pyx_TraceLine(1317,0,__PYX_ERR(0, 1317, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1313 + /* "cpp_process.pyx":1318 * for choice_key, choice in choices.items(): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(1313,0,__PYX_ERR(0, 1313, __pyx_L1_error)) + __Pyx_TraceLine(1318,0,__PYX_ERR(0, 1318, __pyx_L1_error)) goto __pyx_L10_continue; - /* "cpp_process.pyx":1312 + /* "cpp_process.pyx":1317 * else: * for choice_key, choice in choices.items(): * if choice is None: # <<<<<<<<<<<<<< @@ -17865,17 +18517,17 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout */ } - /* "cpp_process.pyx":1315 + /* "cpp_process.pyx":1320 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1315,0,__PYX_ERR(0, 1315, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1315, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1315, __pyx_L1_error) } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1315, __pyx_L1_error) + __Pyx_TraceLine(1320,0,__PYX_ERR(0, 1320, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1320, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1320, __pyx_L1_error) } + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); @@ -17883,14 +18535,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_choice); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1315, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1320, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1315, __pyx_L1_error) + __PYX_ERR(0, 1320, __pyx_L1_error) } - __pyx_t_8 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_8 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -17899,31 +18551,31 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "cpp_process.pyx":1317 + /* "cpp_process.pyx":1322 * score = scorer(query, choice, **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield (choice, score, choice_key) * */ - __Pyx_TraceLine(1317,0,__PYX_ERR(0, 1317, __pyx_L1_error)) - __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error) + __Pyx_TraceLine(1322,0,__PYX_ERR(0, 1322, __pyx_L1_error)) + __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":1318 + /* "cpp_process.pyx":1323 * * if score >= c_score_cutoff: * yield (choice, score, choice_key) # <<<<<<<<<<<<<< * * def py_extract_iter_list(): */ - __Pyx_TraceLine(1318,0,__PYX_ERR(0, 1318, __pyx_L1_error)) - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1318, __pyx_L1_error) + __Pyx_TraceLine(1323,0,__PYX_ERR(0, 1323, __pyx_L1_error)) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -17955,9 +18607,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1318, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1323, __pyx_L1_error) - /* "cpp_process.pyx":1317 + /* "cpp_process.pyx":1322 * score = scorer(query, choice, **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -17972,7 +18624,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1291 + /* "cpp_process.pyx":1296 * yield (choice, distance, i) * * def py_extract_iter_dict(): # <<<<<<<<<<<<<< @@ -18003,7 +18655,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_14generator5(__pyx_Corout } static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "cpp_process.pyx":1320 +/* "cpp_process.pyx":1325 * yield (choice, score, choice_key) * * def py_extract_iter_list(): # <<<<<<<<<<<<<< @@ -18039,7 +18691,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_15py_extract_iter_list(Py if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_11cpp_process___pyx_scope_struct_6_py_extract_iter_list *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1320, __pyx_L1_error) + __PYX_ERR(0, 1325, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18047,7 +18699,7 @@ static PyObject *__pyx_pf_11cpp_process_12extract_iter_15py_extract_iter_list(Py __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_17generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_py_extract_iter_list, __pyx_n_s_extract_iter_locals_py_extract_i_2, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_11cpp_process_12extract_iter_17generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_py_extract_iter_list, __pyx_n_s_extract_iter_locals_py_extract_i_2, __pyx_n_s_cpp_process); if (unlikely(!gen)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18083,7 +18735,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("py_extract_iter_list", 0); - __Pyx_TraceCall("py_extract_iter_list", __pyx_f[0], 1320, 0, __PYX_ERR(0, 1320, __pyx_L1_error)); + __Pyx_TraceCall("py_extract_iter_list", __pyx_f[0], 1325, 0, __PYX_ERR(0, 1325, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L9_resume_from_yield; @@ -18094,88 +18746,88 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1325, __pyx_L1_error) - /* "cpp_process.pyx":1328 + /* "cpp_process.pyx":1333 * cdef size_t i * * kwargs["processor"] = None # <<<<<<<<<<<<<< * kwargs["score_cutoff"] = c_score_cutoff * */ - __Pyx_TraceLine(1328,0,__PYX_ERR(0, 1328, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1328, __pyx_L1_error) } + __Pyx_TraceLine(1333,0,__PYX_ERR(0, 1333, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1333, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1328, __pyx_L1_error) + __PYX_ERR(0, 1333, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) - /* "cpp_process.pyx":1329 + /* "cpp_process.pyx":1334 * * kwargs["processor"] = None * kwargs["score_cutoff"] = c_score_cutoff # <<<<<<<<<<<<<< * * if processor is not None: */ - __Pyx_TraceLine(1329,0,__PYX_ERR(0, 1329, __pyx_L1_error)) - __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) + __Pyx_TraceLine(1334,0,__PYX_ERR(0, 1334, __pyx_L1_error)) + __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1329, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1334, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1329, __pyx_L1_error) + __PYX_ERR(0, 1334, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 1329, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_1) < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1331 + /* "cpp_process.pyx":1336 * kwargs["score_cutoff"] = c_score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< * for i, choice in enumerate(choices): * if choice is None: */ - __Pyx_TraceLine(1331,0,__PYX_ERR(0, 1331, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1331, __pyx_L1_error) } + __Pyx_TraceLine(1336,0,__PYX_ERR(0, 1336, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1336, __pyx_L1_error) } __pyx_t_2 = (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1332 + /* "cpp_process.pyx":1337 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1332,0,__PYX_ERR(0, 1332, __pyx_L1_error)) + __Pyx_TraceLine(1337,0,__PYX_ERR(0, 1337, __pyx_L1_error)) __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1332, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1337, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1337, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1337, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -18185,7 +18837,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1332, __pyx_L1_error) + else __PYX_ERR(0, 1337, __pyx_L1_error) } break; } @@ -18198,29 +18850,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __pyx_cur_scope->__pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":1333 + /* "cpp_process.pyx":1338 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1333,0,__PYX_ERR(0, 1333, __pyx_L1_error)) + __Pyx_TraceLine(1338,0,__PYX_ERR(0, 1338, __pyx_L1_error)) __pyx_t_3 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1334 + /* "cpp_process.pyx":1339 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, processor(choice), **kwargs) */ - __Pyx_TraceLine(1334,0,__PYX_ERR(0, 1334, __pyx_L1_error)) + __Pyx_TraceLine(1339,0,__PYX_ERR(0, 1339, __pyx_L1_error)) goto __pyx_L5_continue; - /* "cpp_process.pyx":1333 + /* "cpp_process.pyx":1338 * if processor is not None: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -18229,17 +18881,17 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout */ } - /* "cpp_process.pyx":1336 + /* "cpp_process.pyx":1341 * continue * * score = scorer(query, processor(choice), **kwargs) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1336,0,__PYX_ERR(0, 1336, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1336, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1336, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1336, __pyx_L1_error) } + __Pyx_TraceLine(1341,0,__PYX_ERR(0, 1341, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1341, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1341, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor)) { __Pyx_RaiseClosureNameError("processor"); __PYX_ERR(0, 1341, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor); __pyx_t_8 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_processor; __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -18257,11 +18909,11 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_choice}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); @@ -18269,14 +18921,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1336, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1341, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1336, __pyx_L1_error) + __PYX_ERR(0, 1341, __pyx_L1_error) } - __pyx_t_7 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_7 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -18285,33 +18937,33 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - /* "cpp_process.pyx":1338 + /* "cpp_process.pyx":1343 * score = scorer(query, processor(choice), **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield(choice, score, i) * else: */ - __Pyx_TraceLine(1338,0,__PYX_ERR(0, 1338, __pyx_L1_error)) - __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1338, __pyx_L1_error) + __Pyx_TraceLine(1343,0,__PYX_ERR(0, 1343, __pyx_L1_error)) + __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1338, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_9, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1338, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "cpp_process.pyx":1339 + /* "cpp_process.pyx":1344 * * if score >= c_score_cutoff: * yield(choice, score, i) # <<<<<<<<<<<<<< * else: * for i, choice in enumerate(choices): */ - __Pyx_TraceLine(1339,0,__PYX_ERR(0, 1339, __pyx_L1_error)) - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_TraceLine(1344,0,__PYX_ERR(0, 1344, __pyx_L1_error)) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1339, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -18343,9 +18995,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1339, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1344, __pyx_L1_error) - /* "cpp_process.pyx":1338 + /* "cpp_process.pyx":1343 * score = scorer(query, processor(choice), **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -18354,19 +19006,19 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout */ } - /* "cpp_process.pyx":1332 + /* "cpp_process.pyx":1337 * * if processor is not None: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1332,0,__PYX_ERR(0, 1332, __pyx_L1_error)) + __Pyx_TraceLine(1337,0,__PYX_ERR(0, 1337, __pyx_L1_error)) __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1331 + /* "cpp_process.pyx":1336 * kwargs["score_cutoff"] = c_score_cutoff * * if processor is not None: # <<<<<<<<<<<<<< @@ -18376,41 +19028,41 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout goto __pyx_L4; } - /* "cpp_process.pyx":1341 + /* "cpp_process.pyx":1346 * yield(choice, score, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1341,0,__PYX_ERR(0, 1341, __pyx_L1_error)) + __Pyx_TraceLine(1346,0,__PYX_ERR(0, 1346, __pyx_L1_error)) /*else*/ { __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1341, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __Pyx_RaiseClosureNameError("choices"); __PYX_ERR(0, 1346, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_choices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) #else - __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -18420,7 +19072,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1341, __pyx_L1_error) + else __PYX_ERR(0, 1346, __pyx_L1_error) } break; } @@ -18433,29 +19085,29 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __pyx_cur_scope->__pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); - /* "cpp_process.pyx":1342 + /* "cpp_process.pyx":1347 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< * continue * */ - __Pyx_TraceLine(1342,0,__PYX_ERR(0, 1342, __pyx_L1_error)) + __Pyx_TraceLine(1347,0,__PYX_ERR(0, 1347, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_choice == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1343 + /* "cpp_process.pyx":1348 * for i, choice in enumerate(choices): * if choice is None: * continue # <<<<<<<<<<<<<< * * score = scorer(query, choice, **kwargs) */ - __Pyx_TraceLine(1343,0,__PYX_ERR(0, 1343, __pyx_L1_error)) + __Pyx_TraceLine(1348,0,__PYX_ERR(0, 1348, __pyx_L1_error)) goto __pyx_L10_continue; - /* "cpp_process.pyx":1342 + /* "cpp_process.pyx":1347 * else: * for i, choice in enumerate(choices): * if choice is None: # <<<<<<<<<<<<<< @@ -18464,17 +19116,17 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout */ } - /* "cpp_process.pyx":1345 + /* "cpp_process.pyx":1350 * continue * * score = scorer(query, choice, **kwargs) # <<<<<<<<<<<<<< * * if score >= c_score_cutoff: */ - __Pyx_TraceLine(1345,0,__PYX_ERR(0, 1345, __pyx_L1_error)) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1345, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1345, __pyx_L1_error) } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L1_error) + __Pyx_TraceLine(1350,0,__PYX_ERR(0, 1350, __pyx_L1_error)) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer)) { __Pyx_RaiseClosureNameError("scorer"); __PYX_ERR(0, 1350, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 1350, __pyx_L1_error) } + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_query); @@ -18482,14 +19134,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_cur_scope->__pyx_v_choice); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1345, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 1350, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 1345, __pyx_L1_error) + __PYX_ERR(0, 1350, __pyx_L1_error) } - __pyx_t_7 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_7 = PyDict_Copy(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scorer, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -18498,33 +19150,33 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "cpp_process.pyx":1347 + /* "cpp_process.pyx":1352 * score = scorer(query, choice, **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< * yield(choice, score, i) * */ - __Pyx_TraceLine(1347,0,__PYX_ERR(0, 1347, __pyx_L1_error)) - __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1347, __pyx_L1_error) + __Pyx_TraceLine(1352,0,__PYX_ERR(0, 1352, __pyx_L1_error)) + __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_score, __pyx_t_8, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":1348 + /* "cpp_process.pyx":1353 * * if score >= c_score_cutoff: * yield(choice, score, i) # <<<<<<<<<<<<<< * * if query is None: */ - __Pyx_TraceLine(1348,0,__PYX_ERR(0, 1348, __pyx_L1_error)) - __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1348, __pyx_L1_error) + __Pyx_TraceLine(1353,0,__PYX_ERR(0, 1353, __pyx_L1_error)) + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_choice); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_choice); @@ -18556,9 +19208,9 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1348, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1353, __pyx_L1_error) - /* "cpp_process.pyx":1347 + /* "cpp_process.pyx":1352 * score = scorer(query, choice, **kwargs) * * if score >= c_score_cutoff: # <<<<<<<<<<<<<< @@ -18567,14 +19219,14 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout */ } - /* "cpp_process.pyx":1341 + /* "cpp_process.pyx":1346 * yield(choice, score, i) * else: * for i, choice in enumerate(choices): # <<<<<<<<<<<<<< * if choice is None: * continue */ - __Pyx_TraceLine(1341,0,__PYX_ERR(0, 1341, __pyx_L1_error)) + __Pyx_TraceLine(1346,0,__PYX_ERR(0, 1346, __pyx_L1_error)) __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18582,7 +19234,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout __pyx_L4:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1320 + /* "cpp_process.pyx":1325 * yield (choice, score, choice_key) * * def py_extract_iter_list(): # <<<<<<<<<<<<<< @@ -18612,7 +19264,7 @@ static PyObject *__pyx_gb_11cpp_process_12extract_iter_17generator6(__pyx_Corout return __pyx_r; } -/* "cpp_process.pyx":1104 +/* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -18641,7 +19293,7 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extract_iter", 0); __Pyx_TraceFrameInit(__pyx_codeobj__5) - __Pyx_TraceCall("extract_iter", __pyx_f[0], 1104, 0, __PYX_ERR(0, 1104, __pyx_L1_error)); + __Pyx_TraceCall("extract_iter", __pyx_f[0], 1109, 0, __PYX_ERR(0, 1109, __pyx_L1_error)); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L12_resume_from_yield_from; @@ -18656,147 +19308,147 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1109, __pyx_L1_error) - /* "cpp_process.pyx":1159 + /* "cpp_process.pyx":1164 * * """ * cdef int def_process = 0 # <<<<<<<<<<<<<< * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext */ - __Pyx_TraceLine(1159,0,__PYX_ERR(0, 1159, __pyx_L1_error)) + __Pyx_TraceLine(1164,0,__PYX_ERR(0, 1164, __pyx_L1_error)) __pyx_cur_scope->__pyx_v_def_process = 0; - /* "cpp_process.pyx":1162 + /* "cpp_process.pyx":1167 * cdef CachedScorerContext ScorerContext * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 # <<<<<<<<<<<<<< * cdef size_t c_max = -1 * */ - __Pyx_TraceLine(1162,0,__PYX_ERR(0, 1162, __pyx_L1_error)) + __Pyx_TraceLine(1167,0,__PYX_ERR(0, 1167, __pyx_L1_error)) __pyx_cur_scope->__pyx_v_c_score_cutoff = 0.0; - /* "cpp_process.pyx":1163 + /* "cpp_process.pyx":1168 * cdef CachedDistanceContext DistanceContext * cdef double c_score_cutoff = 0.0 * cdef size_t c_max = -1 # <<<<<<<<<<<<<< * * def extract_iter_dict(): */ - __Pyx_TraceLine(1163,0,__PYX_ERR(0, 1163, __pyx_L1_error)) + __Pyx_TraceLine(1168,0,__PYX_ERR(0, 1168, __pyx_L1_error)) __pyx_cur_scope->__pyx_v_c_max = ((size_t)-1L); - /* "cpp_process.pyx":1165 + /* "cpp_process.pyx":1170 * cdef size_t c_max = -1 * * def extract_iter_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1165,0,__PYX_ERR(0, 1165, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_1extract_iter_dict, 0, __pyx_n_s_extract_iter_locals_extract_iter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) + __Pyx_TraceLine(1170,0,__PYX_ERR(0, 1170, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_1extract_iter_dict, 0, __pyx_n_s_extract_iter_locals_extract_iter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract_iter_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1196 + /* "cpp_process.pyx":1201 * yield (choice, score, choice_key) * * def extract_iter_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1196,0,__PYX_ERR(0, 1196, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_4extract_iter_list, 0, __pyx_n_s_extract_iter_locals_extract_iter_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) + __Pyx_TraceLine(1201,0,__PYX_ERR(0, 1201, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_4extract_iter_list, 0, __pyx_n_s_extract_iter_locals_extract_iter_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract_iter_list = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1228 + /* "cpp_process.pyx":1233 * yield (choice, score, i) * * def extract_iter_distance_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1228,0,__PYX_ERR(0, 1228, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_7extract_iter_distance_dict, 0, __pyx_n_s_extract_iter_locals_extract_iter_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_TraceLine(1233,0,__PYX_ERR(0, 1233, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_7extract_iter_distance_dict, 0, __pyx_n_s_extract_iter_locals_extract_iter_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract_iter_distance_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1259 + /* "cpp_process.pyx":1264 * yield (choice, distance, choice_key) * * def extract_iter_distance_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1259,0,__PYX_ERR(0, 1259, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_10extract_iter_distance_list, 0, __pyx_n_s_extract_iter_locals_extract_iter_4, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) + __Pyx_TraceLine(1264,0,__PYX_ERR(0, 1264, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_10extract_iter_distance_list, 0, __pyx_n_s_extract_iter_locals_extract_iter_4, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_extract_iter_distance_list = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1291 + /* "cpp_process.pyx":1296 * yield (choice, distance, i) * * def py_extract_iter_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1291,0,__PYX_ERR(0, 1291, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_13py_extract_iter_dict, 0, __pyx_n_s_extract_iter_locals_py_extract_i, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_TraceLine(1296,0,__PYX_ERR(0, 1296, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_13py_extract_iter_dict, 0, __pyx_n_s_extract_iter_locals_py_extract_i, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_py_extract_iter_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1320 + /* "cpp_process.pyx":1325 * yield (choice, score, choice_key) * * def py_extract_iter_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __Pyx_TraceLine(1320,0,__PYX_ERR(0, 1320, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_16py_extract_iter_list, 0, __pyx_n_s_extract_iter_locals_py_extract_i_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_TraceLine(1325,0,__PYX_ERR(0, 1325, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_12extract_iter_16py_extract_iter_list, 0, __pyx_n_s_extract_iter_locals_py_extract_i_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_py_extract_iter_list = __pyx_t_1; __pyx_t_1 = 0; - /* "cpp_process.pyx":1350 + /* "cpp_process.pyx":1355 * yield(choice, score, i) * * if query is None: # <<<<<<<<<<<<<< * # finish generator * return */ - __Pyx_TraceLine(1350,0,__PYX_ERR(0, 1350, __pyx_L1_error)) + __Pyx_TraceLine(1355,0,__PYX_ERR(0, 1355, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_query == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1352 + /* "cpp_process.pyx":1357 * if query is None: * # finish generator * return # <<<<<<<<<<<<<< * * # preprocess the query */ - __Pyx_TraceLine(1352,0,__PYX_ERR(0, 1352, __pyx_L1_error)) + __Pyx_TraceLine(1357,0,__PYX_ERR(0, 1357, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; - /* "cpp_process.pyx":1350 + /* "cpp_process.pyx":1355 * yield(choice, score, i) * * if query is None: # <<<<<<<<<<<<<< @@ -18805,39 +19457,39 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1355 + /* "cpp_process.pyx":1360 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< * def_process = 1 * # since this call is only performed once it is not very expensive to */ - __Pyx_TraceLine(1355,0,__PYX_ERR(0, 1355, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) + __Pyx_TraceLine(1360,0,__PYX_ERR(0, 1360, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_process); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_cur_scope->__pyx_v_processor == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1356 + /* "cpp_process.pyx":1361 * # preprocess the query * if processor is default_process: * def_process = 1 # <<<<<<<<<<<<<< * # since this call is only performed once it is not very expensive to * # make it in Python */ - __Pyx_TraceLine(1356,0,__PYX_ERR(0, 1356, __pyx_L1_error)) + __Pyx_TraceLine(1361,0,__PYX_ERR(0, 1361, __pyx_L1_error)) __pyx_cur_scope->__pyx_v_def_process = 1; - /* "cpp_process.pyx":1359 + /* "cpp_process.pyx":1364 * # since this call is only performed once it is not very expensive to * # make it in Python * query = processor(query) # <<<<<<<<<<<<<< * processor = None * elif callable(processor): */ - __Pyx_TraceLine(1359,0,__PYX_ERR(0, 1359, __pyx_L1_error)) + __Pyx_TraceLine(1364,0,__PYX_ERR(0, 1364, __pyx_L1_error)) __Pyx_INCREF(__pyx_cur_scope->__pyx_v_processor); __pyx_t_4 = __pyx_cur_scope->__pyx_v_processor; __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -18855,7 +19507,7 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_query}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -18864,20 +19516,20 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1360 + /* "cpp_process.pyx":1365 * # make it in Python * query = processor(query) * processor = None # <<<<<<<<<<<<<< * elif callable(processor): * query = processor(query) */ - __Pyx_TraceLine(1360,0,__PYX_ERR(0, 1360, __pyx_L1_error)) + __Pyx_TraceLine(1365,0,__PYX_ERR(0, 1365, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_processor); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_processor, Py_None); __Pyx_GIVEREF(Py_None); - /* "cpp_process.pyx":1355 + /* "cpp_process.pyx":1360 * * # preprocess the query * if processor is default_process: # <<<<<<<<<<<<<< @@ -18887,29 +19539,29 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ goto __pyx_L5; } - /* "cpp_process.pyx":1361 + /* "cpp_process.pyx":1366 * query = processor(query) * processor = None * elif callable(processor): # <<<<<<<<<<<<<< * query = processor(query) * elif processor: */ - __Pyx_TraceLine(1361,0,__PYX_ERR(0, 1361, __pyx_L1_error)) + __Pyx_TraceLine(1366,0,__PYX_ERR(0, 1366, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_processor; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1362 + /* "cpp_process.pyx":1367 * processor = None * elif callable(processor): * query = processor(query) # <<<<<<<<<<<<<< * elif processor: * def_process = 1 */ - __Pyx_TraceLine(1362,0,__PYX_ERR(0, 1362, __pyx_L1_error)) + __Pyx_TraceLine(1367,0,__PYX_ERR(0, 1367, __pyx_L1_error)) __Pyx_INCREF(__pyx_cur_scope->__pyx_v_processor); __pyx_t_4 = __pyx_cur_scope->__pyx_v_processor; __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -18923,72 +19575,6 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_t_6 = 1; } } - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_query}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_query); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_query, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - - /* "cpp_process.pyx":1361 - * query = processor(query) - * processor = None - * elif callable(processor): # <<<<<<<<<<<<<< - * query = processor(query) - * elif processor: - */ - goto __pyx_L5; - } - - /* "cpp_process.pyx":1363 - * elif callable(processor): - * query = processor(query) - * elif processor: # <<<<<<<<<<<<<< - * def_process = 1 - * # since this call is only performed once it is not very expensive to - */ - __Pyx_TraceLine(1363,0,__PYX_ERR(0, 1363, __pyx_L1_error)) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_processor); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1363, __pyx_L1_error) - if (__pyx_t_3) { - - /* "cpp_process.pyx":1364 - * query = processor(query) - * elif processor: - * def_process = 1 # <<<<<<<<<<<<<< - * # since this call is only performed once it is not very expensive to - * # make it in Python - */ - __Pyx_TraceLine(1364,0,__PYX_ERR(0, 1364, __pyx_L1_error)) - __pyx_cur_scope->__pyx_v_def_process = 1; - - /* "cpp_process.pyx":1367 - * # since this call is only performed once it is not very expensive to - * # make it in Python - * query = default_process(query) # <<<<<<<<<<<<<< - * processor = None - * # query might be e.g. False - */ - __Pyx_TraceLine(1367,0,__PYX_ERR(0, 1367, __pyx_L1_error)) - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_query}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); @@ -19002,20 +19588,86 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1368 + /* "cpp_process.pyx":1366 + * query = processor(query) + * processor = None + * elif callable(processor): # <<<<<<<<<<<<<< + * query = processor(query) + * elif processor: + */ + goto __pyx_L5; + } + + /* "cpp_process.pyx":1368 + * elif callable(processor): + * query = processor(query) + * elif processor: # <<<<<<<<<<<<<< + * def_process = 1 + * # since this call is only performed once it is not very expensive to + */ + __Pyx_TraceLine(1368,0,__PYX_ERR(0, 1368, __pyx_L1_error)) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_processor); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) + if (__pyx_t_3) { + + /* "cpp_process.pyx":1369 + * query = processor(query) + * elif processor: + * def_process = 1 # <<<<<<<<<<<<<< + * # since this call is only performed once it is not very expensive to + * # make it in Python + */ + __Pyx_TraceLine(1369,0,__PYX_ERR(0, 1369, __pyx_L1_error)) + __pyx_cur_scope->__pyx_v_def_process = 1; + + /* "cpp_process.pyx":1372 + * # since this call is only performed once it is not very expensive to + * # make it in Python + * query = default_process(query) # <<<<<<<<<<<<<< + * processor = None + * # query might be e.g. False + */ + __Pyx_TraceLine(1372,0,__PYX_ERR(0, 1372, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_query}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_query); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_query, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "cpp_process.pyx":1373 * # make it in Python * query = default_process(query) * processor = None # <<<<<<<<<<<<<< * # query might be e.g. False * else: */ - __Pyx_TraceLine(1368,0,__PYX_ERR(0, 1368, __pyx_L1_error)) + __Pyx_TraceLine(1373,0,__PYX_ERR(0, 1373, __pyx_L1_error)) __Pyx_INCREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_processor); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_processor, Py_None); __Pyx_GIVEREF(Py_None); - /* "cpp_process.pyx":1363 + /* "cpp_process.pyx":1368 * elif callable(processor): * query = processor(query) * elif processor: # <<<<<<<<<<<<<< @@ -19025,14 +19677,14 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ goto __pyx_L5; } - /* "cpp_process.pyx":1371 + /* "cpp_process.pyx":1376 * # query might be e.g. False * else: * processor = None # <<<<<<<<<<<<<< * * if IsIntegratedScorer(scorer): */ - __Pyx_TraceLine(1371,0,__PYX_ERR(0, 1371, __pyx_L1_error)) + __Pyx_TraceLine(1376,0,__PYX_ERR(0, 1376, __pyx_L1_error)) /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_processor); @@ -19041,42 +19693,42 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ } __pyx_L5:; - /* "cpp_process.pyx":1373 + /* "cpp_process.pyx":1378 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< * # normalized distance implemented in C++ * query_context = conv_sequence(query) */ - __Pyx_TraceLine(1373,0,__PYX_ERR(0, 1373, __pyx_L1_error)) + __Pyx_TraceLine(1378,0,__PYX_ERR(0, 1378, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_scorer; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_t_1) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":1375 + /* "cpp_process.pyx":1380 * if IsIntegratedScorer(scorer): * # normalized distance implemented in C++ * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: */ - __Pyx_TraceLine(1375,0,__PYX_ERR(0, 1375, __pyx_L1_error)) + __Pyx_TraceLine(1380,0,__PYX_ERR(0, 1380, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_1); - __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_cur_scope->__pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7); - /* "cpp_process.pyx":1376 + /* "cpp_process.pyx":1381 * # normalized distance implemented in C++ * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None: * c_score_cutoff = score_cutoff */ - __Pyx_TraceLine(1376,0,__PYX_ERR(0, 1376, __pyx_L1_error)) + __Pyx_TraceLine(1381,0,__PYX_ERR(0, 1381, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_scorer; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_cur_scope->__pyx_v_kwargs; @@ -19085,30 +19737,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "cpp_process.pyx":1377 + /* "cpp_process.pyx":1382 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: */ - __Pyx_TraceLine(1377,0,__PYX_ERR(0, 1377, __pyx_L1_error)) + __Pyx_TraceLine(1382,0,__PYX_ERR(0, 1382, __pyx_L1_error)) __pyx_t_3 = (__pyx_cur_scope->__pyx_v_score_cutoff != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "cpp_process.pyx":1378 + /* "cpp_process.pyx":1383 * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") */ - __Pyx_TraceLine(1378,0,__PYX_ERR(0, 1378, __pyx_L1_error)) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L1_error) + __Pyx_TraceLine(1383,0,__PYX_ERR(0, 1383, __pyx_L1_error)) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error) __pyx_cur_scope->__pyx_v_c_score_cutoff = __pyx_t_8; - /* "cpp_process.pyx":1377 + /* "cpp_process.pyx":1382 * query_context = conv_sequence(query) * ScorerContext = CachedScorerInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -19117,14 +19769,14 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1379 + /* "cpp_process.pyx":1384 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * */ - __Pyx_TraceLine(1379,0,__PYX_ERR(0, 1379, __pyx_L1_error)) + __Pyx_TraceLine(1384,0,__PYX_ERR(0, 1384, __pyx_L1_error)) __pyx_t_3 = ((__pyx_cur_scope->__pyx_v_c_score_cutoff < 0.0) != 0); if (!__pyx_t_3) { } else { @@ -19136,21 +19788,21 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_2)) { - /* "cpp_process.pyx":1380 + /* "cpp_process.pyx":1385 * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1380,0,__PYX_ERR(0, 1380, __pyx_L1_error)) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1380, __pyx_L1_error) + __Pyx_TraceLine(1385,0,__PYX_ERR(0, 1385, __pyx_L1_error)) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1380, __pyx_L1_error) + __PYX_ERR(0, 1385, __pyx_L1_error) - /* "cpp_process.pyx":1379 + /* "cpp_process.pyx":1384 * if score_cutoff is not None: * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< @@ -19159,30 +19811,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1382 + /* "cpp_process.pyx":1387 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * yield from extract_iter_dict() * else: */ - __Pyx_TraceLine(1382,0,__PYX_ERR(0, 1382, __pyx_L1_error)) + __Pyx_TraceLine(1387,0,__PYX_ERR(0, 1387, __pyx_L1_error)) __pyx_t_4 = __pyx_cur_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1382, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_u_items); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1383 + /* "cpp_process.pyx":1388 * * if hasattr(choices, "items"): * yield from extract_iter_dict() # <<<<<<<<<<<<<< * else: * yield from extract_iter_list() */ - __Pyx_TraceLine(1383,0,__PYX_ERR(0, 1383, __pyx_L1_error)) - __pyx_t_4 = __pyx_pf_11cpp_process_12extract_iter_extract_iter_dict(__pyx_cur_scope->__pyx_v_extract_iter_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1383, __pyx_L1_error) + __Pyx_TraceLine(1388,0,__PYX_ERR(0, 1388, __pyx_L1_error)) + __pyx_t_4 = __pyx_pf_11cpp_process_12extract_iter_extract_iter_dict(__pyx_cur_scope->__pyx_v_extract_iter_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19196,16 +19848,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L12_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1383, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1388, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1383, __pyx_L1_error) + else __PYX_ERR(0, 1388, __pyx_L1_error) } } - /* "cpp_process.pyx":1382 + /* "cpp_process.pyx":1387 * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -19215,16 +19867,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ goto __pyx_L11; } - /* "cpp_process.pyx":1385 + /* "cpp_process.pyx":1390 * yield from extract_iter_dict() * else: * yield from extract_iter_list() # <<<<<<<<<<<<<< * # finish generator * return */ - __Pyx_TraceLine(1385,0,__PYX_ERR(0, 1385, __pyx_L1_error)) + __Pyx_TraceLine(1390,0,__PYX_ERR(0, 1390, __pyx_L1_error)) /*else*/ { - __pyx_t_4 = __pyx_pf_11cpp_process_12extract_iter_3extract_iter_list(__pyx_cur_scope->__pyx_v_extract_iter_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_11cpp_process_12extract_iter_3extract_iter_list(__pyx_cur_scope->__pyx_v_extract_iter_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19238,30 +19890,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L13_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1385, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1390, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1385, __pyx_L1_error) + else __PYX_ERR(0, 1390, __pyx_L1_error) } } } __pyx_L11:; - /* "cpp_process.pyx":1387 + /* "cpp_process.pyx":1392 * yield from extract_iter_list() * # finish generator * return # <<<<<<<<<<<<<< * * if IsIntegratedDistance(scorer): */ - __Pyx_TraceLine(1387,0,__PYX_ERR(0, 1387, __pyx_L1_error)) + __Pyx_TraceLine(1392,0,__PYX_ERR(0, 1392, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; - /* "cpp_process.pyx":1373 + /* "cpp_process.pyx":1378 * processor = None * * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< @@ -19270,42 +19922,42 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1389 + /* "cpp_process.pyx":1394 * return * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< * # distance implemented in C++ * query_context = conv_sequence(query) */ - __Pyx_TraceLine(1389,0,__PYX_ERR(0, 1389, __pyx_L1_error)) + __Pyx_TraceLine(1394,0,__PYX_ERR(0, 1394, __pyx_L1_error)) __pyx_t_4 = __pyx_cur_scope->__pyx_v_scorer; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_t_4) != 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "cpp_process.pyx":1391 + /* "cpp_process.pyx":1396 * if IsIntegratedDistance(scorer): * # distance implemented in C++ * query_context = conv_sequence(query) # <<<<<<<<<<<<<< * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: */ - __Pyx_TraceLine(1391,0,__PYX_ERR(0, 1391, __pyx_L1_error)) + __Pyx_TraceLine(1396,0,__PYX_ERR(0, 1396, __pyx_L1_error)) __pyx_t_4 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_4); - __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L1_error) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_cur_scope->__pyx_v_query_context = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7); - /* "cpp_process.pyx":1392 + /* "cpp_process.pyx":1397 * # distance implemented in C++ * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) # <<<<<<<<<<<<<< * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff */ - __Pyx_TraceLine(1392,0,__PYX_ERR(0, 1392, __pyx_L1_error)) + __Pyx_TraceLine(1397,0,__PYX_ERR(0, 1397, __pyx_L1_error)) __pyx_t_4 = __pyx_cur_scope->__pyx_v_scorer; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = __pyx_cur_scope->__pyx_v_kwargs; @@ -19314,14 +19966,14 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1393 + /* "cpp_process.pyx":1398 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< * c_max = score_cutoff * */ - __Pyx_TraceLine(1393,0,__PYX_ERR(0, 1393, __pyx_L1_error)) + __Pyx_TraceLine(1398,0,__PYX_ERR(0, 1398, __pyx_L1_error)) __pyx_t_2 = (__pyx_cur_scope->__pyx_v_score_cutoff != Py_None); __pyx_t_9 = (__pyx_t_2 != 0); if (__pyx_t_9) { @@ -19329,26 +19981,26 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_t_3 = __pyx_t_9; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_cur_scope->__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_cur_scope->__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1393, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_9; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { - /* "cpp_process.pyx":1394 + /* "cpp_process.pyx":1399 * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: * c_max = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1394,0,__PYX_ERR(0, 1394, __pyx_L1_error)) - __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L1_error) + __Pyx_TraceLine(1399,0,__PYX_ERR(0, 1399, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1399, __pyx_L1_error) __pyx_cur_scope->__pyx_v_c_max = __pyx_t_10; - /* "cpp_process.pyx":1393 + /* "cpp_process.pyx":1398 * query_context = conv_sequence(query) * DistanceContext = CachedDistanceInit(scorer, query_context, def_process, kwargs) * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< @@ -19357,30 +20009,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1396 + /* "cpp_process.pyx":1401 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * yield from extract_iter_distance_dict() * else: */ - __Pyx_TraceLine(1396,0,__PYX_ERR(0, 1396, __pyx_L1_error)) + __Pyx_TraceLine(1401,0,__PYX_ERR(0, 1401, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1396, __pyx_L1_error) + __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (__pyx_t_3 != 0); if (__pyx_t_9) { - /* "cpp_process.pyx":1397 + /* "cpp_process.pyx":1402 * * if hasattr(choices, "items"): * yield from extract_iter_distance_dict() # <<<<<<<<<<<<<< * else: * yield from extract_iter_distance_list() */ - __Pyx_TraceLine(1397,0,__PYX_ERR(0, 1397, __pyx_L1_error)) - __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_6extract_iter_distance_dict(__pyx_cur_scope->__pyx_v_extract_iter_distance_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) + __Pyx_TraceLine(1402,0,__PYX_ERR(0, 1402, __pyx_L1_error)) + __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_6extract_iter_distance_dict(__pyx_cur_scope->__pyx_v_extract_iter_distance_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19394,16 +20046,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L19_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1397, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1402, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1397, __pyx_L1_error) + else __PYX_ERR(0, 1402, __pyx_L1_error) } } - /* "cpp_process.pyx":1396 + /* "cpp_process.pyx":1401 * c_max = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -19413,16 +20065,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ goto __pyx_L18; } - /* "cpp_process.pyx":1399 + /* "cpp_process.pyx":1404 * yield from extract_iter_distance_dict() * else: * yield from extract_iter_distance_list() # <<<<<<<<<<<<<< * # finish generator * return */ - __Pyx_TraceLine(1399,0,__PYX_ERR(0, 1399, __pyx_L1_error)) + __Pyx_TraceLine(1404,0,__PYX_ERR(0, 1404, __pyx_L1_error)) /*else*/ { - __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_9extract_iter_distance_list(__pyx_cur_scope->__pyx_v_extract_iter_distance_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_9extract_iter_distance_list(__pyx_cur_scope->__pyx_v_extract_iter_distance_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19436,30 +20088,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L20_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1399, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1404, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1399, __pyx_L1_error) + else __PYX_ERR(0, 1404, __pyx_L1_error) } } } __pyx_L18:; - /* "cpp_process.pyx":1401 + /* "cpp_process.pyx":1406 * yield from extract_iter_distance_list() * # finish generator * return # <<<<<<<<<<<<<< * * # the scorer has to be called through Python */ - __Pyx_TraceLine(1401,0,__PYX_ERR(0, 1401, __pyx_L1_error)) + __Pyx_TraceLine(1406,0,__PYX_ERR(0, 1406, __pyx_L1_error)) __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; - /* "cpp_process.pyx":1389 + /* "cpp_process.pyx":1394 * return * * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< @@ -19468,30 +20120,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1404 + /* "cpp_process.pyx":1409 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< * c_score_cutoff = score_cutoff * */ - __Pyx_TraceLine(1404,0,__PYX_ERR(0, 1404, __pyx_L1_error)) + __Pyx_TraceLine(1409,0,__PYX_ERR(0, 1409, __pyx_L1_error)) __pyx_t_9 = (__pyx_cur_scope->__pyx_v_score_cutoff != Py_None); __pyx_t_3 = (__pyx_t_9 != 0); if (__pyx_t_3) { - /* "cpp_process.pyx":1405 + /* "cpp_process.pyx":1410 * # the scorer has to be called through Python * if score_cutoff is not None: * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __Pyx_TraceLine(1405,0,__PYX_ERR(0, 1405, __pyx_L1_error)) - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1405, __pyx_L1_error) + __Pyx_TraceLine(1410,0,__PYX_ERR(0, 1410, __pyx_L1_error)) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_cur_scope->__pyx_v_score_cutoff); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1410, __pyx_L1_error) __pyx_cur_scope->__pyx_v_c_score_cutoff = __pyx_t_8; - /* "cpp_process.pyx":1404 + /* "cpp_process.pyx":1409 * * # the scorer has to be called through Python * if score_cutoff is not None: # <<<<<<<<<<<<<< @@ -19500,30 +20152,30 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ */ } - /* "cpp_process.pyx":1407 + /* "cpp_process.pyx":1412 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< * yield from py_extract_iter_dict() * else: */ - __Pyx_TraceLine(1407,0,__PYX_ERR(0, 1407, __pyx_L1_error)) + __Pyx_TraceLine(1412,0,__PYX_ERR(0, 1412, __pyx_L1_error)) __pyx_t_1 = __pyx_cur_scope->__pyx_v_choices; __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (__pyx_t_3 != 0); if (__pyx_t_9) { - /* "cpp_process.pyx":1408 + /* "cpp_process.pyx":1413 * * if hasattr(choices, "items"): * yield from py_extract_iter_dict() # <<<<<<<<<<<<<< * else: * yield from py_extract_iter_list() */ - __Pyx_TraceLine(1408,0,__PYX_ERR(0, 1408, __pyx_L1_error)) - __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_12py_extract_iter_dict(__pyx_cur_scope->__pyx_v_py_extract_iter_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) + __Pyx_TraceLine(1413,0,__PYX_ERR(0, 1413, __pyx_L1_error)) + __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_12py_extract_iter_dict(__pyx_cur_scope->__pyx_v_py_extract_iter_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19537,16 +20189,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L23_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1413, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1408, __pyx_L1_error) + else __PYX_ERR(0, 1413, __pyx_L1_error) } } - /* "cpp_process.pyx":1407 + /* "cpp_process.pyx":1412 * c_score_cutoff = score_cutoff * * if hasattr(choices, "items"): # <<<<<<<<<<<<<< @@ -19556,14 +20208,16 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ goto __pyx_L22; } - /* "cpp_process.pyx":1410 + /* "cpp_process.pyx":1415 * yield from py_extract_iter_dict() * else: * yield from py_extract_iter_list() # <<<<<<<<<<<<<< + * + * */ - __Pyx_TraceLine(1410,0,__PYX_ERR(0, 1410, __pyx_L1_error)) + __Pyx_TraceLine(1415,0,__PYX_ERR(0, 1415, __pyx_L1_error)) /*else*/ { - __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_15py_extract_iter_list(__pyx_cur_scope->__pyx_v_py_extract_iter_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_11cpp_process_12extract_iter_15py_extract_iter_list(__pyx_cur_scope->__pyx_v_py_extract_iter_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19577,19 +20231,19 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L24_resume_from_yield_from:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1410, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1415, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); - else __PYX_ERR(0, 1410, __pyx_L1_error) + else __PYX_ERR(0, 1415, __pyx_L1_error) } } } __pyx_L22:; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "cpp_process.pyx":1104 + /* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< @@ -19618,8 +20272,4636 @@ static PyObject *__pyx_gb_11cpp_process_6generator(__pyx_CoroutineObject *__pyx_ return __pyx_r; } -/* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + +/* "cpp_process.pyx":1420 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, + * const vector[proc_string]& choices, + */ + +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_two_lists_similarity(std::vector const &__pyx_v_queries, std::vector const &__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + size_t __pyx_v_choices_len; + size_t __pyx_v_i; + size_t __pyx_v_j; + double __pyx_v_c_score_cutoff; + PyArrayObject *__pyx_v_matrix = 0; + CachedScorerContext __pyx_v_ScorerContext; + __Pyx_LocalBuf_ND __pyx_pybuffernd_matrix; + __Pyx_Buffer __pyx_pybuffer_matrix; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + double __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + size_t __pyx_t_12; + size_t __pyx_t_13; + size_t __pyx_t_14; + size_t __pyx_t_15; + size_t __pyx_t_16; + size_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_two_lists_similarity", 0); + __Pyx_TraceCall("cdist_two_lists_similarity", __pyx_f[0], 1420, 0, __PYX_ERR(0, 1420, __pyx_L1_error)); + __pyx_pybuffer_matrix.pybuffer.buf = NULL; + __pyx_pybuffer_matrix.refcount = 0; + __pyx_pybuffernd_matrix.data = NULL; + __pyx_pybuffernd_matrix.rcbuffer = &__pyx_pybuffer_matrix; + + /* "cpp_process.pyx":1425 + * scorer, score_cutoff, dict kwargs + * ): + * cdef size_t queries_len = queries.size() # <<<<<<<<<<<<<< + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + */ + __Pyx_TraceLine(1425,0,__PYX_ERR(0, 1425, __pyx_L1_error)) + __pyx_v_queries_len = __pyx_v_queries.size(); + + /* "cpp_process.pyx":1426 + * ): + * cdef size_t queries_len = queries.size() + * cdef size_t choices_len = choices.size() # <<<<<<<<<<<<<< + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + */ + __Pyx_TraceLine(1426,0,__PYX_ERR(0, 1426, __pyx_L1_error)) + __pyx_v_choices_len = __pyx_v_choices.size(); + + /* "cpp_process.pyx":1428 + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + * cdef double c_score_cutoff = 0 # <<<<<<<<<<<<<< + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + */ + __Pyx_TraceLine(1428,0,__PYX_ERR(0, 1428, __pyx_L1_error)) + __pyx_v_c_score_cutoff = 0.0; + + /* "cpp_process.pyx":1429 + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if score_cutoff is not None: + */ + __Pyx_TraceLine(1429,0,__PYX_ERR(0, 1429, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_choices_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 1429, __pyx_L1_error) + } else {__pyx_pybuffernd_matrix.diminfo[0].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_matrix.diminfo[0].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_matrix.diminfo[1].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_matrix.diminfo[1].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_matrix = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cpp_process.pyx":1431 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + __Pyx_TraceLine(1431,0,__PYX_ERR(0, 1431, __pyx_L1_error)) + __pyx_t_7 = (__pyx_v_score_cutoff != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "cpp_process.pyx":1432 + * + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + */ + __Pyx_TraceLine(1432,0,__PYX_ERR(0, 1432, __pyx_L1_error)) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_v_c_score_cutoff = __pyx_t_9; + + /* "cpp_process.pyx":1431 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + } + + /* "cpp_process.pyx":1433 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + __Pyx_TraceLine(1433,0,__PYX_ERR(0, 1433, __pyx_L1_error)) + __pyx_t_7 = ((__pyx_v_c_score_cutoff < 0.0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = ((__pyx_v_c_score_cutoff > 100.0) != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_8)) { + + /* "cpp_process.pyx":1434 + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< + * + * c_score_cutoff = floor(c_score_cutoff) + */ + __Pyx_TraceLine(1434,0,__PYX_ERR(0, 1434, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1434, __pyx_L1_error) + + /* "cpp_process.pyx":1433 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + } + + /* "cpp_process.pyx":1436 + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + * c_score_cutoff = floor(c_score_cutoff) # <<<<<<<<<<<<<< + * + * for i in range(queries_len): + */ + __Pyx_TraceLine(1436,0,__PYX_ERR(0, 1436, __pyx_L1_error)) + __pyx_v_c_score_cutoff = floor(__pyx_v_c_score_cutoff); + + /* "cpp_process.pyx":1438 + * c_score_cutoff = floor(c_score_cutoff) + * + * for i in range(queries_len): # <<<<<<<<<<<<<< + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): + */ + __Pyx_TraceLine(1438,0,__PYX_ERR(0, 1438, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_queries_len; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "cpp_process.pyx":1439 + * + * for i in range(queries_len): + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) # <<<<<<<<<<<<<< + * for j in range(choices_len): + * matrix[i, j] = floor(ScorerContext.ratio(choices[j], c_score_cutoff)) + */ + __Pyx_TraceLine(1439,0,__PYX_ERR(0, 1439, __pyx_L1_error)) + __pyx_v_ScorerContext = __pyx_f_11cpp_process_CachedScorerInit(__pyx_v_scorer, (__pyx_v_queries[__pyx_v_i]), 0, __pyx_v_kwargs); + + /* "cpp_process.pyx":1440 + * for i in range(queries_len): + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): # <<<<<<<<<<<<<< + * matrix[i, j] = floor(ScorerContext.ratio(choices[j], c_score_cutoff)) + * + */ + __Pyx_TraceLine(1440,0,__PYX_ERR(0, 1440, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_choices_len; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "cpp_process.pyx":1441 + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): + * matrix[i, j] = floor(ScorerContext.ratio(choices[j], c_score_cutoff)) # <<<<<<<<<<<<<< + * + * return matrix + */ + __Pyx_TraceLine(1441,0,__PYX_ERR(0, 1441, __pyx_L1_error)) + try { + __pyx_t_9 = __pyx_v_ScorerContext.ratio((__pyx_v_choices[__pyx_v_j]), __pyx_v_c_score_cutoff); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1441, __pyx_L1_error) + } + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[1].strides) = ((uint8_t)floor(__pyx_t_9)); + } + } + + /* "cpp_process.pyx":1443 + * matrix[i, j] = floor(ScorerContext.ratio(choices[j], c_score_cutoff)) + * + * return matrix # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1443,0,__PYX_ERR(0, 1443, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_matrix); + __pyx_r = ((PyObject *)__pyx_v_matrix); + goto __pyx_L0; + + /* "cpp_process.pyx":1420 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, + * const vector[proc_string]& choices, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cpp_process.cdist_two_lists_similarity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_matrix); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1447 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, const vector[proc_string]& choices, + * scorer, score_cutoff, dict kwargs + */ + +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_two_lists_distance(std::vector const &__pyx_v_queries, std::vector const &__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + size_t __pyx_v_choices_len; + size_t __pyx_v_i; + size_t __pyx_v_j; + size_t __pyx_v_c_max; + PyArrayObject *__pyx_v_matrix = 0; + CachedDistanceContext __pyx_v_DistanceContext; + __Pyx_LocalBuf_ND __pyx_pybuffernd_matrix; + __Pyx_Buffer __pyx_pybuffer_matrix; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + size_t __pyx_t_12; + size_t __pyx_t_13; + size_t __pyx_t_14; + size_t __pyx_t_15; + size_t __pyx_t_16; + size_t __pyx_t_17; + size_t __pyx_t_18; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_two_lists_distance", 0); + __Pyx_TraceCall("cdist_two_lists_distance", __pyx_f[0], 1447, 0, __PYX_ERR(0, 1447, __pyx_L1_error)); + __pyx_pybuffer_matrix.pybuffer.buf = NULL; + __pyx_pybuffer_matrix.refcount = 0; + __pyx_pybuffernd_matrix.data = NULL; + __pyx_pybuffernd_matrix.rcbuffer = &__pyx_pybuffer_matrix; + + /* "cpp_process.pyx":1451 + * scorer, score_cutoff, dict kwargs + * ): + * cdef size_t queries_len = queries.size() # <<<<<<<<<<<<<< + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + */ + __Pyx_TraceLine(1451,0,__PYX_ERR(0, 1451, __pyx_L1_error)) + __pyx_v_queries_len = __pyx_v_queries.size(); + + /* "cpp_process.pyx":1452 + * ): + * cdef size_t queries_len = queries.size() + * cdef size_t choices_len = choices.size() # <<<<<<<<<<<<<< + * cdef size_t i, j + * cdef size_t c_max = -1 + */ + __Pyx_TraceLine(1452,0,__PYX_ERR(0, 1452, __pyx_L1_error)) + __pyx_v_choices_len = __pyx_v_choices.size(); + + /* "cpp_process.pyx":1454 + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + * cdef size_t c_max = -1 # <<<<<<<<<<<<<< + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.int32) + * + */ + __Pyx_TraceLine(1454,0,__PYX_ERR(0, 1454, __pyx_L1_error)) + __pyx_v_c_max = ((size_t)-1L); + + /* "cpp_process.pyx":1455 + * cdef size_t i, j + * cdef size_t c_max = -1 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.int32) # <<<<<<<<<<<<<< + * + * if score_cutoff is not None and score_cutoff != -1: + */ + __Pyx_TraceLine(1455,0,__PYX_ERR(0, 1455, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_choices_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1455, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 1455, __pyx_L1_error) + } else {__pyx_pybuffernd_matrix.diminfo[0].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_matrix.diminfo[0].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_matrix.diminfo[1].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_matrix.diminfo[1].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_matrix = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cpp_process.pyx":1457 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.int32) + * + * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< + * c_max = score_cutoff + * + */ + __Pyx_TraceLine(1457,0,__PYX_ERR(0, 1457, __pyx_L1_error)) + __pyx_t_8 = (__pyx_v_score_cutoff != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1457, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_9; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "cpp_process.pyx":1458 + * + * if score_cutoff is not None and score_cutoff != -1: + * c_max = score_cutoff # <<<<<<<<<<<<<< + * + * for i in range(queries_len): + */ + __Pyx_TraceLine(1458,0,__PYX_ERR(0, 1458, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1458, __pyx_L1_error) + __pyx_v_c_max = __pyx_t_10; + + /* "cpp_process.pyx":1457 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.int32) + * + * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< + * c_max = score_cutoff + * + */ + } + + /* "cpp_process.pyx":1460 + * c_max = score_cutoff + * + * for i in range(queries_len): # <<<<<<<<<<<<<< + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): + */ + __Pyx_TraceLine(1460,0,__PYX_ERR(0, 1460, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_queries_len; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "cpp_process.pyx":1461 + * + * for i in range(queries_len): + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) # <<<<<<<<<<<<<< + * for j in range(choices_len): + * matrix[i, j] = DistanceContext.ratio(choices[j], c_max) + */ + __Pyx_TraceLine(1461,0,__PYX_ERR(0, 1461, __pyx_L1_error)) + __pyx_v_DistanceContext = __pyx_f_11cpp_process_CachedDistanceInit(__pyx_v_scorer, (__pyx_v_queries[__pyx_v_i]), 0, __pyx_v_kwargs); + + /* "cpp_process.pyx":1462 + * for i in range(queries_len): + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): # <<<<<<<<<<<<<< + * matrix[i, j] = DistanceContext.ratio(choices[j], c_max) + * + */ + __Pyx_TraceLine(1462,0,__PYX_ERR(0, 1462, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_choices_len; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "cpp_process.pyx":1463 + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(choices_len): + * matrix[i, j] = DistanceContext.ratio(choices[j], c_max) # <<<<<<<<<<<<<< + * + * return matrix + */ + __Pyx_TraceLine(1463,0,__PYX_ERR(0, 1463, __pyx_L1_error)) + try { + __pyx_t_16 = __pyx_v_DistanceContext.ratio((__pyx_v_choices[__pyx_v_j]), __pyx_v_c_max); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1463, __pyx_L1_error) + } + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_matrix.diminfo[1].strides) = ((int32_t)__pyx_t_16); + } + } + + /* "cpp_process.pyx":1465 + * matrix[i, j] = DistanceContext.ratio(choices[j], c_max) + * + * return matrix # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1465,0,__PYX_ERR(0, 1465, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_matrix); + __pyx_r = ((PyObject *)__pyx_v_matrix); + goto __pyx_L0; + + /* "cpp_process.pyx":1447 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, const vector[proc_string]& choices, + * scorer, score_cutoff, dict kwargs + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cpp_process.cdist_two_lists_distance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_matrix); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1469 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline py_cdist_two_lists( # <<<<<<<<<<<<<< + * const vector[PyObject*]& queries, const vector[PyObject*]& choices, + * scorer, score_cutoff, dict kwargs + */ + +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_py_cdist_two_lists(std::vector const &__pyx_v_queries, std::vector const &__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + size_t __pyx_v_choices_len; + size_t __pyx_v_i; + size_t __pyx_v_j; + double __pyx_v_c_score_cutoff; + PyArrayObject *__pyx_v_matrix = 0; + __Pyx_LocalBuf_ND __pyx_pybuffernd_matrix; + __Pyx_Buffer __pyx_pybuffer_matrix; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + double __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + size_t __pyx_t_12; + size_t __pyx_t_13; + size_t __pyx_t_14; + size_t __pyx_t_15; + PyObject *__pyx_t_16; + PyObject *__pyx_t_17; + size_t __pyx_t_18; + size_t __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("py_cdist_two_lists", 0); + __Pyx_TraceCall("py_cdist_two_lists", __pyx_f[0], 1469, 0, __PYX_ERR(0, 1469, __pyx_L1_error)); + __pyx_pybuffer_matrix.pybuffer.buf = NULL; + __pyx_pybuffer_matrix.refcount = 0; + __pyx_pybuffernd_matrix.data = NULL; + __pyx_pybuffernd_matrix.rcbuffer = &__pyx_pybuffer_matrix; + + /* "cpp_process.pyx":1473 + * scorer, score_cutoff, dict kwargs + * ): + * cdef size_t queries_len = queries.size() # <<<<<<<<<<<<<< + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + */ + __Pyx_TraceLine(1473,0,__PYX_ERR(0, 1473, __pyx_L1_error)) + __pyx_v_queries_len = __pyx_v_queries.size(); + + /* "cpp_process.pyx":1474 + * ): + * cdef size_t queries_len = queries.size() + * cdef size_t choices_len = choices.size() # <<<<<<<<<<<<<< + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + */ + __Pyx_TraceLine(1474,0,__PYX_ERR(0, 1474, __pyx_L1_error)) + __pyx_v_choices_len = __pyx_v_choices.size(); + + /* "cpp_process.pyx":1476 + * cdef size_t choices_len = choices.size() + * cdef size_t i, j + * cdef double c_score_cutoff = 0 # <<<<<<<<<<<<<< + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + */ + __Pyx_TraceLine(1476,0,__PYX_ERR(0, 1476, __pyx_L1_error)) + __pyx_v_c_score_cutoff = 0.0; + + /* "cpp_process.pyx":1477 + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if score_cutoff is not None: + */ + __Pyx_TraceLine(1477,0,__PYX_ERR(0, 1477, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_choices_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1477, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 1477, __pyx_L1_error) + } else {__pyx_pybuffernd_matrix.diminfo[0].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_matrix.diminfo[0].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_matrix.diminfo[1].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_matrix.diminfo[1].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_matrix = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cpp_process.pyx":1479 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + __Pyx_TraceLine(1479,0,__PYX_ERR(0, 1479, __pyx_L1_error)) + __pyx_t_7 = (__pyx_v_score_cutoff != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "cpp_process.pyx":1480 + * + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + */ + __Pyx_TraceLine(1480,0,__PYX_ERR(0, 1480, __pyx_L1_error)) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L1_error) + __pyx_v_c_score_cutoff = __pyx_t_9; + + /* "cpp_process.pyx":1479 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + } + + /* "cpp_process.pyx":1481 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + __Pyx_TraceLine(1481,0,__PYX_ERR(0, 1481, __pyx_L1_error)) + __pyx_t_7 = ((__pyx_v_c_score_cutoff < 0.0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = ((__pyx_v_c_score_cutoff > 100.0) != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_8)) { + + /* "cpp_process.pyx":1482 + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< + * + * c_score_cutoff = floor(c_score_cutoff) + */ + __Pyx_TraceLine(1482,0,__PYX_ERR(0, 1482, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1482, __pyx_L1_error) + + /* "cpp_process.pyx":1481 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + } + + /* "cpp_process.pyx":1484 + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + * c_score_cutoff = floor(c_score_cutoff) # <<<<<<<<<<<<<< + * + * kwargs["processor"] = None + */ + __Pyx_TraceLine(1484,0,__PYX_ERR(0, 1484, __pyx_L1_error)) + __pyx_v_c_score_cutoff = floor(__pyx_v_c_score_cutoff); + + /* "cpp_process.pyx":1486 + * c_score_cutoff = floor(c_score_cutoff) + * + * kwargs["processor"] = None # <<<<<<<<<<<<<< + * kwargs["score_cutoff"] = c_score_cutoff + * + */ + __Pyx_TraceLine(1486,0,__PYX_ERR(0, 1486, __pyx_L1_error)) + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1486, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_processor, Py_None) < 0))) __PYX_ERR(0, 1486, __pyx_L1_error) + + /* "cpp_process.pyx":1487 + * + * kwargs["processor"] = None + * kwargs["score_cutoff"] = c_score_cutoff # <<<<<<<<<<<<<< + * + * for i in range(queries_len): + */ + __Pyx_TraceLine(1487,0,__PYX_ERR(0, 1487, __pyx_L1_error)) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_c_score_cutoff); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1487, __pyx_L1_error) + } + if (unlikely((PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_score_cutoff, __pyx_t_5) < 0))) __PYX_ERR(0, 1487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "cpp_process.pyx":1489 + * kwargs["score_cutoff"] = c_score_cutoff + * + * for i in range(queries_len): # <<<<<<<<<<<<<< + * for j in range(choices_len): + * matrix[i, j] = floor( + */ + __Pyx_TraceLine(1489,0,__PYX_ERR(0, 1489, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_queries_len; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "cpp_process.pyx":1490 + * + * for i in range(queries_len): + * for j in range(choices_len): # <<<<<<<<<<<<<< + * matrix[i, j] = floor( + * scorer(queries[i], choices[j],**kwargs)) + */ + __Pyx_TraceLine(1490,0,__PYX_ERR(0, 1490, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_choices_len; + __pyx_t_14 = __pyx_t_13; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "cpp_process.pyx":1492 + * for j in range(choices_len): + * matrix[i, j] = floor( + * scorer(queries[i], choices[j],**kwargs)) # <<<<<<<<<<<<<< + * + * return matrix + */ + __Pyx_TraceLine(1492,0,__PYX_ERR(0, 1492, __pyx_L1_error)) + __pyx_t_16 = (__pyx_v_queries[__pyx_v_i]); + __pyx_t_17 = (__pyx_v_choices[__pyx_v_j]); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_t_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_16)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_16)); + __Pyx_INCREF(((PyObject *)__pyx_t_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_17)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_17)); + if (unlikely(__pyx_v_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 1492, __pyx_L1_error) + } + __pyx_t_4 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_scorer, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "cpp_process.pyx":1491 + * for i in range(queries_len): + * for j in range(choices_len): + * matrix[i, j] = floor( # <<<<<<<<<<<<<< + * scorer(queries[i], choices[j],**kwargs)) + * + */ + __Pyx_TraceLine(1491,0,__PYX_ERR(0, 1491, __pyx_L1_error)) + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_matrix.diminfo[1].strides) = ((uint8_t)floor(((double)__pyx_t_9))); + } + } + + /* "cpp_process.pyx":1494 + * scorer(queries[i], choices[j],**kwargs)) + * + * return matrix # <<<<<<<<<<<<<< + * + * cdef cdist_two_lists(queries, choices, scorer, processor, score_cutoff, dict kwargs): + */ + __Pyx_TraceLine(1494,0,__PYX_ERR(0, 1494, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_matrix); + __pyx_r = ((PyObject *)__pyx_v_matrix); + goto __pyx_L0; + + /* "cpp_process.pyx":1469 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline py_cdist_two_lists( # <<<<<<<<<<<<<< + * const vector[PyObject*]& queries, const vector[PyObject*]& choices, + * scorer, score_cutoff, dict kwargs + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cpp_process.py_cdist_two_lists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_matrix); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1496 + * return matrix + * + * cdef cdist_two_lists(queries, choices, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef vector[proc_string] proc_queries + * cdef vector[proc_string] proc_choices + */ + +static PyObject *__pyx_f_11cpp_process_cdist_two_lists(PyObject *__pyx_v_queries, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + std::vector __pyx_v_proc_queries; + std::vector __pyx_v_proc_choices; + std::vector __pyx_v_proc_py_queries; + std::vector __pyx_v_proc_py_choices; + size_t __pyx_v_queries_len; + size_t __pyx_v_choices_len; + PyObject *__pyx_v_query = NULL; + PyObject *__pyx_v_choice = NULL; + PyObject *__pyx_v_proc_query = NULL; + PyObject *__pyx_v_proc_choice = NULL; + PyObject *__pyx_v_item; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + proc_string __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + proc_string __pyx_t_12; + std::vector ::iterator __pyx_t_13; + PyObject *__pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_two_lists", 0); + __Pyx_TraceCall("cdist_two_lists", __pyx_f[0], 1496, 0, __PYX_ERR(0, 1496, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_processor); + + /* "cpp_process.pyx":1501 + * cdef vector[PyObject*] proc_py_queries + * cdef vector[PyObject*] proc_py_choices + * cdef size_t queries_len = len(queries) # <<<<<<<<<<<<<< + * cdef size_t choices_len = len(choices) + * + */ + __Pyx_TraceLine(1501,0,__PYX_ERR(0, 1501, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_queries); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1501, __pyx_L1_error) + __pyx_v_queries_len = ((size_t)__pyx_t_1); + + /* "cpp_process.pyx":1502 + * cdef vector[PyObject*] proc_py_choices + * cdef size_t queries_len = len(queries) + * cdef size_t choices_len = len(choices) # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_TraceLine(1502,0,__PYX_ERR(0, 1502, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_choices); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1502, __pyx_L1_error) + __pyx_v_choices_len = ((size_t)__pyx_t_1); + + /* "cpp_process.pyx":1504 + * cdef size_t choices_len = len(choices) + * + * try: # <<<<<<<<<<<<<< + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + * proc_queries.reserve(queries_len) + */ + __Pyx_TraceLine(1504,0,__PYX_ERR(0, 1504, __pyx_L1_error)) + /*try:*/ { + + /* "cpp_process.pyx":1505 + * + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * proc_queries.reserve(queries_len) + * proc_choices.reserve(choices_len) + */ + __Pyx_TraceLine(1505,0,__PYX_ERR(0, 1505, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + if (__pyx_t_2) { + + /* "cpp_process.pyx":1506 + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + * proc_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * proc_choices.reserve(choices_len) + * + */ + __Pyx_TraceLine(1506,0,__PYX_ERR(0, 1506, __pyx_L4_error)) + try { + __pyx_v_proc_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1506, __pyx_L4_error) + } + + /* "cpp_process.pyx":1507 + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + * proc_queries.reserve(queries_len) + * proc_choices.reserve(choices_len) # <<<<<<<<<<<<<< + * + * # processor None/False + */ + __Pyx_TraceLine(1507,0,__PYX_ERR(0, 1507, __pyx_L4_error)) + try { + __pyx_v_proc_choices.reserve(__pyx_v_choices_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1507, __pyx_L4_error) + } + + /* "cpp_process.pyx":1510 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) + */ + __Pyx_TraceLine(1510,0,__PYX_ERR(0, 1510, __pyx_L4_error)) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1510, __pyx_L4_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1511 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(query))) + * + */ + __Pyx_TraceLine(1511,0,__PYX_ERR(0, 1511, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1511, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1511, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1511, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1511, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1511, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1511, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1512 + * if not processor: + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) # <<<<<<<<<<<<<< + * + * for choice in choices: + */ + __Pyx_TraceLine(1512,0,__PYX_ERR(0, 1512, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1512, __pyx_L4_error) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1512, __pyx_L4_error) + } + + /* "cpp_process.pyx":1511 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(query))) + * + */ + __Pyx_TraceLine(1511,0,__PYX_ERR(0, 1511, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1514 + * proc_queries.push_back(move(conv_sequence(query))) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choices.push_back(move(conv_sequence(choice))) + * # processor has to be called through python + */ + __Pyx_TraceLine(1514,0,__PYX_ERR(0, 1514, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { + __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1514, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1514, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1514, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1514, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1514, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1515 + * + * for choice in choices: + * proc_choices.push_back(move(conv_sequence(choice))) # <<<<<<<<<<<<<< + * # processor has to be called through python + * elif processor is not default_process and callable(processor): + */ + __Pyx_TraceLine(1515,0,__PYX_ERR(0, 1515, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L4_error) + try { + __pyx_v_proc_choices.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1515, __pyx_L4_error) + } + + /* "cpp_process.pyx":1514 + * proc_queries.push_back(move(conv_sequence(query))) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choices.push_back(move(conv_sequence(choice))) + * # processor has to be called through python + */ + __Pyx_TraceLine(1514,0,__PYX_ERR(0, 1514, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1510 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) + */ + goto __pyx_L9; + } + + /* "cpp_process.pyx":1517 + * proc_choices.push_back(move(conv_sequence(choice))) + * # processor has to be called through python + * elif processor is not default_process and callable(processor): # <<<<<<<<<<<<<< + * proc_py_queries.reserve(queries_len) + * for query in queries: + */ + __Pyx_TraceLine(1517,0,__PYX_ERR(0, 1517, __pyx_L4_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__pyx_v_processor != __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + } else { + __pyx_t_3 = __pyx_t_8; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1517, __pyx_L4_error) + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L14_bool_binop_done:; + if (__pyx_t_3) { + + /* "cpp_process.pyx":1518 + * # processor has to be called through python + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * for query in queries: + * proc_query = processor(query) + */ + __Pyx_TraceLine(1518,0,__PYX_ERR(0, 1518, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1518, __pyx_L4_error) + } + + /* "cpp_process.pyx":1519 + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1519,0,__PYX_ERR(0, 1519, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1519, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1519, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1519, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1519, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1520 + * proc_py_queries.reserve(queries_len) + * for query in queries: + * proc_query = processor(query) # <<<<<<<<<<<<<< + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + */ + __Pyx_TraceLine(1520,0,__PYX_ERR(0, 1520, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_query}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1520, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1521 + * for query in queries: + * proc_query = processor(query) + * Py_INCREF(proc_query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(proc_query) + * proc_queries.push_back(move(conv_sequence(proc_query))) + */ + __Pyx_TraceLine(1521,0,__PYX_ERR(0, 1521, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_query); + + /* "cpp_process.pyx":1522 + * proc_query = processor(query) + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(proc_query))) + * + */ + __Pyx_TraceLine(1522,0,__PYX_ERR(0, 1522, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_proc_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1522, __pyx_L4_error) + } + + /* "cpp_process.pyx":1523 + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + * proc_queries.push_back(move(conv_sequence(proc_query))) # <<<<<<<<<<<<<< + * + * proc_py_choices.reserve(choices_len) + */ + __Pyx_TraceLine(1523,0,__PYX_ERR(0, 1523, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L4_error) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1523, __pyx_L4_error) + } + + /* "cpp_process.pyx":1519 + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1519,0,__PYX_ERR(0, 1519, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1525 + * proc_queries.push_back(move(conv_sequence(proc_query))) + * + * proc_py_choices.reserve(choices_len) # <<<<<<<<<<<<<< + * for choice in choices: + * proc_choice = processor(choice) + */ + __Pyx_TraceLine(1525,0,__PYX_ERR(0, 1525, __pyx_L4_error)) + try { + __pyx_v_proc_py_choices.reserve(__pyx_v_choices_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1525, __pyx_L4_error) + } + + /* "cpp_process.pyx":1526 + * + * proc_py_choices.reserve(choices_len) + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + */ + __Pyx_TraceLine(1526,0,__PYX_ERR(0, 1526, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { + __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1526, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1526, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1526, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1526, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1527 + * proc_py_choices.reserve(choices_len) + * for choice in choices: + * proc_choice = processor(choice) # <<<<<<<<<<<<<< + * Py_INCREF(proc_choice) + * proc_py_choices.push_back(proc_choice) + */ + __Pyx_TraceLine(1527,0,__PYX_ERR(0, 1527, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1527, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1528 + * for choice in choices: + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) # <<<<<<<<<<<<<< + * proc_py_choices.push_back(proc_choice) + * proc_choices.push_back(move(conv_sequence(proc_choice))) + */ + __Pyx_TraceLine(1528,0,__PYX_ERR(0, 1528, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_choice); + + /* "cpp_process.pyx":1529 + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + * proc_py_choices.push_back(proc_choice) # <<<<<<<<<<<<<< + * proc_choices.push_back(move(conv_sequence(proc_choice))) + * + */ + __Pyx_TraceLine(1529,0,__PYX_ERR(0, 1529, __pyx_L4_error)) + try { + __pyx_v_proc_py_choices.push_back(((PyObject *)__pyx_v_proc_choice)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1529, __pyx_L4_error) + } + + /* "cpp_process.pyx":1530 + * Py_INCREF(proc_choice) + * proc_py_choices.push_back(proc_choice) + * proc_choices.push_back(move(conv_sequence(proc_choice))) # <<<<<<<<<<<<<< + * + * # processor is True / default_process + */ + __Pyx_TraceLine(1530,0,__PYX_ERR(0, 1530, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1530, __pyx_L4_error) + try { + __pyx_v_proc_choices.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1530, __pyx_L4_error) + } + + /* "cpp_process.pyx":1526 + * + * proc_py_choices.reserve(choices_len) + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + */ + __Pyx_TraceLine(1526,0,__PYX_ERR(0, 1526, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1517 + * proc_choices.push_back(move(conv_sequence(choice))) + * # processor has to be called through python + * elif processor is not default_process and callable(processor): # <<<<<<<<<<<<<< + * proc_py_queries.reserve(queries_len) + * for query in queries: + */ + goto __pyx_L9; + } + + /* "cpp_process.pyx":1534 + * # processor is True / default_process + * else: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) + */ + __Pyx_TraceLine(1534,0,__PYX_ERR(0, 1534, __pyx_L4_error)) + /*else*/ { + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1534, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1534, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1534, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1534, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1534, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1536 + * for query in queries: + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) # <<<<<<<<<<<<<< + * ) + * + */ + __Pyx_TraceLine(1536,0,__PYX_ERR(0, 1536, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1536, __pyx_L4_error) + try { + __pyx_t_12 = default_process_func(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1536, __pyx_L4_error) + } + + /* "cpp_process.pyx":1535 + * else: + * for query in queries: + * proc_queries.push_back( # <<<<<<<<<<<<<< + * move(default_process_func(move(conv_sequence(query)))) + * ) + */ + __Pyx_TraceLine(1535,0,__PYX_ERR(0, 1535, __pyx_L4_error)) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1535, __pyx_L4_error) + } + + /* "cpp_process.pyx":1534 + * # processor is True / default_process + * else: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) + */ + __Pyx_TraceLine(1534,0,__PYX_ERR(0, 1534, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1539 + * ) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choices.push_back( + * move(default_process_func(move(conv_sequence(choice)))) + */ + __Pyx_TraceLine(1539,0,__PYX_ERR(0, 1539, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { + __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1539, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1539, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1539, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1539, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1539, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1539, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1541 + * for choice in choices: + * proc_choices.push_back( + * move(default_process_func(move(conv_sequence(choice)))) # <<<<<<<<<<<<<< + * ) + * + */ + __Pyx_TraceLine(1541,0,__PYX_ERR(0, 1541, __pyx_L4_error)) + __pyx_t_12 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_choice); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1541, __pyx_L4_error) + try { + __pyx_t_7 = default_process_func(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1541, __pyx_L4_error) + } + + /* "cpp_process.pyx":1540 + * + * for choice in choices: + * proc_choices.push_back( # <<<<<<<<<<<<<< + * move(default_process_func(move(conv_sequence(choice)))) + * ) + */ + __Pyx_TraceLine(1540,0,__PYX_ERR(0, 1540, __pyx_L4_error)) + try { + __pyx_v_proc_choices.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1540, __pyx_L4_error) + } + + /* "cpp_process.pyx":1539 + * ) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choices.push_back( + * move(default_process_func(move(conv_sequence(choice)))) + */ + __Pyx_TraceLine(1539,0,__PYX_ERR(0, 1539, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L9:; + + /* "cpp_process.pyx":1544 + * ) + * + * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< + * return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + */ + __Pyx_TraceLine(1544,0,__PYX_ERR(0, 1544, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1545 + * + * if IsIntegratedScorer(scorer): + * return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * if IsIntegratedDistance(scorer): + */ + __Pyx_TraceLine(1545,0,__PYX_ERR(0, 1545, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_cdist_two_lists_similarity(__pyx_v_proc_queries, __pyx_v_proc_choices, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + + /* "cpp_process.pyx":1544 + * ) + * + * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< + * return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + */ + } + + /* "cpp_process.pyx":1547 + * return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * return cdist_two_lists_distance(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + */ + __Pyx_TraceLine(1547,0,__PYX_ERR(0, 1547, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1548 + * + * if IsIntegratedDistance(scorer): + * return cdist_two_lists_distance(proc_queries, proc_choices, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_TraceLine(1548,0,__PYX_ERR(0, 1548, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_cdist_two_lists_distance(__pyx_v_proc_queries, __pyx_v_proc_choices, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + + /* "cpp_process.pyx":1547 + * return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * return cdist_two_lists_distance(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + * + */ + } + + /* "cpp_process.pyx":1505 + * + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * proc_queries.reserve(queries_len) + * proc_choices.reserve(choices_len) + */ + goto __pyx_L6; + } + + /* "cpp_process.pyx":1551 + * + * else: + * proc_py_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * proc_py_choices.reserve(choices_len) + * + */ + __Pyx_TraceLine(1551,0,__PYX_ERR(0, 1551, __pyx_L4_error)) + /*else*/ { + try { + __pyx_v_proc_py_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1551, __pyx_L4_error) + } + + /* "cpp_process.pyx":1552 + * else: + * proc_py_queries.reserve(queries_len) + * proc_py_choices.reserve(choices_len) # <<<<<<<<<<<<<< + * + * # processor None/False + */ + __Pyx_TraceLine(1552,0,__PYX_ERR(0, 1552, __pyx_L4_error)) + try { + __pyx_v_proc_py_choices.reserve(__pyx_v_choices_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1552, __pyx_L4_error) + } + + /* "cpp_process.pyx":1555 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * Py_INCREF(query) + */ + __Pyx_TraceLine(1555,0,__PYX_ERR(0, 1555, __pyx_L4_error)) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1555, __pyx_L4_error) + __pyx_t_2 = ((!__pyx_t_3) != 0); + if (__pyx_t_2) { + + /* "cpp_process.pyx":1556 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * Py_INCREF(query) + * proc_py_queries.push_back(query) + */ + __Pyx_TraceLine(1556,0,__PYX_ERR(0, 1556, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1556, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1556, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1556, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1556, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1556, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1556, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1556, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1557 + * if not processor: + * for query in queries: + * Py_INCREF(query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(query) + * + */ + __Pyx_TraceLine(1557,0,__PYX_ERR(0, 1557, __pyx_L4_error)) + Py_INCREF(__pyx_v_query); + + /* "cpp_process.pyx":1558 + * for query in queries: + * Py_INCREF(query) + * proc_py_queries.push_back(query) # <<<<<<<<<<<<<< + * + * for choice in choices: + */ + __Pyx_TraceLine(1558,0,__PYX_ERR(0, 1558, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1558, __pyx_L4_error) + } + + /* "cpp_process.pyx":1556 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * Py_INCREF(query) + * proc_py_queries.push_back(query) + */ + __Pyx_TraceLine(1556,0,__PYX_ERR(0, 1556, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1560 + * proc_py_queries.push_back(query) + * + * for choice in choices: # <<<<<<<<<<<<<< + * Py_INCREF(choice) + * proc_py_choices.push_back(choice) + */ + __Pyx_TraceLine(1560,0,__PYX_ERR(0, 1560, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { + __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1560, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1560, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1560, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1560, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1560, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1560, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1561 + * + * for choice in choices: + * Py_INCREF(choice) # <<<<<<<<<<<<<< + * proc_py_choices.push_back(choice) + * # processor has to be called through python + */ + __Pyx_TraceLine(1561,0,__PYX_ERR(0, 1561, __pyx_L4_error)) + Py_INCREF(__pyx_v_choice); + + /* "cpp_process.pyx":1562 + * for choice in choices: + * Py_INCREF(choice) + * proc_py_choices.push_back(choice) # <<<<<<<<<<<<<< + * # processor has to be called through python + * else: + */ + __Pyx_TraceLine(1562,0,__PYX_ERR(0, 1562, __pyx_L4_error)) + try { + __pyx_v_proc_py_choices.push_back(((PyObject *)__pyx_v_choice)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1562, __pyx_L4_error) + } + + /* "cpp_process.pyx":1560 + * proc_py_queries.push_back(query) + * + * for choice in choices: # <<<<<<<<<<<<<< + * Py_INCREF(choice) + * proc_py_choices.push_back(choice) + */ + __Pyx_TraceLine(1560,0,__PYX_ERR(0, 1560, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1555 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * Py_INCREF(query) + */ + goto __pyx_L26; + } + + /* "cpp_process.pyx":1565 + * # processor has to be called through python + * else: + * if not callable(processor): # <<<<<<<<<<<<<< + * processor = default_process + * + */ + __Pyx_TraceLine(1565,0,__PYX_ERR(0, 1565, __pyx_L4_error)) + /*else*/ { + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1565, __pyx_L4_error) + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1566 + * else: + * if not callable(processor): + * processor = default_process # <<<<<<<<<<<<<< + * + * for query in queries: + */ + __Pyx_TraceLine(1566,0,__PYX_ERR(0, 1566, __pyx_L4_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_processor, __pyx_t_4); + __pyx_t_4 = 0; + + /* "cpp_process.pyx":1565 + * # processor has to be called through python + * else: + * if not callable(processor): # <<<<<<<<<<<<<< + * processor = default_process + * + */ + } + + /* "cpp_process.pyx":1568 + * processor = default_process + * + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1568,0,__PYX_ERR(0, 1568, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1568, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1568, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1568, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1568, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1568, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1569 + * + * for query in queries: + * proc_query = processor(query) # <<<<<<<<<<<<<< + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + */ + __Pyx_TraceLine(1569,0,__PYX_ERR(0, 1569, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_query}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1569, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1570 + * for query in queries: + * proc_query = processor(query) + * Py_INCREF(proc_query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(proc_query) + * + */ + __Pyx_TraceLine(1570,0,__PYX_ERR(0, 1570, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_query); + + /* "cpp_process.pyx":1571 + * proc_query = processor(query) + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) # <<<<<<<<<<<<<< + * + * for choice in choices: + */ + __Pyx_TraceLine(1571,0,__PYX_ERR(0, 1571, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_proc_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1571, __pyx_L4_error) + } + + /* "cpp_process.pyx":1568 + * processor = default_process + * + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1568,0,__PYX_ERR(0, 1568, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1573 + * proc_py_queries.push_back(proc_query) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + */ + __Pyx_TraceLine(1573,0,__PYX_ERR(0, 1573, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_choices)) || PyTuple_CheckExact(__pyx_v_choices)) { + __pyx_t_4 = __pyx_v_choices; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_choices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1573, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1573, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1573, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1573, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1573, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1573, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1573, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1574 + * + * for choice in choices: + * proc_choice = processor(choice) # <<<<<<<<<<<<<< + * Py_INCREF(proc_choice) + * proc_py_choices.push_back(proc_choice) + */ + __Pyx_TraceLine(1574,0,__PYX_ERR(0, 1574, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_choice}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_choice, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1575 + * for choice in choices: + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) # <<<<<<<<<<<<<< + * proc_py_choices.push_back(proc_choice) + * + */ + __Pyx_TraceLine(1575,0,__PYX_ERR(0, 1575, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_choice); + + /* "cpp_process.pyx":1576 + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + * proc_py_choices.push_back(proc_choice) # <<<<<<<<<<<<<< + * + * return py_cdist_two_lists(proc_py_queries, proc_py_choices, scorer, score_cutoff, kwargs) + */ + __Pyx_TraceLine(1576,0,__PYX_ERR(0, 1576, __pyx_L4_error)) + try { + __pyx_v_proc_py_choices.push_back(((PyObject *)__pyx_v_proc_choice)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1576, __pyx_L4_error) + } + + /* "cpp_process.pyx":1573 + * proc_py_queries.push_back(proc_query) + * + * for choice in choices: # <<<<<<<<<<<<<< + * proc_choice = processor(choice) + * Py_INCREF(proc_choice) + */ + __Pyx_TraceLine(1573,0,__PYX_ERR(0, 1573, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L26:; + + /* "cpp_process.pyx":1578 + * proc_py_choices.push_back(proc_choice) + * + * return py_cdist_two_lists(proc_py_queries, proc_py_choices, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * finally: + */ + __Pyx_TraceLine(1578,0,__PYX_ERR(0, 1578, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_py_cdist_two_lists(__pyx_v_proc_py_queries, __pyx_v_proc_py_choices, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + } + __pyx_L6:; + } + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L4_error)) + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1583 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * for item in proc_py_choices: + */ + __Pyx_TraceLine(1583,0,__PYX_ERR(0, 1583, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L1_error)) + } + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_proc_py_choices.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_choices.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1586 + * + * for item in proc_py_choices: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1586,0,__PYX_ERR(0, 1586, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L1_error)) + } + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L41_error)) + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1583 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * for item in proc_py_choices: + */ + __Pyx_TraceLine(1583,0,__PYX_ERR(0, 1583, __pyx_L41_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L41_error)) + } + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L41_error)) + __pyx_t_13 = __pyx_v_proc_py_choices.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_choices.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1586 + * + * for item in proc_py_choices: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1586,0,__PYX_ERR(0, 1586, __pyx_L41_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L41_error)) + } + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L1_error; + __pyx_L41_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_22 = __pyx_r; + __pyx_r = 0; + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1583 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * for item in proc_py_choices: + */ + __Pyx_TraceLine(1583,0,__PYX_ERR(0, 1583, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1582 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L1_error)) + } + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_proc_py_choices.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_choices.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1586 + * + * for item in proc_py_choices: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1586,0,__PYX_ERR(0, 1586, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1585 + * Py_DECREF(item) + * + * for item in proc_py_choices: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1585,0,__PYX_ERR(0, 1585, __pyx_L1_error)) + } + __pyx_r = __pyx_t_22; + __pyx_t_22 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "cpp_process.pyx":1496 + * return matrix + * + * cdef cdist_two_lists(queries, choices, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef vector[proc_string] proc_queries + * cdef vector[proc_string] proc_choices + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("cpp_process.cdist_two_lists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_query); + __Pyx_XDECREF(__pyx_v_choice); + __Pyx_XDECREF(__pyx_v_proc_query); + __Pyx_XDECREF(__pyx_v_proc_choice); + __Pyx_XDECREF(__pyx_v_processor); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1590 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_single_list_similarity(std::vector const &__pyx_v_queries, PyObject *__pyx_v_scorer, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + size_t __pyx_v_i; + size_t __pyx_v_j; + double __pyx_v_c_score_cutoff; + PyArrayObject *__pyx_v_matrix = 0; + CachedScorerContext __pyx_v_ScorerContext; + uint8_t __pyx_v_score; + __Pyx_LocalBuf_ND __pyx_pybuffernd_matrix; + __Pyx_Buffer __pyx_pybuffer_matrix; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + double __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + size_t __pyx_t_12; + size_t __pyx_t_13; + size_t __pyx_t_14; + size_t __pyx_t_15; + size_t __pyx_t_16; + size_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_single_list_similarity", 0); + __Pyx_TraceCall("cdist_single_list_similarity", __pyx_f[0], 1590, 0, __PYX_ERR(0, 1590, __pyx_L1_error)); + __pyx_pybuffer_matrix.pybuffer.buf = NULL; + __pyx_pybuffer_matrix.refcount = 0; + __pyx_pybuffernd_matrix.data = NULL; + __pyx_pybuffernd_matrix.rcbuffer = &__pyx_pybuffer_matrix; + + /* "cpp_process.pyx":1593 + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + * cdef size_t queries_len = queries.size() # <<<<<<<<<<<<<< + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + */ + __Pyx_TraceLine(1593,0,__PYX_ERR(0, 1593, __pyx_L1_error)) + __pyx_v_queries_len = __pyx_v_queries.size(); + + /* "cpp_process.pyx":1595 + * cdef size_t queries_len = queries.size() + * cdef size_t i, j + * cdef double c_score_cutoff = 0 # <<<<<<<<<<<<<< + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.uint8) + * + */ + __Pyx_TraceLine(1595,0,__PYX_ERR(0, 1595, __pyx_L1_error)) + __pyx_v_c_score_cutoff = 0.0; + + /* "cpp_process.pyx":1596 + * cdef size_t i, j + * cdef double c_score_cutoff = 0 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.uint8) # <<<<<<<<<<<<<< + * + * if score_cutoff is not None: + */ + __Pyx_TraceLine(1596,0,__PYX_ERR(0, 1596, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 1596, __pyx_L1_error) + } else {__pyx_pybuffernd_matrix.diminfo[0].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_matrix.diminfo[0].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_matrix.diminfo[1].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_matrix.diminfo[1].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_matrix = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cpp_process.pyx":1598 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + __Pyx_TraceLine(1598,0,__PYX_ERR(0, 1598, __pyx_L1_error)) + __pyx_t_7 = (__pyx_v_score_cutoff != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "cpp_process.pyx":1599 + * + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff # <<<<<<<<<<<<<< + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + */ + __Pyx_TraceLine(1599,0,__PYX_ERR(0, 1599, __pyx_L1_error)) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_score_cutoff); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1599, __pyx_L1_error) + __pyx_v_c_score_cutoff = __pyx_t_9; + + /* "cpp_process.pyx":1598 + * cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.uint8) + * + * if score_cutoff is not None: # <<<<<<<<<<<<<< + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + */ + } + + /* "cpp_process.pyx":1600 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + __Pyx_TraceLine(1600,0,__PYX_ERR(0, 1600, __pyx_L1_error)) + __pyx_t_7 = ((__pyx_v_c_score_cutoff < 0.0) != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_7 = ((__pyx_v_c_score_cutoff > 100.0) != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_8)) { + + /* "cpp_process.pyx":1601 + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< + * + * c_score_cutoff = floor(c_score_cutoff) + */ + __Pyx_TraceLine(1601,0,__PYX_ERR(0, 1601, __pyx_L1_error)) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1601, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 1601, __pyx_L1_error) + + /* "cpp_process.pyx":1600 + * if score_cutoff is not None: + * c_score_cutoff = score_cutoff + * if c_score_cutoff < 0 or c_score_cutoff > 100: # <<<<<<<<<<<<<< + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + */ + } + + /* "cpp_process.pyx":1603 + * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + * + * c_score_cutoff = floor(c_score_cutoff) # <<<<<<<<<<<<<< + * + * for i in range(queries_len): + */ + __Pyx_TraceLine(1603,0,__PYX_ERR(0, 1603, __pyx_L1_error)) + __pyx_v_c_score_cutoff = floor(__pyx_v_c_score_cutoff); + + /* "cpp_process.pyx":1605 + * c_score_cutoff = floor(c_score_cutoff) + * + * for i in range(queries_len): # <<<<<<<<<<<<<< + * matrix[i, i] = 100 + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + */ + __Pyx_TraceLine(1605,0,__PYX_ERR(0, 1605, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_queries_len; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "cpp_process.pyx":1606 + * + * for i in range(queries_len): + * matrix[i, i] = 100 # <<<<<<<<<<<<<< + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): + */ + __Pyx_TraceLine(1606,0,__PYX_ERR(0, 1606, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_matrix.diminfo[1].strides) = 0x64; + + /* "cpp_process.pyx":1607 + * for i in range(queries_len): + * matrix[i, i] = 100 + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) # <<<<<<<<<<<<<< + * for j in range(i + 1, queries_len): + * score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) + */ + __Pyx_TraceLine(1607,0,__PYX_ERR(0, 1607, __pyx_L1_error)) + __pyx_v_ScorerContext = __pyx_f_11cpp_process_CachedScorerInit(__pyx_v_scorer, (__pyx_v_queries[__pyx_v_i]), 0, __pyx_v_kwargs); + + /* "cpp_process.pyx":1608 + * matrix[i, i] = 100 + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): # <<<<<<<<<<<<<< + * score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) + * matrix[i, j] = score + */ + __Pyx_TraceLine(1608,0,__PYX_ERR(0, 1608, __pyx_L1_error)) + __pyx_t_14 = __pyx_v_queries_len; + __pyx_t_13 = __pyx_t_14; + for (__pyx_t_15 = (__pyx_v_i + 1); __pyx_t_15 < __pyx_t_13; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "cpp_process.pyx":1609 + * ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): + * score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) # <<<<<<<<<<<<<< + * matrix[i, j] = score + * matrix[j, i] = score + */ + __Pyx_TraceLine(1609,0,__PYX_ERR(0, 1609, __pyx_L1_error)) + try { + __pyx_t_9 = __pyx_v_ScorerContext.ratio((__pyx_v_queries[__pyx_v_j]), __pyx_v_c_score_cutoff); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1609, __pyx_L1_error) + } + __pyx_v_score = ((uint8_t)floor(__pyx_t_9)); + + /* "cpp_process.pyx":1610 + * for j in range(i + 1, queries_len): + * score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) + * matrix[i, j] = score # <<<<<<<<<<<<<< + * matrix[j, i] = score + * + */ + __Pyx_TraceLine(1610,0,__PYX_ERR(0, 1610, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[1].strides) = __pyx_v_score; + + /* "cpp_process.pyx":1611 + * score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) + * matrix[i, j] = score + * matrix[j, i] = score # <<<<<<<<<<<<<< + * + * return matrix + */ + __Pyx_TraceLine(1611,0,__PYX_ERR(0, 1611, __pyx_L1_error)) + __pyx_t_17 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_matrix.diminfo[1].strides) = __pyx_v_score; + } + } + + /* "cpp_process.pyx":1613 + * matrix[j, i] = score + * + * return matrix # <<<<<<<<<<<<<< + * + * @cython.boundscheck(False) + */ + __Pyx_TraceLine(1613,0,__PYX_ERR(0, 1613, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_matrix); + __pyx_r = ((PyObject *)__pyx_v_matrix); + goto __pyx_L0; + + /* "cpp_process.pyx":1590 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cpp_process.cdist_single_list_similarity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_matrix); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1617 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + +static CYTHON_INLINE PyObject *__pyx_f_11cpp_process_cdist_single_list_distance(std::vector const &__pyx_v_queries, PyObject *__pyx_v_scorer, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + size_t __pyx_v_i; + size_t __pyx_v_j; + size_t __pyx_v_c_max; + PyArrayObject *__pyx_v_matrix = 0; + CachedDistanceContext __pyx_v_DistanceContext; + int32_t __pyx_v_score; + __Pyx_LocalBuf_ND __pyx_pybuffernd_matrix; + __Pyx_Buffer __pyx_pybuffer_matrix; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyArrayObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + size_t __pyx_t_10; + size_t __pyx_t_11; + size_t __pyx_t_12; + size_t __pyx_t_13; + size_t __pyx_t_14; + size_t __pyx_t_15; + size_t __pyx_t_16; + size_t __pyx_t_17; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_single_list_distance", 0); + __Pyx_TraceCall("cdist_single_list_distance", __pyx_f[0], 1617, 0, __PYX_ERR(0, 1617, __pyx_L1_error)); + __pyx_pybuffer_matrix.pybuffer.buf = NULL; + __pyx_pybuffer_matrix.refcount = 0; + __pyx_pybuffernd_matrix.data = NULL; + __pyx_pybuffernd_matrix.rcbuffer = &__pyx_pybuffer_matrix; + + /* "cpp_process.pyx":1620 + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + * cdef size_t queries_len = queries.size() # <<<<<<<<<<<<<< + * cdef size_t i, j + * cdef size_t c_max = -1 + */ + __Pyx_TraceLine(1620,0,__PYX_ERR(0, 1620, __pyx_L1_error)) + __pyx_v_queries_len = __pyx_v_queries.size(); + + /* "cpp_process.pyx":1622 + * cdef size_t queries_len = queries.size() + * cdef size_t i, j + * cdef size_t c_max = -1 # <<<<<<<<<<<<<< + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.int32) + * + */ + __Pyx_TraceLine(1622,0,__PYX_ERR(0, 1622, __pyx_L1_error)) + __pyx_v_c_max = ((size_t)-1L); + + /* "cpp_process.pyx":1623 + * cdef size_t i, j + * cdef size_t c_max = -1 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.int32) # <<<<<<<<<<<<<< + * + * if score_cutoff is not None and score_cutoff != -1: + */ + __Pyx_TraceLine(1623,0,__PYX_ERR(0, 1623, __pyx_L1_error)) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_queries_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1623, __pyx_L1_error) + __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf = NULL; + __PYX_ERR(0, 1623, __pyx_L1_error) + } else {__pyx_pybuffernd_matrix.diminfo[0].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_matrix.diminfo[0].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_matrix.diminfo[1].strides = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_matrix.diminfo[1].shape = __pyx_pybuffernd_matrix.rcbuffer->pybuffer.shape[1]; + } + } + __pyx_t_6 = 0; + __pyx_v_matrix = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "cpp_process.pyx":1625 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.int32) + * + * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< + * c_max = score_cutoff + * + */ + __Pyx_TraceLine(1625,0,__PYX_ERR(0, 1625, __pyx_L1_error)) + __pyx_t_8 = (__pyx_v_score_cutoff != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_v_score_cutoff, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1625, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1625, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_9; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "cpp_process.pyx":1626 + * + * if score_cutoff is not None and score_cutoff != -1: + * c_max = score_cutoff # <<<<<<<<<<<<<< + * + * for i in range(queries_len): + */ + __Pyx_TraceLine(1626,0,__PYX_ERR(0, 1626, __pyx_L1_error)) + __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_score_cutoff); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1626, __pyx_L1_error) + __pyx_v_c_max = __pyx_t_10; + + /* "cpp_process.pyx":1625 + * cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.int32) + * + * if score_cutoff is not None and score_cutoff != -1: # <<<<<<<<<<<<<< + * c_max = score_cutoff + * + */ + } + + /* "cpp_process.pyx":1628 + * c_max = score_cutoff + * + * for i in range(queries_len): # <<<<<<<<<<<<<< + * matrix[i, i] = 0 + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + */ + __Pyx_TraceLine(1628,0,__PYX_ERR(0, 1628, __pyx_L1_error)) + __pyx_t_10 = __pyx_v_queries_len; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "cpp_process.pyx":1629 + * + * for i in range(queries_len): + * matrix[i, i] = 0 # <<<<<<<<<<<<<< + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): + */ + __Pyx_TraceLine(1629,0,__PYX_ERR(0, 1629, __pyx_L1_error)) + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_matrix.diminfo[1].strides) = 0; + + /* "cpp_process.pyx":1630 + * for i in range(queries_len): + * matrix[i, i] = 0 + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) # <<<<<<<<<<<<<< + * for j in range(i + 1, queries_len): + * score = DistanceContext.ratio(queries[j], c_max) + */ + __Pyx_TraceLine(1630,0,__PYX_ERR(0, 1630, __pyx_L1_error)) + __pyx_v_DistanceContext = __pyx_f_11cpp_process_CachedDistanceInit(__pyx_v_scorer, (__pyx_v_queries[__pyx_v_i]), 0, __pyx_v_kwargs); + + /* "cpp_process.pyx":1631 + * matrix[i, i] = 0 + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): # <<<<<<<<<<<<<< + * score = DistanceContext.ratio(queries[j], c_max) + * matrix[i, j] = score + */ + __Pyx_TraceLine(1631,0,__PYX_ERR(0, 1631, __pyx_L1_error)) + __pyx_t_14 = __pyx_v_queries_len; + __pyx_t_13 = __pyx_t_14; + for (__pyx_t_15 = (__pyx_v_i + 1); __pyx_t_15 < __pyx_t_13; __pyx_t_15+=1) { + __pyx_v_j = __pyx_t_15; + + /* "cpp_process.pyx":1632 + * DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + * for j in range(i + 1, queries_len): + * score = DistanceContext.ratio(queries[j], c_max) # <<<<<<<<<<<<<< + * matrix[i, j] = score + * matrix[j, i] = score + */ + __Pyx_TraceLine(1632,0,__PYX_ERR(0, 1632, __pyx_L1_error)) + try { + __pyx_t_16 = __pyx_v_DistanceContext.ratio((__pyx_v_queries[__pyx_v_j]), __pyx_v_c_max); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1632, __pyx_L1_error) + } + __pyx_v_score = ((int32_t)__pyx_t_16); + + /* "cpp_process.pyx":1633 + * for j in range(i + 1, queries_len): + * score = DistanceContext.ratio(queries[j], c_max) + * matrix[i, j] = score # <<<<<<<<<<<<<< + * matrix[j, i] = score + * + */ + __Pyx_TraceLine(1633,0,__PYX_ERR(0, 1633, __pyx_L1_error)) + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_j; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[1].strides) = __pyx_v_score; + + /* "cpp_process.pyx":1634 + * score = DistanceContext.ratio(queries[j], c_max) + * matrix[i, j] = score + * matrix[j, i] = score # <<<<<<<<<<<<<< + * + * return matrix + */ + __Pyx_TraceLine(1634,0,__PYX_ERR(0, 1634, __pyx_L1_error)) + __pyx_t_17 = __pyx_v_j; + __pyx_t_16 = __pyx_v_i; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_matrix.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_matrix.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_matrix.diminfo[1].strides) = __pyx_v_score; + } + } + + /* "cpp_process.pyx":1636 + * matrix[j, i] = score + * + * return matrix # <<<<<<<<<<<<<< + * + * cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): + */ + __Pyx_TraceLine(1636,0,__PYX_ERR(0, 1636, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF((PyObject *)__pyx_v_matrix); + __pyx_r = ((PyObject *)__pyx_v_matrix); + goto __pyx_L0; + + /* "cpp_process.pyx":1617 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("cpp_process.cdist_single_list_distance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_matrix.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_matrix); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1638 + * return matrix + * + * cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t queries_len = len(queries) + * + */ + +static PyObject *__pyx_f_11cpp_process_cdist_single_list(PyObject *__pyx_v_queries, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + size_t __pyx_v_queries_len; + std::vector __pyx_v_proc_queries; + std::vector __pyx_v_proc_py_queries; + PyObject *__pyx_v_query = NULL; + PyObject *__pyx_v_proc_query = NULL; + PyObject *__pyx_v_item; + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + proc_string __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + proc_string __pyx_t_12; + std::vector ::iterator __pyx_t_13; + PyObject *__pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("cdist_single_list", 0); + __Pyx_TraceCall("cdist_single_list", __pyx_f[0], 1638, 0, __PYX_ERR(0, 1638, __pyx_L1_error)); + __Pyx_INCREF(__pyx_v_processor); + + /* "cpp_process.pyx":1639 + * + * cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): + * cdef size_t queries_len = len(queries) # <<<<<<<<<<<<<< + * + * cdef vector[proc_string] proc_queries + */ + __Pyx_TraceLine(1639,0,__PYX_ERR(0, 1639, __pyx_L1_error)) + __pyx_t_1 = PyObject_Length(__pyx_v_queries); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1639, __pyx_L1_error) + __pyx_v_queries_len = ((size_t)__pyx_t_1); + + /* "cpp_process.pyx":1644 + * cdef vector[PyObject*] proc_py_queries + * + * try: # <<<<<<<<<<<<<< + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + * proc_queries.reserve(queries_len) + */ + __Pyx_TraceLine(1644,0,__PYX_ERR(0, 1644, __pyx_L1_error)) + /*try:*/ { + + /* "cpp_process.pyx":1645 + * + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * proc_queries.reserve(queries_len) + * + */ + __Pyx_TraceLine(1645,0,__PYX_ERR(0, 1645, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_2 = __pyx_t_3; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L7_bool_binop_done:; + if (__pyx_t_2) { + + /* "cpp_process.pyx":1646 + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + * proc_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * + * # processor None/False + */ + __Pyx_TraceLine(1646,0,__PYX_ERR(0, 1646, __pyx_L4_error)) + try { + __pyx_v_proc_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1646, __pyx_L4_error) + } + + /* "cpp_process.pyx":1649 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) + */ + __Pyx_TraceLine(1649,0,__PYX_ERR(0, 1649, __pyx_L4_error)) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1649, __pyx_L4_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1650 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(query))) + * # processor has to be called through python + */ + __Pyx_TraceLine(1650,0,__PYX_ERR(0, 1650, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1650, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1650, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1650, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1650, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1650, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1650, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1651 + * if not processor: + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) # <<<<<<<<<<<<<< + * # processor has to be called through python + * elif processor is not default_process and callable(processor): + */ + __Pyx_TraceLine(1651,0,__PYX_ERR(0, 1651, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1651, __pyx_L4_error) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1651, __pyx_L4_error) + } + + /* "cpp_process.pyx":1650 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(query))) + * # processor has to be called through python + */ + __Pyx_TraceLine(1650,0,__PYX_ERR(0, 1650, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1649 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * proc_queries.push_back(move(conv_sequence(query))) + */ + goto __pyx_L9; + } + + /* "cpp_process.pyx":1653 + * proc_queries.push_back(move(conv_sequence(query))) + * # processor has to be called through python + * elif processor is not default_process and callable(processor): # <<<<<<<<<<<<<< + * proc_py_queries.reserve(queries_len) + * for query in queries: + */ + __Pyx_TraceLine(1653,0,__PYX_ERR(0, 1653, __pyx_L4_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (__pyx_v_processor != __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + } else { + __pyx_t_3 = __pyx_t_8; + goto __pyx_L12_bool_binop_done; + } + __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1653, __pyx_L4_error) + __pyx_t_2 = (__pyx_t_8 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L12_bool_binop_done:; + if (__pyx_t_3) { + + /* "cpp_process.pyx":1654 + * # processor has to be called through python + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * for query in queries: + * proc_query = processor(query) + */ + __Pyx_TraceLine(1654,0,__PYX_ERR(0, 1654, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1654, __pyx_L4_error) + } + + /* "cpp_process.pyx":1655 + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1655,0,__PYX_ERR(0, 1655, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1655, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1655, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1655, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1655, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1656 + * proc_py_queries.reserve(queries_len) + * for query in queries: + * proc_query = processor(query) # <<<<<<<<<<<<<< + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + */ + __Pyx_TraceLine(1656,0,__PYX_ERR(0, 1656, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_query}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1656, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1657 + * for query in queries: + * proc_query = processor(query) + * Py_INCREF(proc_query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(proc_query) + * proc_queries.push_back(move(conv_sequence(proc_query))) + */ + __Pyx_TraceLine(1657,0,__PYX_ERR(0, 1657, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_query); + + /* "cpp_process.pyx":1658 + * proc_query = processor(query) + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) # <<<<<<<<<<<<<< + * proc_queries.push_back(move(conv_sequence(proc_query))) + * + */ + __Pyx_TraceLine(1658,0,__PYX_ERR(0, 1658, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_proc_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1658, __pyx_L4_error) + } + + /* "cpp_process.pyx":1659 + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + * proc_queries.push_back(move(conv_sequence(proc_query))) # <<<<<<<<<<<<<< + * + * # processor is True / default_process + */ + __Pyx_TraceLine(1659,0,__PYX_ERR(0, 1659, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_proc_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1659, __pyx_L4_error) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1659, __pyx_L4_error) + } + + /* "cpp_process.pyx":1655 + * elif processor is not default_process and callable(processor): + * proc_py_queries.reserve(queries_len) + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1655,0,__PYX_ERR(0, 1655, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1653 + * proc_queries.push_back(move(conv_sequence(query))) + * # processor has to be called through python + * elif processor is not default_process and callable(processor): # <<<<<<<<<<<<<< + * proc_py_queries.reserve(queries_len) + * for query in queries: + */ + goto __pyx_L9; + } + + /* "cpp_process.pyx":1663 + * # processor is True / default_process + * else: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) + */ + __Pyx_TraceLine(1663,0,__PYX_ERR(0, 1663, __pyx_L4_error)) + /*else*/ { + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1663, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1663, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1663, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1663, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1663, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1663, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1663, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1665 + * for query in queries: + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) # <<<<<<<<<<<<<< + * ) + * + */ + __Pyx_TraceLine(1665,0,__PYX_ERR(0, 1665, __pyx_L4_error)) + __pyx_t_7 = __pyx_f_11cpp_process_conv_sequence(__pyx_v_query); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1665, __pyx_L4_error) + try { + __pyx_t_12 = default_process_func(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1665, __pyx_L4_error) + } + + /* "cpp_process.pyx":1664 + * else: + * for query in queries: + * proc_queries.push_back( # <<<<<<<<<<<<<< + * move(default_process_func(move(conv_sequence(query)))) + * ) + */ + __Pyx_TraceLine(1664,0,__PYX_ERR(0, 1664, __pyx_L4_error)) + try { + __pyx_v_proc_queries.push_back(cython_std::move(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1664, __pyx_L4_error) + } + + /* "cpp_process.pyx":1663 + * # processor is True / default_process + * else: + * for query in queries: # <<<<<<<<<<<<<< + * proc_queries.push_back( + * move(default_process_func(move(conv_sequence(query)))) + */ + __Pyx_TraceLine(1663,0,__PYX_ERR(0, 1663, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L9:; + + /* "cpp_process.pyx":1668 + * ) + * + * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< + * return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) + * + */ + __Pyx_TraceLine(1668,0,__PYX_ERR(0, 1668, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedScorer(__pyx_v_scorer) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1669 + * + * if IsIntegratedScorer(scorer): + * return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * if IsIntegratedDistance(scorer): + */ + __Pyx_TraceLine(1669,0,__PYX_ERR(0, 1669, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_cdist_single_list_similarity(__pyx_v_proc_queries, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1669, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + + /* "cpp_process.pyx":1668 + * ) + * + * if IsIntegratedScorer(scorer): # <<<<<<<<<<<<<< + * return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) + * + */ + } + + /* "cpp_process.pyx":1671 + * return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) + * + * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * return cdist_single_list_distance(proc_queries, scorer, score_cutoff, kwargs) + * + */ + __Pyx_TraceLine(1671,0,__PYX_ERR(0, 1671, __pyx_L4_error)) + __pyx_t_3 = (__pyx_f_11cpp_process_IsIntegratedDistance(__pyx_v_scorer) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1672 + * + * if IsIntegratedDistance(scorer): + * return cdist_single_list_distance(proc_queries, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * else: + */ + __Pyx_TraceLine(1672,0,__PYX_ERR(0, 1672, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_cdist_single_list_distance(__pyx_v_proc_queries, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + + /* "cpp_process.pyx":1671 + * return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) + * + * if IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * return cdist_single_list_distance(proc_queries, scorer, score_cutoff, kwargs) + * + */ + } + + /* "cpp_process.pyx":1645 + * + * try: + * if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): # <<<<<<<<<<<<<< + * proc_queries.reserve(queries_len) + * + */ + goto __pyx_L6; + } + + /* "cpp_process.pyx":1675 + * + * else: + * proc_py_queries.reserve(queries_len) # <<<<<<<<<<<<<< + * + * # processor None/False + */ + __Pyx_TraceLine(1675,0,__PYX_ERR(0, 1675, __pyx_L4_error)) + /*else*/ { + try { + __pyx_v_proc_py_queries.reserve(__pyx_v_queries_len); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1675, __pyx_L4_error) + } + + /* "cpp_process.pyx":1678 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * Py_INCREF(query) + */ + __Pyx_TraceLine(1678,0,__PYX_ERR(0, 1678, __pyx_L4_error)) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_processor); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1678, __pyx_L4_error) + __pyx_t_2 = ((!__pyx_t_3) != 0); + if (__pyx_t_2) { + + /* "cpp_process.pyx":1679 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * Py_INCREF(query) + * proc_py_queries.push_back(query) + */ + __Pyx_TraceLine(1679,0,__PYX_ERR(0, 1679, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1679, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1679, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1679, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1679, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1679, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1679, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1679, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1680 + * if not processor: + * for query in queries: + * Py_INCREF(query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(query) + * # processor has to be called through python + */ + __Pyx_TraceLine(1680,0,__PYX_ERR(0, 1680, __pyx_L4_error)) + Py_INCREF(__pyx_v_query); + + /* "cpp_process.pyx":1681 + * for query in queries: + * Py_INCREF(query) + * proc_py_queries.push_back(query) # <<<<<<<<<<<<<< + * # processor has to be called through python + * else: + */ + __Pyx_TraceLine(1681,0,__PYX_ERR(0, 1681, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1681, __pyx_L4_error) + } + + /* "cpp_process.pyx":1679 + * # processor None/False + * if not processor: + * for query in queries: # <<<<<<<<<<<<<< + * Py_INCREF(query) + * proc_py_queries.push_back(query) + */ + __Pyx_TraceLine(1679,0,__PYX_ERR(0, 1679, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "cpp_process.pyx":1678 + * + * # processor None/False + * if not processor: # <<<<<<<<<<<<<< + * for query in queries: + * Py_INCREF(query) + */ + goto __pyx_L20; + } + + /* "cpp_process.pyx":1684 + * # processor has to be called through python + * else: + * if not callable(processor): # <<<<<<<<<<<<<< + * processor = default_process + * + */ + __Pyx_TraceLine(1684,0,__PYX_ERR(0, 1684, __pyx_L4_error)) + /*else*/ { + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_processor); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1684, __pyx_L4_error) + __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_3) { + + /* "cpp_process.pyx":1685 + * else: + * if not callable(processor): + * processor = default_process # <<<<<<<<<<<<<< + * + * for query in queries: + */ + __Pyx_TraceLine(1685,0,__PYX_ERR(0, 1685, __pyx_L4_error)) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1685, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF_SET(__pyx_v_processor, __pyx_t_4); + __pyx_t_4 = 0; + + /* "cpp_process.pyx":1684 + * # processor has to be called through python + * else: + * if not callable(processor): # <<<<<<<<<<<<<< + * processor = default_process + * + */ + } + + /* "cpp_process.pyx":1687 + * processor = default_process + * + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1687,0,__PYX_ERR(0, 1687, __pyx_L4_error)) + if (likely(PyList_CheckExact(__pyx_v_queries)) || PyTuple_CheckExact(__pyx_v_queries)) { + __pyx_t_4 = __pyx_v_queries; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_queries); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1687, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1687, __pyx_L4_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1687, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 1687, __pyx_L4_error) + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_4); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1687, __pyx_L4_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1688 + * + * for query in queries: + * proc_query = processor(query) # <<<<<<<<<<<<<< + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) + */ + __Pyx_TraceLine(1688,0,__PYX_ERR(0, 1688, __pyx_L4_error)) + __Pyx_INCREF(__pyx_v_processor); + __pyx_t_9 = __pyx_v_processor; __pyx_t_10 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; + } + } + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_query}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1688, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_proc_query, __pyx_t_6); + __pyx_t_6 = 0; + + /* "cpp_process.pyx":1689 + * for query in queries: + * proc_query = processor(query) + * Py_INCREF(proc_query) # <<<<<<<<<<<<<< + * proc_py_queries.push_back(proc_query) + * + */ + __Pyx_TraceLine(1689,0,__PYX_ERR(0, 1689, __pyx_L4_error)) + Py_INCREF(__pyx_v_proc_query); + + /* "cpp_process.pyx":1690 + * proc_query = processor(query) + * Py_INCREF(proc_query) + * proc_py_queries.push_back(proc_query) # <<<<<<<<<<<<<< + * + * # scorer(a, b) might not be equal to scorer(b, a) + */ + __Pyx_TraceLine(1690,0,__PYX_ERR(0, 1690, __pyx_L4_error)) + try { + __pyx_v_proc_py_queries.push_back(((PyObject *)__pyx_v_proc_query)); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 1690, __pyx_L4_error) + } + + /* "cpp_process.pyx":1687 + * processor = default_process + * + * for query in queries: # <<<<<<<<<<<<<< + * proc_query = processor(query) + * Py_INCREF(proc_query) + */ + __Pyx_TraceLine(1687,0,__PYX_ERR(0, 1687, __pyx_L4_error)) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L20:; + + /* "cpp_process.pyx":1693 + * + * # scorer(a, b) might not be equal to scorer(b, a) + * return py_cdist_two_lists(proc_py_queries, proc_py_queries, scorer, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * + * finally: + */ + __Pyx_TraceLine(1693,0,__PYX_ERR(0, 1693, __pyx_L4_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __pyx_f_11cpp_process_py_cdist_two_lists(__pyx_v_proc_py_queries, __pyx_v_proc_py_queries, __pyx_v_scorer, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1693, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L3_return; + } + __pyx_L6:; + } + + /* "cpp_process.pyx":1697 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1697,0,__PYX_ERR(0, 1697, __pyx_L4_error)) + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1698 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): + */ + __Pyx_TraceLine(1698,0,__PYX_ERR(0, 1698, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1697 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1697,0,__PYX_ERR(0, 1697, __pyx_L1_error)) + } + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1698 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): + */ + __Pyx_TraceLine(1698,0,__PYX_ERR(0, 1698, __pyx_L29_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1697 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1697,0,__PYX_ERR(0, 1697, __pyx_L29_error)) + } + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L1_error; + __pyx_L29_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_22 = __pyx_r; + __pyx_r = 0; + __pyx_t_13 = __pyx_v_proc_py_queries.begin(); + for (;;) { + if (!(__pyx_t_13 != __pyx_v_proc_py_queries.end())) break; + __pyx_t_14 = *__pyx_t_13; + ++__pyx_t_13; + __pyx_v_item = __pyx_t_14; + + /* "cpp_process.pyx":1698 + * # decref all reference counts + * for item in proc_py_queries: + * Py_DECREF(item) # <<<<<<<<<<<<<< + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): + */ + __Pyx_TraceLine(1698,0,__PYX_ERR(0, 1698, __pyx_L1_error)) + Py_DECREF(((PyObject *)__pyx_v_item)); + + /* "cpp_process.pyx":1697 + * finally: + * # decref all reference counts + * for item in proc_py_queries: # <<<<<<<<<<<<<< + * Py_DECREF(item) + * + */ + __Pyx_TraceLine(1697,0,__PYX_ERR(0, 1697, __pyx_L1_error)) + } + __pyx_r = __pyx_t_22; + __pyx_t_22 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "cpp_process.pyx":1638 + * return matrix + * + * cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t queries_len = len(queries) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("cpp_process.cdist_single_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_query); + __Pyx_XDECREF(__pyx_v_proc_query); + __Pyx_XDECREF(__pyx_v_processor); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_process.pyx":1700 + * Py_DECREF(item) + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< + * """ + * Compute distance/similarity between each pair of the two collections of inputs. + */ + +static PyObject *__pyx_pf_11cpp_process_15__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_TraceCall("__defaults__", __pyx_f[0], 1700, 0, __PYX_ERR(0, 1700, __pyx_L1_error)); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scorer, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_scorer) < 0) __PYX_ERR(0, 1700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_processor, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score_cutoff, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1700, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("cpp_process.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_11cpp_process_8cdist(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_11cpp_process_7cdist, "\n Compute distance/similarity between each pair of the two collections of inputs.\n\n Parameters\n ----------\n queries : Collection[Sequence[Hashable]]\n list of all strings the queries\n choices : Collection[Sequence[Hashable]]\n list of all strings the query should be compared\n scorer : Callable, optional\n Optional callable that is used to calculate the matching score between\n the query and each choice. This can be any of the scorers included in RapidFuzz\n (both scorers that calculate the edit distance or the normalized edit distance).\n Custom functions are not supported so far!\n fuzz.ratio is used by default.\n processor : Callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : Any, optional\n Optional argument for a score threshold. When an edit distance is used this represents the maximum\n edit distance and matches with a `distance <= score_cutoff` are inserted as -1. When a\n normalized edit distance is used this represents the minimal similarity\n and matches with a `similarity >= score_cutoff` are inserted as 0.\n Default is None, which deactivates this behaviour.\n **kwargs : Any, optional\n any other named parameters are passed to the scorer. This can be used to pass\n e.g. weights to string_metric.levenshtein\n\n Returns\n -------\n List[Tuple[Sequence[Hashable], Any, Any]]\n "); +static PyMethodDef __pyx_mdef_11cpp_process_8cdist = {"cdist", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cpp_process_8cdist, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cpp_process_7cdist}; +static PyObject *__pyx_pw_11cpp_process_8cdist(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_queries = 0; + PyObject *__pyx_v_choices = 0; + PyObject *__pyx_v_scorer = 0; + PyObject *__pyx_v_processor = 0; + PyObject *__pyx_v_score_cutoff = 0; + PyObject *__pyx_v_kwargs = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cdist (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + { + #if CYTHON_USE_MODULE_STATE + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queries,&__pyx_n_s_choices,&__pyx_n_s_scorer,&__pyx_n_s_processor,&__pyx_n_s_score_cutoff,0}; + #else + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queries,&__pyx_n_s_choices,&__pyx_n_s_scorer,&__pyx_n_s_processor,&__pyx_n_s_score_cutoff,0}; + #endif + PyObject* values[5] = {0,0,0,0,0}; + __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_scorer; + values[3] = ((PyObject *)((PyObject *)Py_None)); + values[4] = ((PyObject *)((PyObject *)Py_None)); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_queries)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_choices)) != 0)) kw_args--; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("cdist", 1, 2, 2, 1); __PYX_ERR(0, 1700, __pyx_L3_error) + } + } + if (kw_args > 0 && (kw_args <= 3)) { + Py_ssize_t index; + for (index = 2; index < 5 && kw_args > 0; index++) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "cdist") < 0)) __PYX_ERR(0, 1700, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_queries = values[0]; + __pyx_v_choices = values[1]; + __pyx_v_scorer = values[2]; + __pyx_v_processor = values[3]; + __pyx_v_score_cutoff = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cdist", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1700, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("cpp_process.cdist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_11cpp_process_7cdist(__pyx_self, __pyx_v_queries, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_score_cutoff, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cpp_process_7cdist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queries, PyObject *__pyx_v_choices, PyObject *__pyx_v_scorer, PyObject *__pyx_v_processor, PyObject *__pyx_v_score_cutoff, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_r = NULL; + __Pyx_TraceDeclarations + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceFrameInit(__pyx_codeobj__18) + __Pyx_RefNannySetupContext("cdist", 0); + __Pyx_TraceCall("cdist", __pyx_f[0], 1700, 0, __PYX_ERR(0, 1700, __pyx_L1_error)); + + /* "cpp_process.pyx":1734 + * List[Tuple[Sequence[Hashable], Any, Any]] + * """ + * if queries is choices: # <<<<<<<<<<<<<< + * return cdist_single_list(queries, scorer, processor, score_cutoff, kwargs) + * else: + */ + __Pyx_TraceLine(1734,0,__PYX_ERR(0, 1734, __pyx_L1_error)) + __pyx_t_1 = (__pyx_v_queries == __pyx_v_choices); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "cpp_process.pyx":1735 + * """ + * if queries is choices: + * return cdist_single_list(queries, scorer, processor, score_cutoff, kwargs) # <<<<<<<<<<<<<< + * else: + * return cdist_two_lists(queries, choices, scorer, processor, score_cutoff, kwargs) + */ + __Pyx_TraceLine(1735,0,__PYX_ERR(0, 1735, __pyx_L1_error)) + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_11cpp_process_cdist_single_list(__pyx_v_queries, __pyx_v_scorer, __pyx_v_processor, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "cpp_process.pyx":1734 + * List[Tuple[Sequence[Hashable], Any, Any]] + * """ + * if queries is choices: # <<<<<<<<<<<<<< + * return cdist_single_list(queries, scorer, processor, score_cutoff, kwargs) + * else: + */ + } + + /* "cpp_process.pyx":1737 + * return cdist_single_list(queries, scorer, processor, score_cutoff, kwargs) + * else: + * return cdist_two_lists(queries, choices, scorer, processor, score_cutoff, kwargs) # <<<<<<<<<<<<<< + */ + __Pyx_TraceLine(1737,0,__PYX_ERR(0, 1737, __pyx_L1_error)) + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __pyx_f_11cpp_process_cdist_two_lists(__pyx_v_queries, __pyx_v_choices, __pyx_v_scorer, __pyx_v_processor, __pyx_v_score_cutoff, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "cpp_process.pyx":1700 + * Py_DECREF(item) + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< + * """ + * Compute distance/similarity between each pair of the two collections of inputs. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("cpp_process.cdist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r, 0); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -19661,30 +24943,30 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_array", 0); - /* "cpp_common.pxd":30 + /* "cpp_common.pxd":31 * # TODO on Cpython this does not require any copies * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode # <<<<<<<<<<<<<< * s_proc.length = len(arr) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_typecode = ((Py_UCS4)__pyx_t_2); - /* "cpp_common.pxd":31 + /* "cpp_common.pxd":32 * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode * s_proc.length = len(arr) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 32, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_3); - /* "cpp_common.pxd":33 + /* "cpp_common.pxd":34 * s_proc.length = len(arr) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -19693,7 +24975,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -19703,16 +24985,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_4 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_4)) { - /* "cpp_common.pxd":36 + /* "cpp_common.pxd":37 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 36, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 37, __pyx_L1_error) - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -19721,7 +25003,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -19737,7 +25019,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -19748,7 +25030,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx case 98: case 66: - /* "cpp_common.pxd":41 + /* "cpp_common.pxd":42 * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -19757,7 +25039,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":42 + /* "cpp_common.pxd":43 * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -19769,21 +25051,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":43 + /* "cpp_common.pxd":44 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -19793,7 +25075,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x75: - /* "cpp_common.pxd":45 + /* "cpp_common.pxd":46 * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -19802,7 +25084,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":46 + /* "cpp_common.pxd":47 * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -19814,21 +25096,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":47 + /* "cpp_common.pxd":48 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_2)); } - /* "cpp_common.pxd":44 + /* "cpp_common.pxd":45 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t # <<<<<<<<<<<<<< @@ -19838,7 +25120,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x68: - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -19847,7 +25129,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 72: - /* "cpp_common.pxd":49 + /* "cpp_common.pxd":50 * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -19856,7 +25138,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":50 + /* "cpp_common.pxd":51 * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -19868,21 +25150,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":51 + /* "cpp_common.pxd":52 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -19892,7 +25174,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x69: - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -19901,7 +25183,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 73: - /* "cpp_common.pxd":53 + /* "cpp_common.pxd":54 * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -19910,7 +25192,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":54 + /* "cpp_common.pxd":55 * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -19922,21 +25204,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":55 + /* "cpp_common.pxd":56 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -19946,7 +25228,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x6C: - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -19955,7 +25237,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 76: - /* "cpp_common.pxd":57 + /* "cpp_common.pxd":58 * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -19964,7 +25246,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":58 + /* "cpp_common.pxd":59 * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -19976,21 +25258,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":59 + /* "cpp_common.pxd":60 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -20000,7 +25282,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x71: - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -20009,7 +25291,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 81: - /* "cpp_common.pxd":61 + /* "cpp_common.pxd":62 * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -20018,7 +25300,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":62 + /* "cpp_common.pxd":63 * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -20030,21 +25312,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":63 + /* "cpp_common.pxd":64 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -20054,7 +25336,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; default: - /* "cpp_common.pxd":65 + /* "cpp_common.pxd":66 * (s_proc.data)[i] = arr[i] * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -20063,7 +25345,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":66 + /* "cpp_common.pxd":67 * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -20075,23 +25357,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":67 + /* "cpp_common.pxd":68 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) # <<<<<<<<<<<<<< * except Exception as e: * free(s_proc.data) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_12); } break; } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -20106,7 +25388,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -20116,7 +25398,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("cpp_common.hash_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 68, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 69, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_15); @@ -20124,7 +25406,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_v_e = __pyx_t_14; /*try:*/ { - /* "cpp_common.pxd":69 + /* "cpp_common.pxd":70 * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -20133,7 +25415,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":70 + /* "cpp_common.pxd":71 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -20142,7 +25424,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":71 + /* "cpp_common.pxd":72 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -20154,10 +25436,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_14, __pyx_t_15); __pyx_t_1 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; - __PYX_ERR(1, 71, __pyx_L29_error) + __PYX_ERR(1, 72, __pyx_L29_error) } - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -20201,7 +25483,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -20216,7 +25498,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L9_try_end:; } - /* "cpp_common.pxd":73 + /* "cpp_common.pxd":74 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -20225,7 +25507,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":74 + /* "cpp_common.pxd":75 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -20235,8 +25517,8 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + + /* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -20256,7 +25538,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx return __pyx_r; } -/* "cpp_common.pxd":77 +/* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -20300,17 +25582,17 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_sequence", 0); - /* "cpp_common.pxd":79 + /* "cpp_common.pxd":80 * cdef inline proc_string hash_sequence(seq) except *: * cdef proc_string s_proc * s_proc.length = len(seq) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_1); - /* "cpp_common.pxd":81 + /* "cpp_common.pxd":82 * s_proc.length = len(seq) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -20319,7 +25601,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -20329,16 +25611,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "cpp_common.pxd":84 + /* "cpp_common.pxd":85 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 84, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 85, __pyx_L1_error) - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -20347,7 +25629,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -20363,7 +25645,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "cpp_common.pxd":87 + /* "cpp_common.pxd":88 * * try: * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -20372,7 +25654,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":88 + /* "cpp_common.pxd":89 * try: * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -20384,19 +25666,19 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "cpp_common.pxd":89 + /* "cpp_common.pxd":90 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * elem = seq[i] # <<<<<<<<<<<<<< * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L4_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -20410,23 +25692,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = __pyx_t_11; goto __pyx_L13_bool_binop_done; } - __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 91, __pyx_L4_error) + __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 92, __pyx_L4_error) __pyx_t_11 = ((__pyx_t_1 == 1) != 0); __pyx_t_2 = __pyx_t_11; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_common.pxd":92 + /* "cpp_common.pxd":93 * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: * (s_proc.data)[i] = elem # <<<<<<<<<<<<<< * else: * (s_proc.data)[i] = hash(elem) */ - __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L4_error) + __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_12)); - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -20436,7 +25718,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L12; } - /* "cpp_common.pxd":94 + /* "cpp_common.pxd":95 * (s_proc.data)[i] = elem * else: * (s_proc.data)[i] = hash(elem) # <<<<<<<<<<<<<< @@ -20444,13 +25726,13 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ * free(s_proc.data) */ /*else*/ { - __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 94, __pyx_L4_error) + __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 95, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_13); } __pyx_L12:; } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -20465,7 +25747,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -20475,7 +25757,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_14) { __Pyx_AddTraceback("cpp_common.hash_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 95, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 96, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_15); __Pyx_GOTREF(__pyx_t_16); @@ -20483,7 +25765,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_v_e = __pyx_t_15; /*try:*/ { - /* "cpp_common.pxd":96 + /* "cpp_common.pxd":97 * (s_proc.data)[i] = hash(elem) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -20492,7 +25774,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":97 + /* "cpp_common.pxd":98 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -20501,7 +25783,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":98 + /* "cpp_common.pxd":99 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -20513,10 +25795,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_15, __pyx_t_16); __pyx_t_9 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __PYX_ERR(1, 98, __pyx_L20_error) + __PYX_ERR(1, 99, __pyx_L20_error) } - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -20560,7 +25842,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -20575,7 +25857,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L9_try_end:; } - /* "cpp_common.pxd":100 + /* "cpp_common.pxd":101 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -20583,7 +25865,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":101 + /* "cpp_common.pxd":102 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -20591,7 +25873,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":77 + /* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -20613,6 +25895,1269 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ return __pyx_r; } +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":246 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) { + PyObject *__pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":249 + * """Returns a borrowed reference to the object owning the data/memory. + * """ + * return PyArray_BASE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_BASE(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":246 + * + * @property + * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<< + * """Returns a borrowed reference to the object owning the data/memory. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":252 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + +static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) { + PyArray_Descr *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyArray_Descr *__pyx_t_1; + __Pyx_RefNannySetupContext("descr", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":255 + * """Returns an owned reference to the dtype of the array. + * """ + * return PyArray_DESCR(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF((PyObject *)__pyx_r); + __pyx_t_1 = PyArray_DESCR(__pyx_v_self); + __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1)); + __pyx_r = ((PyArray_Descr *)__pyx_t_1); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":252 + * + * @property + * cdef inline dtype descr(self): # <<<<<<<<<<<<<< + * """Returns an owned reference to the dtype of the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":258 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + +static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) { + int __pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":261 + * """Returns the number of dimensions in the array. + * """ + * return PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_NDIM(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":258 + * + * @property + * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<< + * """Returns the number of dimensions in the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":264 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":269 + * Can return NULL for 0-dimensional arrays. + * """ + * return PyArray_DIMS(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_DIMS(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":264 + * + * @property + * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the dimensions/shape of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":272 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + +static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) { + npy_intp *__pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":276 + * The number of elements matches the number of dimensions of the array (ndim). + * """ + * return PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_STRIDES(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":272 + * + * @property + * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<< + * """Returns a pointer to the strides of the array. + * The number of elements matches the number of dimensions of the array (ndim). + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":279 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + +static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) { + npy_intp __pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":282 + * """Returns the total size (in number of elements) of the array. + * """ + * return PyArray_SIZE(self) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_r = PyArray_SIZE(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":279 + * + * @property + * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<< + * """Returns the total size (in number of elements) of the array. + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":285 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) { + char *__pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":291 + * of `PyArray_DATA()` instead, which returns a 'void*'. + * """ + * return PyArray_BYTES(self) # <<<<<<<<<<<<<< + * + * ctypedef unsigned char npy_bool + */ + __pyx_r = PyArray_BYTES(__pyx_v_self); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":285 + * + * @property + * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<< + * """The pointer to the data buffer as a char*. + * This is provided for legacy reasons to avoid direct struct field access. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":778 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":777 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":781 + * + * cdef inline object PyArray_MultiIterNew2(a, b): + * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":780 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":784 + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): + * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":783 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":787 + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): + * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":786 + * return PyArray_MultiIterNew(3, a, b, c) + * + * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(4, a, b, c, d) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":790 + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): + * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":789 + * return PyArray_MultiIterNew(4, a, b, c, d) + * + * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":793 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":794 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":793 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":796 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":792 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":974 + * + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< + * PyArray_SetBaseObject(arr, base) + * + */ + Py_INCREF(__pyx_v_base); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":975 + * cdef inline void set_array_base(ndarray arr, object base): + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":973 + * int _import_umath() except -1 + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * Py_INCREF(base) # important to do this before stealing the reference below! + * PyArray_SetBaseObject(arr, base) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":977 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_v_base; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":978 + * + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< + * if base is NULL: + * return None + */ + __pyx_v_base = PyArray_BASE(__pyx_v_arr); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + __pyx_t_1 = ((__pyx_v_base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":980 + * base = PyArray_BASE(arr) + * if base is NULL: + * return None # <<<<<<<<<<<<<< + * return base + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":979 + * cdef inline object get_array_base(ndarray arr): + * base = PyArray_BASE(arr) + * if base is NULL: # <<<<<<<<<<<<<< + * return None + * return base + */ + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":981 + * if base is NULL: + * return None + * return base # <<<<<<<<<<<<<< + * + * # Versions of the import_* functions which are more suitable for + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_base)); + __pyx_r = ((PyObject *)__pyx_v_base); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":977 + * PyArray_SetBaseObject(arr, base) + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * base = PyArray_BASE(arr) + * if base is NULL: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":987 + * cdef inline int import_array() except -1: + * try: + * __pyx_import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":988 + * try: + * __pyx_import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * __pyx_import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * __pyx_import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 999, __pyx_L3_error) + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1004 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_timedelta64_object", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1016 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1004 + * + * + * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.timedelta64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1019 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + +static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_datetime64_object", 0); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1031 + * bool + * """ + * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1019 + * + * + * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< + * """ + * Cython equivalent of `isinstance(obj, np.datetime64)` + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1034 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + +static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { + npy_datetime __pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1041 + * also needed. That can be found using `get_datetime64_unit`. + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1034 + * + * + * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy datetime64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1044 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + +static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { + npy_timedelta __pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1048 + * returns the int64 value underlying scalar numpy timedelta64 object + * """ + * return (obj).obval # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1044 + * + * + * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the int64 value underlying scalar numpy timedelta64 object + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1051 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + +static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { + NPY_DATETIMEUNIT __pyx_r; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1055 + * returns the unit part of the dtype for a numpy datetime64 object. + * """ + * return (obj).obmeta.base # <<<<<<<<<<<<<< + */ + __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); + goto __pyx_L0; + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1051 + * + * + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + static struct __pyx_obj_11cpp_process___pyx_scope_struct__extract_iter *__pyx_freelist_11cpp_process___pyx_scope_struct__extract_iter[8]; static int __pyx_freecount_11cpp_process___pyx_scope_struct__extract_iter = 0; @@ -21691,18 +28236,20 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { #if CYTHON_USE_MODULE_STATE {0, __pyx_k_DistanceContext, sizeof(__pyx_k_DistanceContext), 0, 0, 1, 1}, {0, __pyx_k_Find_the_best_match_in_a_list_o, sizeof(__pyx_k_Find_the_best_match_in_a_list_o), 0, 1, 0, 0}, + {0, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {0, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {0, __pyx_k_QRatio, sizeof(__pyx_k_QRatio), 0, 0, 1, 1}, {0, __pyx_k_ScorerContext, sizeof(__pyx_k_ScorerContext), 0, 0, 1, 1}, {0, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {0, __pyx_k_WRatio, sizeof(__pyx_k_WRatio), 0, 0, 1, 1}, - {0, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, - {0, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 1}, + {0, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 1}, + {0, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {0, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {0, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {0, __pyx_k_c_max, sizeof(__pyx_k_c_max), 0, 0, 1, 1}, {0, __pyx_k_c_score_cutoff, sizeof(__pyx_k_c_score_cutoff), 0, 0, 1, 1}, + {0, __pyx_k_cdist, sizeof(__pyx_k_cdist), 0, 0, 1, 1}, {0, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, {0, __pyx_k_choice_key, sizeof(__pyx_k_choice_key), 0, 0, 1, 1}, {0, __pyx_k_choices, sizeof(__pyx_k_choices), 0, 0, 1, 1}, @@ -21714,11 +28261,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_default_process, sizeof(__pyx_k_default_process), 0, 0, 1, 1}, {0, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {0, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1}, + {0, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {0, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {0, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {0, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {0, __pyx_k_extract, sizeof(__pyx_k_extract), 0, 0, 1, 1}, {0, __pyx_k_extractOne, sizeof(__pyx_k_extractOne), 0, 0, 1, 1}, - {0, __pyx_k_extractOne_line_476, sizeof(__pyx_k_extractOne_line_476), 0, 1, 0, 0}, + {0, __pyx_k_extractOne_line_481, sizeof(__pyx_k_extractOne_line_481), 0, 1, 0, 0}, {0, __pyx_k_extract_iter, sizeof(__pyx_k_extract_iter), 0, 0, 1, 1}, {0, __pyx_k_extract_iter_dict, sizeof(__pyx_k_extract_iter_dict), 0, 0, 1, 1}, {0, __pyx_k_extract_iter_distance_dict, sizeof(__pyx_k_extract_iter_distance_dict), 0, 0, 1, 1}, @@ -21738,6 +28287,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {0, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {0, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {0, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, {0, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {0, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {0, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, @@ -21753,6 +28303,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_nlargest, sizeof(__pyx_k_nlargest), 0, 0, 1, 1}, {0, __pyx_k_normalized_hamming, sizeof(__pyx_k_normalized_hamming), 0, 0, 1, 1}, {0, __pyx_k_normalized_levenshtein, sizeof(__pyx_k_normalized_levenshtein), 0, 0, 1, 1}, + {0, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {0, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {0, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {0, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, {0, __pyx_k_partial_ratio, sizeof(__pyx_k_partial_ratio), 0, 0, 1, 1}, {0, __pyx_k_partial_token_ratio, sizeof(__pyx_k_partial_token_ratio), 0, 0, 1, 1}, {0, __pyx_k_partial_token_set_ratio, sizeof(__pyx_k_partial_token_set_ratio), 0, 0, 1, 1}, @@ -21765,6 +28319,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_py_extract_iter_dict, sizeof(__pyx_k_py_extract_iter_dict), 0, 0, 1, 1}, {0, __pyx_k_py_extract_iter_list, sizeof(__pyx_k_py_extract_iter_list), 0, 0, 1, 1}, {0, __pyx_k_py_extract_list_locals_lambda, sizeof(__pyx_k_py_extract_list_locals_lambda), 0, 0, 1, 1}, + {0, __pyx_k_queries, sizeof(__pyx_k_queries), 0, 0, 1, 1}, {0, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {0, __pyx_k_query_context, sizeof(__pyx_k_query_context), 0, 0, 1, 1}, {0, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, @@ -21785,22 +28340,25 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_token_set_ratio, sizeof(__pyx_k_token_set_ratio), 0, 0, 1, 1}, {0, __pyx_k_token_sort_ratio, sizeof(__pyx_k_token_sort_ratio), 0, 0, 1, 1}, {0, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1}, + {0, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, {0, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 1, 0, 1}, #else {&__pyx_n_s_DistanceContext, __pyx_k_DistanceContext, sizeof(__pyx_k_DistanceContext), 0, 0, 1, 1}, {&__pyx_kp_u_Find_the_best_match_in_a_list_o, __pyx_k_Find_the_best_match_in_a_list_o, sizeof(__pyx_k_Find_the_best_match_in_a_list_o), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_QRatio, __pyx_k_QRatio, sizeof(__pyx_k_QRatio), 0, 0, 1, 1}, {&__pyx_n_s_ScorerContext, __pyx_k_ScorerContext, sizeof(__pyx_k_ScorerContext), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_WRatio, __pyx_k_WRatio, sizeof(__pyx_k_WRatio), 0, 0, 1, 1}, - {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, - {&__pyx_n_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 1}, + {&__pyx_n_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 1}, + {&__pyx_n_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_c_max, __pyx_k_c_max, sizeof(__pyx_k_c_max), 0, 0, 1, 1}, {&__pyx_n_s_c_score_cutoff, __pyx_k_c_score_cutoff, sizeof(__pyx_k_c_score_cutoff), 0, 0, 1, 1}, + {&__pyx_n_s_cdist, __pyx_k_cdist, sizeof(__pyx_k_cdist), 0, 0, 1, 1}, {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, {&__pyx_n_s_choice_key, __pyx_k_choice_key, sizeof(__pyx_k_choice_key), 0, 0, 1, 1}, {&__pyx_n_s_choices, __pyx_k_choices, sizeof(__pyx_k_choices), 0, 0, 1, 1}, @@ -21812,11 +28370,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_default_process, __pyx_k_default_process, sizeof(__pyx_k_default_process), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_extract, __pyx_k_extract, sizeof(__pyx_k_extract), 0, 0, 1, 1}, {&__pyx_n_s_extractOne, __pyx_k_extractOne, sizeof(__pyx_k_extractOne), 0, 0, 1, 1}, - {&__pyx_kp_u_extractOne_line_476, __pyx_k_extractOne_line_476, sizeof(__pyx_k_extractOne_line_476), 0, 1, 0, 0}, + {&__pyx_kp_u_extractOne_line_481, __pyx_k_extractOne_line_481, sizeof(__pyx_k_extractOne_line_481), 0, 1, 0, 0}, {&__pyx_n_s_extract_iter, __pyx_k_extract_iter, sizeof(__pyx_k_extract_iter), 0, 0, 1, 1}, {&__pyx_n_s_extract_iter_dict, __pyx_k_extract_iter_dict, sizeof(__pyx_k_extract_iter_dict), 0, 0, 1, 1}, {&__pyx_n_s_extract_iter_distance_dict, __pyx_k_extract_iter_distance_dict, sizeof(__pyx_k_extract_iter_distance_dict), 0, 0, 1, 1}, @@ -21836,6 +28396,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, @@ -21851,6 +28412,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_nlargest, __pyx_k_nlargest, sizeof(__pyx_k_nlargest), 0, 0, 1, 1}, {&__pyx_n_s_normalized_hamming, __pyx_k_normalized_hamming, sizeof(__pyx_k_normalized_hamming), 0, 0, 1, 1}, {&__pyx_n_s_normalized_levenshtein, __pyx_k_normalized_levenshtein, sizeof(__pyx_k_normalized_levenshtein), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0}, + {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0}, {&__pyx_n_s_partial_ratio, __pyx_k_partial_ratio, sizeof(__pyx_k_partial_ratio), 0, 0, 1, 1}, {&__pyx_n_s_partial_token_ratio, __pyx_k_partial_token_ratio, sizeof(__pyx_k_partial_token_ratio), 0, 0, 1, 1}, {&__pyx_n_s_partial_token_set_ratio, __pyx_k_partial_token_set_ratio, sizeof(__pyx_k_partial_token_set_ratio), 0, 0, 1, 1}, @@ -21863,6 +28428,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_py_extract_iter_dict, __pyx_k_py_extract_iter_dict, sizeof(__pyx_k_py_extract_iter_dict), 0, 0, 1, 1}, {&__pyx_n_s_py_extract_iter_list, __pyx_k_py_extract_iter_list, sizeof(__pyx_k_py_extract_iter_list), 0, 0, 1, 1}, {&__pyx_n_s_py_extract_list_locals_lambda, __pyx_k_py_extract_list_locals_lambda, sizeof(__pyx_k_py_extract_list_locals_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_queries, __pyx_k_queries, sizeof(__pyx_k_queries), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {&__pyx_n_s_query_context, __pyx_k_query_context, sizeof(__pyx_k_query_context), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, @@ -21883,16 +28449,18 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_token_set_ratio, __pyx_k_token_set_ratio, sizeof(__pyx_k_token_set_ratio), 0, 0, 1, 1}, {&__pyx_n_s_token_sort_ratio, __pyx_k_token_sort_ratio, sizeof(__pyx_k_token_sort_ratio), 0, 0, 1, 1}, {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1}, + {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, {&__pyx_n_u_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 1, 0, 1}, #endif {0, 0, 0, 0, 0, 0, 0} }; /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 304, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 631, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 713, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -21903,135 +28471,169 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "cpp_process.pyx":113 + /* "cpp_process.pyx":118 * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): * cdef size_t insertion, deletion, substitution * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) # <<<<<<<<<<<<<< * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) * */ - __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "cpp_process.pyx":631 + /* "cpp_process.pyx":636 * c_score_cutoff = score_cutoff * if c_score_cutoff < 0 or c_score_cutoff > 100: * raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") # <<<<<<<<<<<<<< * * if hasattr(choices, "items"): */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_score_cutoff_has_to_be_in_the_ra); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_score_cutoff_has_to_be_in_the_ra); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "cpp_process.pyx":1165 + /* "cpp_process.pyx":1170 * cdef size_t c_max = -1 * * def extract_iter_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_score, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_score, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_dict, 1165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_dict, 1170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 1170, __pyx_L1_error) - /* "cpp_process.pyx":1196 + /* "cpp_process.pyx":1201 * yield (choice, score, choice_key) * * def extract_iter_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_i, __pyx_n_s_score, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_i, __pyx_n_s_score, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_list, 1196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_list, 1201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 1201, __pyx_L1_error) - /* "cpp_process.pyx":1228 + /* "cpp_process.pyx":1233 * yield (choice, score, i) * * def extract_iter_distance_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_distance, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_distance, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_distance_dict, 1228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_distance_dict, 1233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1233, __pyx_L1_error) - /* "cpp_process.pyx":1259 + /* "cpp_process.pyx":1264 * yield (choice, distance, choice_key) * * def extract_iter_distance_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_i, __pyx_n_s_distance, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_i, __pyx_n_s_distance, __pyx_n_s_choice, __pyx_n_s_proc_choice); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_distance_list, 1259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter_distance_list, 1264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1264, __pyx_L1_error) - /* "cpp_process.pyx":1291 + /* "cpp_process.pyx":1296 * yield (choice, distance, i) * * def py_extract_iter_dict(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_score); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_choice_key, __pyx_n_s_choice, __pyx_n_s_score); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_py_extract_iter_dict, 1291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_py_extract_iter_dict, 1296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1296, __pyx_L1_error) - /* "cpp_process.pyx":1320 + /* "cpp_process.pyx":1325 * yield (choice, score, choice_key) * * def py_extract_iter_list(): # <<<<<<<<<<<<<< * """ * implementation of extract_iter for: */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_i, __pyx_n_s_choice, __pyx_n_s_score); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_i, __pyx_n_s_choice, __pyx_n_s_score); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_py_extract_iter_list, 1320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_py_extract_iter_list, 1325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 1325, __pyx_L1_error) - /* "cpp_process.pyx":476 + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":989 + * __pyx_import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "cpp_process.pyx":481 * * * def extractOne(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best match in a list of choices. When multiple elements have the same similarity, */ - __pyx_tuple__19 = PyTuple_Pack(12, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extractOne, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(12, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extractOne, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 481, __pyx_L1_error) - /* "cpp_process.pyx":976 + /* "cpp_process.pyx":981 * * * def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best matches in a list of choices. The list is sorted by the similarity. */ - __pyx_tuple__20 = PyTuple_Pack(13, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_limit, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract, 976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(13, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_limit, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 981, __pyx_L1_error) - /* "cpp_process.pyx":1104 + /* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best match in a list of choices */ - __pyx_tuple__21 = PyTuple_Pack(24, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_py_extract_iter_list, __pyx_n_s_py_extract_iter_list, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter, 1104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(24, __pyx_n_s_query, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs, __pyx_n_s_def_process, __pyx_n_s_ScorerContext, __pyx_n_s_DistanceContext, __pyx_n_s_c_score_cutoff, __pyx_n_s_c_max, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_dict, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_list, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_distance_dict, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_extract_iter_distance_list, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_py_extract_iter_dict, __pyx_n_s_py_extract_iter_list, __pyx_n_s_py_extract_iter_list, __pyx_n_s_query_context); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_extract_iter, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 1109, __pyx_L1_error) + + /* "cpp_process.pyx":1700 + * Py_DECREF(item) + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< + * """ + * Compute distance/similarity between each pair of the two collections of inputs. + */ + __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_queries, __pyx_n_s_choices, __pyx_n_s_scorer, __pyx_n_s_processor, __pyx_n_s_score_cutoff, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cpp_process_pyx, __pyx_n_s_cdist, 1700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1700, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -22041,106 +28643,137 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + /* NumpyImportArray.init */ + /* + * Cython has automatically inserted a call to _import_array since + * you didn't include one when you cimported numpy. To disable this + * add the line + * numpy._import_array + */ +#ifdef NPY_NDARRAYOBJECT_H +#if !NO_IMPORT_ARRAY +if (unlikely(_import_array() == -1)) { + PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import " + "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; " + "use 'numpy._import_array' to disable if you are certain you don't need it)."); + __PYX_ERR(0, 44, __pyx_L1_error); +} +#endif +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; #if CYTHON_USE_MODULE_STATE if (__Pyx_InitString(__pyx_string_tab[0], &__pyx_n_s_DistanceContext) < 0) __PYX_ERR(0, 1, __pyx_L1_error); if (__Pyx_InitString(__pyx_string_tab[1], &__pyx_kp_u_Find_the_best_match_in_a_list_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_MemoryError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_QRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_ScorerContext) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_TypeError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_WRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s__18) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s__22) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_array) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_c_max) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_c_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_choice) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_choice_key) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s_choices) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_close) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_n_s_cpp_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_kp_s_cpp_process_pyx) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_def_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_n_s_default_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_distance) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_n_s_enumerate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_n_s_extract) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_n_s_extractOne) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_kp_u_extractOne_line_476) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_extract_iter) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_n_s_extract_iter_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_n_s_extract_iter_distance_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_extract_iter_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_n_s_extract_iter_locals_extract_iter) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_extract_iter_locals_extract_iter_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_n_s_extract_iter_locals_extract_iter_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_extract_iter_locals_extract_iter_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_n_s_extract_iter_locals_py_extract_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_extract_iter_locals_py_extract_i_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_get) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_n_s_hamming) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_n_s_heapq) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_n_s_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_n_s_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_initializing) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_items) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_u_items) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_jaro_similarity) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_jaro_winkler_similarity) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_n_s_key) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_kwargs) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_s_levenshtein) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_n_s_limit) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_n_s_nlargest) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_normalized_hamming) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_n_s_normalized_levenshtein) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_n_s_partial_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_n_s_partial_token_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_n_s_partial_token_set_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_n_s_partial_token_sort_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[68], &__pyx_n_u_prefix_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[69], &__pyx_n_s_proc_choice) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[70], &__pyx_n_s_processor) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[71], &__pyx_n_u_processor) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[72], &__pyx_n_s_py_extract_dict_locals_lambda) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[73], &__pyx_n_s_py_extract_iter_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[74], &__pyx_n_s_py_extract_iter_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[75], &__pyx_n_s_py_extract_list_locals_lambda) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[76], &__pyx_n_s_query) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[77], &__pyx_n_s_query_context) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[78], &__pyx_n_s_range) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[79], &__pyx_n_s_rapidfuzz_fuzz) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[80], &__pyx_n_s_rapidfuzz_string_metric) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[81], &__pyx_n_s_rapidfuzz_utils) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[82], &__pyx_n_s_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[83], &__pyx_n_s_score) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[84], &__pyx_n_s_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[85], &__pyx_n_u_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[86], &__pyx_kp_u_score_cutoff_has_to_be_in_the_ra) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[87], &__pyx_n_s_scorer) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[88], &__pyx_n_s_send) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[89], &__pyx_n_s_spec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[90], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[91], &__pyx_n_s_throw) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[92], &__pyx_n_s_token_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[93], &__pyx_n_s_token_set_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[94], &__pyx_n_s_token_sort_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[95], &__pyx_n_s_typecode) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[96], &__pyx_n_u_weights) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_ImportError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_MemoryError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_QRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_ScorerContext) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_TypeError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_WRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s__21) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s__26) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_array) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_c_max) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_c_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_cdist) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s_choice) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s_choice_key) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_choices) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_n_s_close) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_cpp_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_kp_s_cpp_process_pyx) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_n_s_def_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_default_process) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_n_s_distance) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_n_s_dtype) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_n_s_empty) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_enumerate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_n_s_extract) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_extractOne) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_kp_u_extractOne_line_481) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_extract_iter) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_n_s_extract_iter_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_n_s_extract_iter_distance_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_extract_iter_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_n_s_extract_iter_locals_extract_iter) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_extract_iter_locals_extract_iter_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_n_s_extract_iter_locals_extract_iter_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_extract_iter_locals_extract_iter_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_n_s_extract_iter_locals_py_extract_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_n_s_extract_iter_locals_py_extract_i_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_get) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_n_s_hamming) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_heapq) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_s_initializing) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_int32) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_items) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_u_items) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_n_s_jaro_similarity) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_jaro_winkler_similarity) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_n_s_key) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_n_s_kwargs) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_levenshtein) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_n_s_limit) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_n_s_nlargest) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_n_s_normalized_hamming) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[68], &__pyx_n_s_normalized_levenshtein) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[69], &__pyx_n_s_np) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[70], &__pyx_n_s_numpy) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[71], &__pyx_kp_u_numpy_core_multiarray_failed_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[72], &__pyx_kp_u_numpy_core_umath_failed_to_impor) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[73], &__pyx_n_s_partial_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[74], &__pyx_n_s_partial_token_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[75], &__pyx_n_s_partial_token_set_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[76], &__pyx_n_s_partial_token_sort_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[77], &__pyx_n_u_prefix_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[78], &__pyx_n_s_proc_choice) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[79], &__pyx_n_s_processor) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[80], &__pyx_n_u_processor) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[81], &__pyx_n_s_py_extract_dict_locals_lambda) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[82], &__pyx_n_s_py_extract_iter_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[83], &__pyx_n_s_py_extract_iter_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[84], &__pyx_n_s_py_extract_list_locals_lambda) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[85], &__pyx_n_s_queries) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[86], &__pyx_n_s_query) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[87], &__pyx_n_s_query_context) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[88], &__pyx_n_s_range) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[89], &__pyx_n_s_rapidfuzz_fuzz) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[90], &__pyx_n_s_rapidfuzz_string_metric) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[91], &__pyx_n_s_rapidfuzz_utils) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[92], &__pyx_n_s_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[93], &__pyx_n_s_score) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[94], &__pyx_n_s_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[95], &__pyx_n_u_score_cutoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[96], &__pyx_kp_u_score_cutoff_has_to_be_in_the_ra) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[97], &__pyx_n_s_scorer) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[98], &__pyx_n_s_send) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[99], &__pyx_n_s_spec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[100], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[101], &__pyx_n_s_throw) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[102], &__pyx_n_s_token_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[103], &__pyx_n_s_token_set_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[104], &__pyx_n_s_token_sort_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[105], &__pyx_n_s_typecode) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[106], &__pyx_n_s_uint8) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[107], &__pyx_n_u_weights) < 0) __PYX_ERR(0, 1, __pyx_L1_error); #endif #if !CYTHON_USE_MODULE_STATE if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); @@ -22195,15 +28828,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct__extract_iter_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter)) __PYX_ERR(0, 1104, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct__extract_iter_spec, __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct__extract_iter_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter)) __PYX_ERR(0, 1109, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct__extract_iter_spec, __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter = &__pyx_type_11cpp_process___pyx_scope_struct__extract_iter; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct__extract_iter->tp_print = 0; @@ -22214,15 +28847,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_1_extract_iter_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict)) __PYX_ERR(0, 1165, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_1_extract_iter_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_1_extract_iter_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict)) __PYX_ERR(0, 1170, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_1_extract_iter_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict) < 0) __PYX_ERR(0, 1170, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict = &__pyx_type_11cpp_process___pyx_scope_struct_1_extract_iter_dict; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict) < 0) __PYX_ERR(0, 1170, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_1_extract_iter_dict->tp_print = 0; @@ -22233,15 +28866,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_2_extract_iter_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list)) __PYX_ERR(0, 1196, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_2_extract_iter_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_2_extract_iter_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_2_extract_iter_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list = &__pyx_type_11cpp_process___pyx_scope_struct_2_extract_iter_list; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_2_extract_iter_list->tp_print = 0; @@ -22252,15 +28885,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict)) __PYX_ERR(0, 1228, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict)) __PYX_ERR(0, 1233, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1233, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict = &__pyx_type_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1228, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict) < 0) __PYX_ERR(0, 1233, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_3_extract_iter_distance_dict->tp_print = 0; @@ -22271,15 +28904,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list)) __PYX_ERR(0, 1259, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list) < 0) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list)) __PYX_ERR(0, 1264, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list) < 0) __PYX_ERR(0, 1264, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list = &__pyx_type_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list) < 0) __PYX_ERR(0, 1259, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list) < 0) __PYX_ERR(0, 1264, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_4_extract_iter_distance_list->tp_print = 0; @@ -22290,15 +28923,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict)) __PYX_ERR(0, 1291, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict) < 0) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict)) __PYX_ERR(0, 1296, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict = &__pyx_type_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict) < 0) __PYX_ERR(0, 1291, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_5_py_extract_iter_dict->tp_print = 0; @@ -22309,15 +28942,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list)) __PYX_ERR(0, 1320, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list) < 0) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list_spec, NULL); if (unlikely(!__pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list)) __PYX_ERR(0, 1325, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list_spec, __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list) < 0) __PYX_ERR(0, 1325, __pyx_L1_error) #else __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list = &__pyx_type_11cpp_process___pyx_scope_struct_6_py_extract_iter_list; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list) < 0) __PYX_ERR(0, 1320, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list) < 0) __PYX_ERR(0, 1325, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_11cpp_process___pyx_scope_struct_6_py_extract_iter_list->tp_print = 0; @@ -22342,7 +28975,7 @@ static int __Pyx_modinit_type_import_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 @@ -22353,7 +28986,40 @@ static int __Pyx_modinit_type_import_code(void) { sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 203, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 226, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 230, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 815, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 819, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 825, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore); + if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -22833,65 +29499,68 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cpp_process.pyx":38 - * from cpp_common cimport proc_string, is_valid_string, convert_string, hash_array, hash_sequence + /* "cpp_process.pyx":40 + * from cpp_common cimport proc_string, is_valid_string, convert_string, hash_array, hash_sequence, default_process_func * * import heapq # <<<<<<<<<<<<<< * from array import array * */ - __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error)) - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_heapq, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error)) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_heapq, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapq, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapq, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "cpp_process.pyx":39 + /* "cpp_process.pyx":41 * * import heapq * from array import array # <<<<<<<<<<<<<< * - * + * import numpy as np */ - __Pyx_TraceLine(39,0,__PYX_ERR(0, 39, __pyx_L1_error)) - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error)) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_array); __Pyx_GIVEREF(__pyx_n_s_array); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_array); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":42 + /* "cpp_process.pyx":43 + * from array import array * + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * cimport cython + */ + __Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error)) + __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cpp_process.pyx":47 + * cimport cython * * cdef inline proc_string conv_sequence(seq) except *: # <<<<<<<<<<<<<< * if is_valid_string(seq): * return move(convert_string(seq)) */ - __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error)) - - - /* "cpp_process.pyx":111 - * - * - * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< - * cdef size_t insertion, deletion, substitution - * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) - */ - __Pyx_TraceLine(111,0,__PYX_ERR(0, 111, __pyx_L1_error)) + __Pyx_TraceLine(47,0,__PYX_ERR(0, 47, __pyx_L1_error)) /* "cpp_process.pyx":116 - * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) * - * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< + * + * cdef inline CachedScorerContext CachedNormalizedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< * cdef size_t insertion, deletion, substitution * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) */ @@ -22899,248 +29568,348 @@ if (!__Pyx_RefNanny) { /* "cpp_process.pyx":121 + * return move(cached_normalized_levenshtein_init(query, def_process, insertion, deletion, substitution)) + * + * cdef inline CachedDistanceContext CachedLevenshteinInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t insertion, deletion, substitution + * insertion, deletion, substitution = kwargs.get("weights", (1, 1, 1)) + */ + __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) + + + /* "cpp_process.pyx":126 * return move(cached_levenshtein_init(query, def_process, insertion, deletion, substitution)) * * cdef inline CachedScorerContext CachedJaroWinklerSimilarityInit(const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< * cdef double prefix_weight * prefix_weight = kwargs.get("prefix_weight", 0.1) */ - __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error)) + __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) - /* "cpp_process.pyx":126 + /* "cpp_process.pyx":131 * return move(cached_jaro_winkler_similarity_init(query, def_process, prefix_weight)) * * cdef inline int IsIntegratedScorer(object scorer): # <<<<<<<<<<<<<< * return ( * scorer is ratio or */ - __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error)) + __Pyx_TraceLine(131,0,__PYX_ERR(0, 131, __pyx_L1_error)) - /* "cpp_process.pyx":144 + /* "cpp_process.pyx":149 * ) * * cdef inline int IsIntegratedDistance(object scorer): # <<<<<<<<<<<<<< * return ( * scorer is levenshtein or */ - __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error)) + __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error)) - /* "cpp_process.pyx":150 + /* "cpp_process.pyx":155 * ) * * cdef inline CachedScorerContext CachedScorerInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< * cdef CachedScorerContext context * */ - __Pyx_TraceLine(150,0,__PYX_ERR(0, 150, __pyx_L1_error)) + __Pyx_TraceLine(155,0,__PYX_ERR(0, 155, __pyx_L1_error)) - /* "cpp_process.pyx":184 + /* "cpp_process.pyx":189 * return move(context) * * cdef inline CachedDistanceContext CachedDistanceInit(object scorer, const proc_string& query, int def_process, dict kwargs): # <<<<<<<<<<<<<< * cdef CachedDistanceContext context * */ - __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error)) + __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error)) - /* "cpp_process.pyx":195 + /* "cpp_process.pyx":200 * * * cdef inline extractOne_dict(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< * """ * implementation of extractOne for: */ - __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error)) + __Pyx_TraceLine(200,0,__PYX_ERR(0, 200, __pyx_L1_error)) - /* "cpp_process.pyx":243 + /* "cpp_process.pyx":248 * * * cdef inline extractOne_distance_dict(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< * """ * implementation of extractOne for: */ - __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error)) + __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error)) - /* "cpp_process.pyx":290 + /* "cpp_process.pyx":295 * * * cdef inline extractOne_list(CachedScorerContext context, choices, processor, double score_cutoff): # <<<<<<<<<<<<<< * """ * implementation of extractOne for: */ - __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error)) + __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error)) - /* "cpp_process.pyx":339 + /* "cpp_process.pyx":344 * * * cdef inline extractOne_distance_list(CachedDistanceContext context, choices, processor, size_t max_): # <<<<<<<<<<<<<< * """ * implementation of extractOne for: */ - __Pyx_TraceLine(339,0,__PYX_ERR(0, 339, __pyx_L1_error)) + __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error)) - /* "cpp_process.pyx":387 + /* "cpp_process.pyx":392 * * * cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< * result_score = -1 * result_choice = None */ - __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error)) + __Pyx_TraceLine(392,0,__PYX_ERR(0, 392, __pyx_L1_error)) - /* "cpp_process.pyx":431 + /* "cpp_process.pyx":436 * * * cdef inline py_extractOne_list(query, choices, scorer, processor, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< * cdef size_t result_index = 0 * cdef size_t i */ - __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error)) + __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error)) - /* "cpp_process.pyx":476 + /* "cpp_process.pyx":481 * * * def extractOne(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best match in a list of choices. When multiple elements have the same similarity, */ - __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_1extractOne, 0, __pyx_n_s_extractOne, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_1extractOne, 0, __pyx_n_s_extractOne, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 2)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_scorer = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_processor = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_7__defaults__); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_extractOne, __pyx_t_1) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_9__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extractOne, __pyx_t_1) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":660 + /* "cpp_process.pyx":665 * * * cdef inline extract_dict(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< * cdef double score = 0.0 * cdef size_t i */ - __Pyx_TraceLine(660,0,__PYX_ERR(0, 660, __pyx_L1_error)) + __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error)) - /* "cpp_process.pyx":727 + /* "cpp_process.pyx":732 * * * cdef inline extract_distance_dict(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< * cdef size_t distance * cdef size_t i */ - __Pyx_TraceLine(727,0,__PYX_ERR(0, 727, __pyx_L1_error)) + __Pyx_TraceLine(732,0,__PYX_ERR(0, 732, __pyx_L1_error)) - /* "cpp_process.pyx":794 + /* "cpp_process.pyx":799 * * * cdef inline extract_list(CachedScorerContext context, choices, processor, size_t limit, double score_cutoff): # <<<<<<<<<<<<<< * cdef double score = 0.0 * cdef size_t i */ - __Pyx_TraceLine(794,0,__PYX_ERR(0, 794, __pyx_L1_error)) + __Pyx_TraceLine(799,0,__PYX_ERR(0, 799, __pyx_L1_error)) - /* "cpp_process.pyx":853 + /* "cpp_process.pyx":858 * * * cdef inline extract_distance_list(CachedDistanceContext context, choices, processor, size_t limit, size_t max_): # <<<<<<<<<<<<<< * cdef size_t distance * cdef size_t i */ - __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error)) + __Pyx_TraceLine(858,0,__PYX_ERR(0, 858, __pyx_L1_error)) - /* "cpp_process.pyx":911 + /* "cpp_process.pyx":916 * return result_list * * cdef inline py_extract_dict(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< * cdef object score = None * # todo working directly with a list is relatively slow */ - __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error)) + __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error)) - /* "cpp_process.pyx":943 + /* "cpp_process.pyx":948 * * * cdef inline py_extract_list(query, choices, scorer, processor, size_t limit, double score_cutoff, dict kwargs): # <<<<<<<<<<<<<< * cdef object score = None * # todo working directly with a list is relatively slow */ - __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error)) + __Pyx_TraceLine(948,0,__PYX_ERR(0, 948, __pyx_L1_error)) - /* "cpp_process.pyx":976 + /* "cpp_process.pyx":981 * * * def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best matches in a list of choices. The list is sorted by the similarity. */ - __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_3extract, 0, __pyx_n_s_extract, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) + __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_3extract, 0, __pyx_n_s_extract, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 2)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_scorer = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_processor = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_9__defaults__); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract, __pyx_t_1) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_11__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract, __pyx_t_1) < 0) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_process.pyx":1104 + /* "cpp_process.pyx":1109 * * * def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< * """ * Find the best match in a list of choices */ - __Pyx_TraceLine(1104,0,__PYX_ERR(0, 1104, __pyx_L1_error)) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_5extract_iter, 0, __pyx_n_s_extract_iter, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_TraceLine(1109,0,__PYX_ERR(0, 1109, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_5extract_iter, 0, __pyx_n_s_extract_iter, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 2)) __PYX_ERR(0, 1104, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 2)) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_WRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_scorer = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_process); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_processor = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_11__defaults__); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_iter, __pyx_t_1) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_13__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_iter, __pyx_t_1) < 0) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "cpp_process.pyx":1420 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, + * const vector[proc_string]& choices, + */ + __Pyx_TraceLine(1420,0,__PYX_ERR(0, 1420, __pyx_L1_error)) + + + /* "cpp_process.pyx":1447 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_two_lists_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, const vector[proc_string]& choices, + * scorer, score_cutoff, dict kwargs + */ + __Pyx_TraceLine(1447,0,__PYX_ERR(0, 1447, __pyx_L1_error)) + + + /* "cpp_process.pyx":1469 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline py_cdist_two_lists( # <<<<<<<<<<<<<< + * const vector[PyObject*]& queries, const vector[PyObject*]& choices, + * scorer, score_cutoff, dict kwargs + */ + __Pyx_TraceLine(1469,0,__PYX_ERR(0, 1469, __pyx_L1_error)) + + + /* "cpp_process.pyx":1496 + * return matrix + * + * cdef cdist_two_lists(queries, choices, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef vector[proc_string] proc_queries + * cdef vector[proc_string] proc_choices + */ + __Pyx_TraceLine(1496,0,__PYX_ERR(0, 1496, __pyx_L1_error)) + + + /* "cpp_process.pyx":1590 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_similarity( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + __Pyx_TraceLine(1590,0,__PYX_ERR(0, 1590, __pyx_L1_error)) + + + /* "cpp_process.pyx":1617 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef inline cdist_single_list_distance( # <<<<<<<<<<<<<< + * const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs + * ): + */ + __Pyx_TraceLine(1617,0,__PYX_ERR(0, 1617, __pyx_L1_error)) + + + /* "cpp_process.pyx":1638 + * return matrix + * + * cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): # <<<<<<<<<<<<<< + * cdef size_t queries_len = len(queries) + * + */ + __Pyx_TraceLine(1638,0,__PYX_ERR(0, 1638, __pyx_L1_error)) + + + /* "cpp_process.pyx":1700 + * Py_DECREF(item) + * + * def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): # <<<<<<<<<<<<<< + * """ + * Compute distance/similarity between each pair of the two collections of inputs. + */ + __Pyx_TraceLine(1700,0,__PYX_ERR(0, 1700, __pyx_L1_error)) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11cpp_process_8cdist, 0, __pyx_n_s_cdist, NULL, __pyx_n_s_cpp_process, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_scorer = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_11cpp_process_15__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cdist, __pyx_t_1) < 0) __PYX_ERR(0, 1700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cpp_process.pyx":1 @@ -23151,16 +29920,16 @@ if (!__Pyx_RefNanny) { __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error)) __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_extractOne_line_476, __pyx_kp_u_Find_the_best_match_in_a_list_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_extractOne_line_481, __pyx_kp_u_Find_the_best_match_in_a_list_o) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_common.pxd":77 + /* "../../.local/lib/python3.9/site-packages/numpy/__init__.cython-30.pxd":1051 * * - * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< - * cdef proc_string s_proc - * s_proc.length = len(seq) + * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< + * """ + * returns the unit part of the dtype for a numpy datetime64 object. */ __Pyx_TraceReturn(Py_None, 0); @@ -23193,6 +29962,14 @@ if (!__Pyx_RefNanny) { /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#if _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4127 ) +#endif + + + /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ @@ -27435,8 +34212,590 @@ static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject return NULL; } +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + __Pyx_TypeName obj_type_name; + __Pyx_TypeName type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_TypeError, + "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, + obj_type_name, type_name); + __Pyx_DECREF_TypeName(obj_type_name); + __Pyx_DECREF_TypeName(type_name); + return 0; +} + +/* IsLittleEndian */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t <= '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case '?': return "'bool'"; + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) { + CYTHON_UNUSED_VAR(is_complex); + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number, ndim; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ndim = ctx->head->field->type->ndim; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && + (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* BufferGetAndValidate */ + static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { + if (unlikely(info->buf == NULL)) return; + if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; + __Pyx_ReleaseBuffer(info); +} +static void __Pyx_ZeroBuffer(Py_buffer* buf) { + buf->buf = NULL; + buf->obj = NULL; + buf->strides = __Pyx_zeros; + buf->shape = __Pyx_zeros; + buf->suboffsets = __Pyx_minusones; +} +static int __Pyx__GetBufferAndValidate( + Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, + int nd, int cast, __Pyx_BufFmt_StackElem* stack) +{ + buf->buf = NULL; + if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) { + __Pyx_ZeroBuffer(buf); + return -1; + } + if (unlikely(buf->ndim != nd)) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + nd, buf->ndim); + goto fail; + } + if (!cast) { + __Pyx_BufFmt_Context ctx; + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if (unlikely((size_t)buf->itemsize != dtype->size)) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", + buf->itemsize, (buf->itemsize > 1) ? "s" : "", + dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); + goto fail; + } + if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; + return 0; +fail:; + __Pyx_SafeReleaseBuffer(buf); + return -1; +} + /* ValidateBasesTuple */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS + #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n = PyTuple_GET_SIZE(bases); for (i = 1; i < n; i++) @@ -27478,7 +34837,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ -static int __Pyx_PyType_Ready(PyTypeObject *t) { + static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS @@ -27556,7 +34915,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType + #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) @@ -27617,7 +34976,7 @@ bad: #endif /* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; @@ -27685,7 +35044,7 @@ bad: } /* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, @@ -27699,7 +35058,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { } /* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { @@ -27752,7 +35111,7 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__18; + PyObject *module, *from_list, *star = __pyx_n_s__21; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -27821,7 +35180,7 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK + #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -27863,7 +35222,7 @@ static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API + #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -27945,7 +35304,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { #endif /* AddTraceback */ -#include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" #if CYTHON_COMPILING_IN_LIMITED_API @@ -28041,8 +35400,33 @@ bad: } #endif -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + __Pyx_TypeName obj_type_name; + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface", + obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -28064,7 +35448,7 @@ bad: } /* UnicodeAsUCS4 */ -static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); @@ -28094,8 +35478,316 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { return (Py_UCS4)-1; } +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = (float)(1.0) / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = (float)(1.0) / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = (double)(1.0) / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = (double)(1.0) / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0.0, -1.0); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + /* CIntFromPy */ -static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28291,7 +35983,7 @@ raise_neg_overflow: } /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28329,7 +36021,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { + static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28525,7 +36217,7 @@ raise_neg_overflow: } /* ObjectAsUCS4 */ -static Py_UCS4 __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) { + static Py_UCS4 __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) { if (ival < 0) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_OverflowError, @@ -28546,7 +36238,7 @@ static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { @@ -28554,14 +36246,14 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__22)); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__26)); } return name; } #endif /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28757,7 +36449,7 @@ raise_neg_overflow: } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28953,7 +36645,7 @@ raise_neg_overflow: } /* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; @@ -29069,7 +36761,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #endif /* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { + static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); @@ -29085,7 +36777,7 @@ static int __Pyx_check_binary_version(void) { } /* InitStrings */ -#if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { @@ -29373,5 +37065,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { } +/* #### Code section: utility_code_pragmas_end ### */ +#if _MSV_VER +#pragma warning( pop ) +#endif + + + /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ diff --git a/src/cpp_process.pyx b/src/cpp_process.pyx index 573057f..8f072ac 100644 --- a/src/cpp_process.pyx +++ b/src/cpp_process.pyx @@ -28,16 +28,21 @@ from rapidfuzz.fuzz import ( from libcpp.vector cimport vector from libcpp cimport algorithm from libcpp.utility cimport move +from libc.stdint cimport uint8_t, int32_t +from libc.math cimport floor from cpython.list cimport PyList_New, PyList_SET_ITEM from cpython.object cimport PyObject from cpython.ref cimport Py_INCREF, Py_DECREF -from cpp_common cimport proc_string, is_valid_string, convert_string, hash_array, hash_sequence +from cpp_common cimport proc_string, is_valid_string, convert_string, hash_array, hash_sequence, default_process_func import heapq from array import array +import numpy as np +cimport numpy as np +cimport cython cdef inline proc_string conv_sequence(seq) except *: if is_valid_string(seq): @@ -50,15 +55,15 @@ cdef inline proc_string conv_sequence(seq) except *: cdef extern from "cpp_process.hpp": cdef cppclass CachedScorerContext: CachedScorerContext() - double ratio(const proc_string&, double) except + + double ratio(const proc_string&, double) nogil except + cdef cppclass CachedDistanceContext: CachedDistanceContext() - size_t ratio(const proc_string&, size_t) except + + size_t ratio(const proc_string&, size_t) nogil except + # normalized distances # fuzz - CachedScorerContext cached_ratio_init( const proc_string&, int) except + + CachedScorerContext cached_ratio_init( const proc_string&, int) nogil except + CachedScorerContext cached_partial_ratio_init( const proc_string&, int) except + CachedScorerContext cached_token_sort_ratio_init( const proc_string&, int) except + CachedScorerContext cached_token_set_ratio_init( const proc_string&, int) except + @@ -226,7 +231,7 @@ cdef inline extractOne_dict(CachedScorerContext context, choices, processor, dou for choice_key, choice in choices.items(): if choice is None: continue - + score = context.ratio(conv_sequence(choice), score_cutoff) if score >= score_cutoff and score > result_score: @@ -400,8 +405,8 @@ cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_c score = scorer(query, processor(choice), **kwargs) if score >= score_cutoff and score > result_score: - kwargs["score_cutoff"] = score_cutoff score_cutoff = score + kwargs["score_cutoff"] = score result_score = score result_choice = choice result_key = choice_key @@ -416,8 +421,8 @@ cdef inline py_extractOne_dict(query, choices, scorer, processor, double score_c score = scorer(query, choice, **kwargs) if score >= score_cutoff and score > result_score: - kwargs["score_cutoff"] = score_cutoff score_cutoff = score + kwargs["score_cutoff"] = score result_score = score result_choice = choice result_key = choice_key @@ -445,8 +450,8 @@ cdef inline py_extractOne_list(query, choices, scorer, processor, double score_c score = scorer(query, processor(choice), **kwargs) if score >= score_cutoff and score > result_score: - kwargs["score_cutoff"] = score_cutoff score_cutoff = score + kwargs["score_cutoff"] = score result_score = score result_choice = choice result_index = i @@ -461,8 +466,8 @@ cdef inline py_extractOne_list(query, choices, scorer, processor, double score_c score = scorer(query, choice, **kwargs) if score >= score_cutoff and score > result_score: - kwargs["score_cutoff"] = score_cutoff score_cutoff = score + kwargs["score_cutoff"] = score result_score = score result_choice = choice result_index = i @@ -480,9 +485,9 @@ def extractOne(query, choices, *, scorer=WRatio, processor=default_process, scor Parameters ---------- - query : str + query : Sequence[Hashable] string we want to find - choices : Iterable + choices : Iterable[Sequence[Hashable]] | Mapping[Sequence[Hashable]] list of all strings the query should be compared with or dict with a mapping {: } scorer : Callable, optional @@ -506,7 +511,7 @@ def extractOne(query, choices, *, scorer=WRatio, processor=default_process, scor Returns ------- - Tuple[str, Any, Any] + Tuple[Sequence[Hashable], Any, Any] Returns the best match in form of a Tuple with 3 elements. The values stored in the tuple depend on the types of the input arguments. @@ -634,7 +639,7 @@ def extractOne(query, choices, *, scorer=WRatio, processor=default_process, scor return extractOne_dict(move(ScorerContext), choices, processor, c_score_cutoff) else: return extractOne_list(move(ScorerContext), choices, processor, c_score_cutoff) - + if IsIntegratedDistance(scorer): # distance implemented in C++ query_context = conv_sequence(query) @@ -804,13 +809,13 @@ cdef inline extract_list(CachedScorerContext context, choices, processor, size_t for i, choice in enumerate(choices): if choice is None: continue - + proc_choice = processor(choice) if proc_choice is None: continue - + score = context.ratio(conv_sequence(proc_choice), score_cutoff) - + if score >= score_cutoff: Py_INCREF(choice) results.push_back(ListMatchScorerElem(score, i, choice)) @@ -818,23 +823,23 @@ cdef inline extract_list(CachedScorerContext context, choices, processor, size_t for i, choice in enumerate(choices): if choice is None: continue - + score = context.ratio(conv_sequence(choice), score_cutoff) - + if score >= score_cutoff: Py_INCREF(choice) results.push_back(ListMatchScorerElem(score, i, choice)) - + # due to score_cutoff not always completely filled if limit > results.size(): limit = results.size() - + if limit >= results.size(): algorithm.sort(results.begin(), results.end(), ExtractScorerComp()) else: algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractScorerComp()) results.resize(limit) - + # copy elements into Python List result_list = PyList_New(limit) for i in range(limit): @@ -863,13 +868,13 @@ cdef inline extract_distance_list(CachedDistanceContext context, choices, proces for i, choice in enumerate(choices): if choice is None: continue - + proc_choice = processor(choice) if proc_choice is None: continue - + distance = context.ratio(conv_sequence(proc_choice), max_) - + if distance <= max_: Py_INCREF(choice) results.push_back(ListMatchDistanceElem(distance, i, choice)) @@ -877,23 +882,23 @@ cdef inline extract_distance_list(CachedDistanceContext context, choices, proces for i, choice in enumerate(choices): if choice is None: continue - + distance = context.ratio(conv_sequence(choice), max_) - + if distance <= max_: Py_INCREF(choice) results.push_back(ListMatchDistanceElem(distance, i, choice)) - + # due to max_ not always completely filled if limit > results.size(): limit = results.size() - + if limit >= results.size(): algorithm.sort(results.begin(), results.end(), ExtractDistanceComp()) else: algorithm.partial_sort(results.begin(), results.begin() + limit, results.end(), ExtractDistanceComp()) results.resize(limit) - + # copy elements into Python List result_list = PyList_New(limit) for i in range(limit): @@ -980,9 +985,9 @@ def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5 Parameters ---------- - query : str + query : Sequence[Hashable] string we want to find - choices : Iterable + choices : Collection[Sequence[Hashable]] | Mapping[Sequence[Hashable]] list of all strings the query should be compared with or dict with a mapping {: } scorer : Callable, optional @@ -1008,7 +1013,7 @@ def extract(query, choices, *, scorer=WRatio, processor=default_process, limit=5 Returns ------- - List[Tuple[str, Any, Any]] + List[Tuple[Sequence[Hashable], Any, Any]] The return type is always a List of Tuples with 3 elements. However the values stored in the tuple depend on the types of the input arguments. @@ -1107,9 +1112,9 @@ def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, sc Parameters ---------- - query : str + query : Sequence[Hashable] string we want to find - choices : Iterable + choices : Iterable[Sequence[Hashable]] | Mapping[Sequence[Hashable]] list of all strings the query should be compared with or dict with a mapping {: } scorer : Callable, optional @@ -1133,7 +1138,7 @@ def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, sc Yields ------- - Tuple[str, Any, Any] + Tuple[Sequence[Hashable], Any, Any] Yields similarity between the query and each choice in form of a Tuple with 3 elements. The values stored in the tuple depend on the types of the input arguments. @@ -1408,3 +1413,325 @@ def extract_iter(query, choices, *, scorer=WRatio, processor=default_process, sc yield from py_extract_iter_dict() else: yield from py_extract_iter_list() + + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef inline cdist_two_lists_similarity( + const vector[proc_string]& queries, + const vector[proc_string]& choices, + scorer, score_cutoff, dict kwargs +): + cdef size_t queries_len = queries.size() + cdef size_t choices_len = choices.size() + cdef size_t i, j + cdef double c_score_cutoff = 0 + cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + + if score_cutoff is not None: + c_score_cutoff = score_cutoff + if c_score_cutoff < 0 or c_score_cutoff > 100: + raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + + c_score_cutoff = floor(c_score_cutoff) + + for i in range(queries_len): + ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + for j in range(choices_len): + matrix[i, j] = floor(ScorerContext.ratio(choices[j], c_score_cutoff)) + + return matrix + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef inline cdist_two_lists_distance( + const vector[proc_string]& queries, const vector[proc_string]& choices, + scorer, score_cutoff, dict kwargs +): + cdef size_t queries_len = queries.size() + cdef size_t choices_len = choices.size() + cdef size_t i, j + cdef size_t c_max = -1 + cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.int32) + + if score_cutoff is not None and score_cutoff != -1: + c_max = score_cutoff + + for i in range(queries_len): + DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + for j in range(choices_len): + matrix[i, j] = DistanceContext.ratio(choices[j], c_max) + + return matrix + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef inline py_cdist_two_lists( + const vector[PyObject*]& queries, const vector[PyObject*]& choices, + scorer, score_cutoff, dict kwargs +): + cdef size_t queries_len = queries.size() + cdef size_t choices_len = choices.size() + cdef size_t i, j + cdef double c_score_cutoff = 0 + cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, choices_len), dtype=np.uint8) + + if score_cutoff is not None: + c_score_cutoff = score_cutoff + if c_score_cutoff < 0 or c_score_cutoff > 100: + raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + + c_score_cutoff = floor(c_score_cutoff) + + kwargs["processor"] = None + kwargs["score_cutoff"] = c_score_cutoff + + for i in range(queries_len): + for j in range(choices_len): + matrix[i, j] = floor( + scorer(queries[i], choices[j],**kwargs)) + + return matrix + +cdef cdist_two_lists(queries, choices, scorer, processor, score_cutoff, dict kwargs): + cdef vector[proc_string] proc_queries + cdef vector[proc_string] proc_choices + cdef vector[PyObject*] proc_py_queries + cdef vector[PyObject*] proc_py_choices + cdef size_t queries_len = len(queries) + cdef size_t choices_len = len(choices) + + try: + if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + proc_queries.reserve(queries_len) + proc_choices.reserve(choices_len) + + # processor None/False + if not processor: + for query in queries: + proc_queries.push_back(move(conv_sequence(query))) + + for choice in choices: + proc_choices.push_back(move(conv_sequence(choice))) + # processor has to be called through python + elif processor is not default_process and callable(processor): + proc_py_queries.reserve(queries_len) + for query in queries: + proc_query = processor(query) + Py_INCREF(proc_query) + proc_py_queries.push_back(proc_query) + proc_queries.push_back(move(conv_sequence(proc_query))) + + proc_py_choices.reserve(choices_len) + for choice in choices: + proc_choice = processor(choice) + Py_INCREF(proc_choice) + proc_py_choices.push_back(proc_choice) + proc_choices.push_back(move(conv_sequence(proc_choice))) + + # processor is True / default_process + else: + for query in queries: + proc_queries.push_back( + move(default_process_func(move(conv_sequence(query)))) + ) + + for choice in choices: + proc_choices.push_back( + move(default_process_func(move(conv_sequence(choice)))) + ) + + if IsIntegratedScorer(scorer): + return cdist_two_lists_similarity(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + + if IsIntegratedDistance(scorer): + return cdist_two_lists_distance(proc_queries, proc_choices, scorer, score_cutoff, kwargs) + + else: + proc_py_queries.reserve(queries_len) + proc_py_choices.reserve(choices_len) + + # processor None/False + if not processor: + for query in queries: + Py_INCREF(query) + proc_py_queries.push_back(query) + + for choice in choices: + Py_INCREF(choice) + proc_py_choices.push_back(choice) + # processor has to be called through python + else: + if not callable(processor): + processor = default_process + + for query in queries: + proc_query = processor(query) + Py_INCREF(proc_query) + proc_py_queries.push_back(proc_query) + + for choice in choices: + proc_choice = processor(choice) + Py_INCREF(proc_choice) + proc_py_choices.push_back(proc_choice) + + return py_cdist_two_lists(proc_py_queries, proc_py_choices, scorer, score_cutoff, kwargs) + + finally: + # decref all reference counts + for item in proc_py_queries: + Py_DECREF(item) + + for item in proc_py_choices: + Py_DECREF(item) + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef inline cdist_single_list_similarity( + const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs +): + cdef size_t queries_len = queries.size() + cdef size_t i, j + cdef double c_score_cutoff = 0 + cdef np.ndarray[np.uint8_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.uint8) + + if score_cutoff is not None: + c_score_cutoff = score_cutoff + if c_score_cutoff < 0 or c_score_cutoff > 100: + raise TypeError("score_cutoff has to be in the range of 0.0 - 100.0") + + c_score_cutoff = floor(c_score_cutoff) + + for i in range(queries_len): + matrix[i, i] = 100 + ScorerContext = CachedScorerInit(scorer, queries[i], 0, kwargs) + for j in range(i + 1, queries_len): + score = floor(ScorerContext.ratio(queries[j], c_score_cutoff)) + matrix[i, j] = score + matrix[j, i] = score + + return matrix + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef inline cdist_single_list_distance( + const vector[proc_string]& queries, scorer, score_cutoff, dict kwargs +): + cdef size_t queries_len = queries.size() + cdef size_t i, j + cdef size_t c_max = -1 + cdef np.ndarray[np.int32_t, ndim=2] matrix = np.empty((queries_len, queries_len), dtype=np.int32) + + if score_cutoff is not None and score_cutoff != -1: + c_max = score_cutoff + + for i in range(queries_len): + matrix[i, i] = 0 + DistanceContext = CachedDistanceInit(scorer, queries[i], 0, kwargs) + for j in range(i + 1, queries_len): + score = DistanceContext.ratio(queries[j], c_max) + matrix[i, j] = score + matrix[j, i] = score + + return matrix + +cdef cdist_single_list(queries, scorer, processor, score_cutoff, dict kwargs): + cdef size_t queries_len = len(queries) + + cdef vector[proc_string] proc_queries + cdef vector[PyObject*] proc_py_queries + + try: + if IsIntegratedScorer(scorer) or IsIntegratedDistance(scorer): + proc_queries.reserve(queries_len) + + # processor None/False + if not processor: + for query in queries: + proc_queries.push_back(move(conv_sequence(query))) + # processor has to be called through python + elif processor is not default_process and callable(processor): + proc_py_queries.reserve(queries_len) + for query in queries: + proc_query = processor(query) + Py_INCREF(proc_query) + proc_py_queries.push_back(proc_query) + proc_queries.push_back(move(conv_sequence(proc_query))) + + # processor is True / default_process + else: + for query in queries: + proc_queries.push_back( + move(default_process_func(move(conv_sequence(query)))) + ) + + if IsIntegratedScorer(scorer): + return cdist_single_list_similarity(proc_queries, scorer, score_cutoff, kwargs) + + if IsIntegratedDistance(scorer): + return cdist_single_list_distance(proc_queries, scorer, score_cutoff, kwargs) + + else: + proc_py_queries.reserve(queries_len) + + # processor None/False + if not processor: + for query in queries: + Py_INCREF(query) + proc_py_queries.push_back(query) + # processor has to be called through python + else: + if not callable(processor): + processor = default_process + + for query in queries: + proc_query = processor(query) + Py_INCREF(proc_query) + proc_py_queries.push_back(proc_query) + + # scorer(a, b) might not be equal to scorer(b, a) + return py_cdist_two_lists(proc_py_queries, proc_py_queries, scorer, score_cutoff, kwargs) + + finally: + # decref all reference counts + for item in proc_py_queries: + Py_DECREF(item) + +def cdist(queries, choices, *, scorer=ratio, processor=None, score_cutoff=None, **kwargs): + """ + Compute distance/similarity between each pair of the two collections of inputs. + + Parameters + ---------- + queries : Collection[Sequence[Hashable]] + list of all strings the queries + choices : Collection[Sequence[Hashable]] + list of all strings the query should be compared + scorer : Callable, optional + Optional callable that is used to calculate the matching score between + the query and each choice. This can be any of the scorers included in RapidFuzz + (both scorers that calculate the edit distance or the normalized edit distance). + Custom functions are not supported so far! + fuzz.ratio is used by default. + processor : Callable, optional + Optional callable that is used to preprocess the strings before + comparing them. When processor is True ``utils.default_process`` + is used. Default is None, which deactivates this behaviour. + score_cutoff : Any, optional + Optional argument for a score threshold. When an edit distance is used this represents the maximum + edit distance and matches with a `distance <= score_cutoff` are inserted as -1. When a + normalized edit distance is used this represents the minimal similarity + and matches with a `similarity >= score_cutoff` are inserted as 0. + Default is None, which deactivates this behaviour. + **kwargs : Any, optional + any other named parameters are passed to the scorer. This can be used to pass + e.g. weights to string_metric.levenshtein + + Returns + ------- + List[Tuple[Sequence[Hashable], Any, Any]] + """ + if queries is choices: + return cdist_single_list(queries, scorer, processor, score_cutoff, kwargs) + else: + return cdist_two_lists(queries, choices, scorer, processor, score_cutoff, kwargs) \ No newline at end of file diff --git a/src/cpp_string_metric.cpp b/src/cpp_string_metric.cpp index 521dcd9..18d5f69 100644 --- a/src/cpp_string_metric.cpp +++ b/src/cpp_string_metric.cpp @@ -1954,7 +1954,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #if PY_VERSION_HEX >= 0x03040000 && PY_VERSION_HEX < 0x03050000 #define __PYX_ENUM_CLASS_DECL #else - #define __PYX_ENUM_CLASS_DECL enum + #define __PYX_ENUM_CLASS_DECL #endif #else #define __PYX_ENUM_CLASS_DECL enum @@ -2270,9 +2270,9 @@ static const char __pyx_k_pyx_unpickle___Pyx_EnumMeta[] = "__pyx_unpickle___Pyx_ static const char __pyx_k_Pyx_EnumMeta___reduce_cython[] = "__Pyx_EnumMeta.__reduce_cython__"; static const char __pyx_k_levenshtein_editops_line_250[] = "levenshtein_editops (line 250)"; static const char __pyx_k_Pyx_EnumMeta___setstate_cython[] = "__Pyx_EnumMeta.__setstate_cython__"; -static const char __pyx_k_Calculates_a_normalized_levensh[] = "\n Calculates a normalized levenshtein distance using custom\n costs for insertion, deletion and substitution.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n See Also\n --------\n levenshtein : Levenshtein distance\n\n Notes\n -----\n The normalization of the Levenshtein distance is performed in the following way:\n\n .. math::\n :nowrap:\n\n \\begin{align*}\n dist_{max} &= \\begin{cases}\n min(len(s1), len(s2)) \\cdot sub, & \\text{if } sub \\leq ins + del \\\\\n len(s1) \\cdot del + len(s2) \\cdot ins, & \\text{otherwise}\n \\end{cases}\\\\[10pt]\n\n dist_{max} &= \\begin{cases}\n dist_{max} + (len(s1) - len(s2)) \\cdot del, & \\text{if } len(s1) > len(s2) \\\\\n dist_{max} + (len(s2) - len(s1)) \\cdot ins, & \\text{if } len(s1) < len(s2) \\\\\n dist_{max}, & \\text{if } len(s1) = len(s2)\n \\end{""cases}\\\\[10pt]\n\n ratio &= 100 \\cdot \\frac{distance(s1, s2)}{dist_{max}}\n \\end{align*}\n\n Examples\n --------\n Find the normalized Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import normalized_levenshtein\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\")\n 81.81818181818181\n\n Setting a score_cutoff allows the implementation to select\n a more efficient implementation:\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", score_cutoff=85)\n 0.0\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 85.71428571428571\n\n When a different processor is used s1 and s2 do not have to be strings\n\n >>> normalized_levenshtein([\"lewenstein\"], [\"levenshtein\"], processor=lambda s: s[0])\n 81.81818181818181\n "; -static const char __pyx_k_Calculates_the_minimum_number_o[] = "\n Calculates the minimum number of insertions, deletions, and substitutions\n required to change one sequence into the other according to Levenshtein with custom\n costs for insertion, deletion and substitution\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n Notes\n -----\n Depending on the input parameters different optimized implementation are used\n to improve the performance.\n\n Insertion = Deletion = Substitution:\n This is known as uniform Levenshtein distance and is the distance most commonly\n referred to as Levenshtein distance. The following implementation is used\n with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Leven""shtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 3 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n Hyyr\303\266s' algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [1]_. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of Myers' algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [3]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the Levenshtein distance in multiple\n Python libraries. All of them are implemented either in C/C++ or Cython.\n The graph shows, that python-Levenshtein is the only library with a time\n complexity of ``O(NM)``, while all other libraries have a time complexity of\n ``O([N/64]M)``. Especially for long strings RapidFuzz is a lot faster than\n all the other tested libraries.\n\n .. image:: img/uniform_levenshtein.svg\n\n\n Insertion = Deletion, Substitution >= Insertion + Deletion:\n Since every Substitution can be performed as Insertion + Deletion, this variant\n of the Levenshtein distance only uses Insertions and Deletions. Therefore this\n variant is often referred to as InDel-Distance. The following implementation\n is used with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allow""ed. The time complexity of\n this algorithm is ``O(N)``.\n\n - if max is 1 and the two strings have a similar length, the similarity can be\n calculated using a direct comparision aswell, since a substitution would cause\n a edit distance higher than max. The time complexity of this algorithm\n is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 4 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. As a difference to the normal Levenshtein distance this\n algorithm can even be used up to a threshold of 4 here, since the higher weight\n of substitutions decreases the amount of possible edit operations.\n The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n the BitPAl algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [4]_ and is extended with support\n for UTF32 in this implementation. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of the BitPAl algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [4]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the InDel distance in RapidFuzz\n and python-Levenshtein. Similar to the normal Levenshtein distance\n python-Levenshtein uses a implementation with a time complexity of ``O(NM)``,\n while RapidFuzz has a time complexity ""of ``O([N/64]M)``.\n\n .. image:: img/indel_levenshtein.svg\n\n\n Other weights:\n The implementation for other weights is based on Wagner-Fischer.\n It has a performance of ``O(N * M)`` and has a memory usage of ``O(N)``.\n Further details can be found in [2]_.\n\n References\n ----------\n .. [1] Hyyr\303\266, Heikki. \"A Bit-Vector Algorithm for Computing\n Levenshtein and Damerau Edit Distances.\"\n Nordic Journal of Computing, Volume 10 (2003): 29-39.\n .. [2] Wagner, Robert & Fischer, Michael\n \"The String-to-String Correction Problem.\"\n J. ACM. 21. (1974): 168-173\n .. [3] Myers, Gene. \"A fast bit-vector algorithm for approximate\n string matching based on dynamic programming.\"\n Journal of the ACM (JACM) 46.3 (1999): 395-415.\n .. [4] Loving, Joshua & Hern\303\241ndez, Y\303\266zen & Benson, Gary.\n \"BitPAl: A Bit-Parallel, General Integer-Scoring Sequence\n Alignment Algorithm. Bioinformatics\"\n Bioinformatics, Volume 30 (2014): 3166\342\200\2233173\n\n Examples\n --------\n Find the Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import levenshtein\n >>> levenshtein(\"lewenstein\", \"levenshtein\")\n 2\n\n Setting a maximum distance allows the implementation to select\n a more efficient implementation:\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", max=1)\n -1\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 3\n "; -static const char __pyx_k_Return_list_of_3_tuples_describ[] = "\n Return list of 3-tuples describing how to turn s1 into s2.\n Each tuple is of the form (tag, src_pos, dest_pos).\n\n The tags are strings, with these meanings:\n 'replace': s1[src_pos] should be replaced by s2[dest_pos]\n 'delete': s1[src_pos] should be deleted.\n 'insert': s2[dest_pos] should be inserted at s1[src_pos].\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n\n Returns\n -------\n editops : list[]\n edit operations required to turn s1 into s2\n\n Examples\n --------\n >>> from rapidfuzz.string_metric import levenshtein_editops\n >>> for tag, src_pos, dest_pos in levenshtein_editops(\"qabxcd\", \"abycdf\"):\n ... print((\"%7s s1[%d] s2[%d]\" % (tag, src_pos, dest_pos)))\n delete s1[1] s2[0]\n replace s1[4] s2[3]\n insert s1[6] s2[6]\n "; +static const char __pyx_k_Calculates_a_normalized_levensh[] = "\n Calculates a normalized levenshtein distance using custom\n costs for insertion, deletion and substitution.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n See Also\n --------\n levenshtein : Levenshtein distance\n\n Notes\n -----\n The normalization of the Levenshtein distance is performed in the following way:\n\n .. math::\n :nowrap:\n\n \\begin{align*}\n dist_{max} &= \\begin{cases}\n min(len(s1), len(s2)) \\cdot sub, & \\text{if } sub \\leq ins + del \\\\\n len(s1) \\cdot del + len(s2) \\cdot ins, & \\text{otherwise}\n \\end{cases}\\\\[10pt]\n\n dist_{max} &= \\begin{cases}\n dist_{max} + (len(s1) - len(s2)) \\cdot del, & \\text{if } len(s1) > len(s2) \\\\\n dist_{max} + (len(s2) - len(s1)) \\cdot ins, & \\text{if } len(s1) < len(s2) \\\\\n dist_{max}, & \\text{if } len""(s1) = len(s2)\n \\end{cases}\\\\[10pt]\n\n ratio &= 100 \\cdot \\frac{distance(s1, s2)}{dist_{max}}\n \\end{align*}\n\n Examples\n --------\n Find the normalized Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import normalized_levenshtein\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\")\n 81.81818181818181\n\n Setting a score_cutoff allows the implementation to select\n a more efficient implementation:\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", score_cutoff=85)\n 0.0\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 85.71428571428571\n\n When a different processor is used s1 and s2 do not have to be strings\n\n >>> normalized_levenshtein([\"lewenstein\"], [\"levenshtein\"], processor=lambda s: s[0])\n 81.81818181818181\n "; +static const char __pyx_k_Calculates_the_minimum_number_o[] = "\n Calculates the minimum number of insertions, deletions, and substitutions\n required to change one sequence into the other according to Levenshtein with custom\n costs for insertion, deletion and substitution\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n Notes\n -----\n Depending on the input parameters different optimized implementation are used\n to improve the performance.\n\n Insertion = Deletion = Substitution:\n This is known as uniform Levenshtein distance and is the distance most commonly\n referred to as Levenshtein distance. The following implementation is used\n with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does"" not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 3 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n Hyyr\303\266s' algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [1]_. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of Myers' algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [3]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the Levenshtein distance in multiple\n Python libraries. All of them are implemented either in C/C++ or Cython.\n The graph shows, that python-Levenshtein is the only library with a time\n complexity of ``O(NM)``, while all other libraries have a time complexity of\n ``O([N/64]M)``. Especially for long strings RapidFuzz is a lot faster than\n all the other tested libraries.\n\n .. image:: img/uniform_levenshtein.svg\n\n\n Insertion = Deletion, Substitution >= Insertion + Deletion:\n Since every Substitution can be performed as Insertion + Deletion, this variant\n of the Levenshtein distance only uses Insertions and Deletions. Therefore this\n variant is often referred to as InDel-Distance. The following implementation\n is used with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no differenc""e between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - if max is 1 and the two strings have a similar length, the similarity can be\n calculated using a direct comparision aswell, since a substitution would cause\n a edit distance higher than max. The time complexity of this algorithm\n is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 4 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. As a difference to the normal Levenshtein distance this\n algorithm can even be used up to a threshold of 4 here, since the higher weight\n of substitutions decreases the amount of possible edit operations.\n The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n the BitPAl algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [4]_ and is extended with support\n for UTF32 in this implementation. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of the BitPAl algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [4]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the InDel distance in RapidFuzz\n and python-Levenshtein. Similar to the normal Levenshtein distance\n python-Levenshtein uses a implementation with a time complexity of ``O(NM)``,\n while Ra""pidFuzz has a time complexity of ``O([N/64]M)``.\n\n .. image:: img/indel_levenshtein.svg\n\n\n Other weights:\n The implementation for other weights is based on Wagner-Fischer.\n It has a performance of ``O(N * M)`` and has a memory usage of ``O(N)``.\n Further details can be found in [2]_.\n\n References\n ----------\n .. [1] Hyyr\303\266, Heikki. \"A Bit-Vector Algorithm for Computing\n Levenshtein and Damerau Edit Distances.\"\n Nordic Journal of Computing, Volume 10 (2003): 29-39.\n .. [2] Wagner, Robert & Fischer, Michael\n \"The String-to-String Correction Problem.\"\n J. ACM. 21. (1974): 168-173\n .. [3] Myers, Gene. \"A fast bit-vector algorithm for approximate\n string matching based on dynamic programming.\"\n Journal of the ACM (JACM) 46.3 (1999): 395-415.\n .. [4] Loving, Joshua & Hern\303\241ndez, Y\303\266zen & Benson, Gary.\n \"BitPAl: A Bit-Parallel, General Integer-Scoring Sequence\n Alignment Algorithm. Bioinformatics\"\n Bioinformatics, Volume 30 (2014): 3166\342\200\2233173\n\n Examples\n --------\n Find the Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import levenshtein\n >>> levenshtein(\"lewenstein\", \"levenshtein\")\n 2\n\n Setting a maximum distance allows the implementation to select\n a more efficient implementation:\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", max=1)\n -1\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 3\n "; +static const char __pyx_k_Return_list_of_3_tuples_describ[] = "\n Return list of 3-tuples describing how to turn s1 into s2.\n Each tuple is of the form (tag, src_pos, dest_pos).\n\n The tags are strings, with these meanings:\n 'replace': s1[src_pos] should be replaced by s2[dest_pos]\n 'delete': s1[src_pos] should be deleted.\n 'insert': s2[dest_pos] should be inserted at s1[src_pos].\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n\n Returns\n -------\n editops : list[]\n edit operations required to turn s1 into s2\n\n Examples\n --------\n >>> from rapidfuzz.string_metric import levenshtein_editops\n >>> for tag, src_pos, dest_pos in levenshtein_editops(\"qabxcd\", \"abycdf\"):\n ... print((\"%7s s1[%d] s2[%d]\" % (tag, src_pos, dest_pos)))\n delete s1[1] s2[0]\n replace s1[4] s2[3]\n insert s1[6] s2[6]\n "; static const char __pyx_k_normalized_levenshtein_line_297[] = "normalized_levenshtein (line 297)"; static const char __pyx_k_Incompatible_checksums_s_vs_0xda[] = "Incompatible checksums (%s vs 0xda39a3e = ())"; #if !CYTHON_USE_MODULE_STATE @@ -3269,7 +3269,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_levenshtein, "\n Calculates the minimum number of insertions, deletions, and substitutions\n required to change one sequence into the other according to Levenshtein with custom\n costs for insertion, deletion and substitution\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n Notes\n -----\n Depending on the input parameters different optimized implementation are used\n to improve the performance.\n\n Insertion = Deletion = Substitution:\n This is known as uniform Levenshtein distance and is the distance most commonly\n referred to as Levenshtein distance. The following implementation is used\n with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Leven""shtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 3 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n Hyyr\303\266s' algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [1]_. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of Myers' algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [3]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the Levenshtein distance in multiple\n Python libraries. All of them are implemented either in C/C++ or Cython.\n The graph shows, that python-Levenshtein is the only library with a time\n complexity of ``O(NM)``, while all other libraries have a time complexity of\n ``O([N/64]M)``. Especially for long strings RapidFuzz is a lot faster than\n all the other tested libraries.\n\n .. image:: img/uniform_levenshtein.svg\n\n\n Insertion = Deletion, Substitution >= Insertion + Deletion:\n Since every Substitution can be performed as Insertion + Deletion, this variant\n of the Levenshtein distance only uses Insertions and Deletions. Therefore this\n variant is often referred to as InDel-Distance. The following implementation\n is used with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allow""ed. The time complexity of\n this algorithm is ``O(N)``.\n\n - if max is 1 and the two strings have a similar length, the similarity can be\n calculated using a direct comparision aswell, since a substitution would cause\n a edit distance higher than max. The time complexity of this algorithm\n is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 4 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. As a difference to the normal Levenshtein distance this\n algorithm can even be used up to a threshold of 4 here, since the higher weight\n of substitutions decreases the amount of possible edit operations.\n The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n the BitPAl algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [4]_ and is extended with support\n for UTF32 in this implementation. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of the BitPAl algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [4]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the InDel distance in RapidFuzz\n and python-Levenshtein. Similar to the normal Levenshtein distance\n python-Levenshtein uses a implementation with a time complexity of ``O(NM)``,\n while RapidFuzz has a time complexity ""of ``O([N/64]M)``.\n\n .. image:: img/indel_levenshtein.svg\n\n\n Other weights:\n The implementation for other weights is based on Wagner-Fischer.\n It has a performance of ``O(N * M)`` and has a memory usage of ``O(N)``.\n Further details can be found in [2]_.\n\n References\n ----------\n .. [1] Hyyr\303\266, Heikki. \"A Bit-Vector Algorithm for Computing\n Levenshtein and Damerau Edit Distances.\"\n Nordic Journal of Computing, Volume 10 (2003): 29-39.\n .. [2] Wagner, Robert & Fischer, Michael\n \"The String-to-String Correction Problem.\"\n J. ACM. 21. (1974): 168-173\n .. [3] Myers, Gene. \"A fast bit-vector algorithm for approximate\n string matching based on dynamic programming.\"\n Journal of the ACM (JACM) 46.3 (1999): 395-415.\n .. [4] Loving, Joshua & Hern\303\241ndez, Y\303\266zen & Benson, Gary.\n \"BitPAl: A Bit-Parallel, General Integer-Scoring Sequence\n Alignment Algorithm. Bioinformatics\"\n Bioinformatics, Volume 30 (2014): 3166\342\200\2233173\n\n Examples\n --------\n Find the Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import levenshtein\n >>> levenshtein(\"lewenstein\", \"levenshtein\")\n 2\n\n Setting a maximum distance allows the implementation to select\n a more efficient implementation:\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", max=1)\n -1\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 3\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_levenshtein, "\n Calculates the minimum number of insertions, deletions, and substitutions\n required to change one sequence into the other according to Levenshtein with custom\n costs for insertion, deletion and substitution\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n Notes\n -----\n Depending on the input parameters different optimized implementation are used\n to improve the performance.\n\n Insertion = Deletion = Substitution:\n This is known as uniform Levenshtein distance and is the distance most commonly\n referred to as Levenshtein distance. The following implementation is used\n with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no difference between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does"" not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 3 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n Hyyr\303\266s' algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [1]_. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of Myers' algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [3]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the Levenshtein distance in multiple\n Python libraries. All of them are implemented either in C/C++ or Cython.\n The graph shows, that python-Levenshtein is the only library with a time\n complexity of ``O(NM)``, while all other libraries have a time complexity of\n ``O([N/64]M)``. Especially for long strings RapidFuzz is a lot faster than\n all the other tested libraries.\n\n .. image:: img/uniform_levenshtein.svg\n\n\n Insertion = Deletion, Substitution >= Insertion + Deletion:\n Since every Substitution can be performed as Insertion + Deletion, this variant\n of the Levenshtein distance only uses Insertions and Deletions. Therefore this\n variant is often referred to as InDel-Distance. The following implementation\n is used with a worst-case performance of ``O([N/64]M)``.\n\n - if max is 0 the similarity can be calculated using a direct comparision,\n since no differenc""e between the strings is allowed. The time complexity of\n this algorithm is ``O(N)``.\n\n - if max is 1 and the two strings have a similar length, the similarity can be\n calculated using a direct comparision aswell, since a substitution would cause\n a edit distance higher than max. The time complexity of this algorithm\n is ``O(N)``.\n\n - A common prefix/suffix of the two compared strings does not affect\n the Levenshtein distance, so the affix is removed before calculating the\n similarity.\n\n - If max is \342\211\244 4 the mbleven algorithm is used. This algorithm\n checks all possible edit operations that are possible under\n the threshold `max`. As a difference to the normal Levenshtein distance this\n algorithm can even be used up to a threshold of 4 here, since the higher weight\n of substitutions decreases the amount of possible edit operations.\n The time complexity of this algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\244 64 after removing the common affix\n the BitPAl algorithm is used, which calculates the Levenshtein distance in\n parallel. The algorithm is described by [4]_ and is extended with support\n for UTF32 in this implementation. The time complexity of this\n algorithm is ``O(N)``.\n\n - If the length of the shorter string is \342\211\245 64 after removing the common affix\n a blockwise implementation of the BitPAl algorithm is used, which calculates\n the Levenshtein distance in parallel (64 characters at a time).\n The algorithm is described by [4]_. The time complexity of this\n algorithm is ``O([N/64]M)``.\n\n The following image shows a benchmark of the InDel distance in RapidFuzz\n and python-Levenshtein. Similar to the normal Levenshtein distance\n python-Levenshtein uses a implementation with a time complexity of ``O(NM)``,\n while Ra""pidFuzz has a time complexity of ``O([N/64]M)``.\n\n .. image:: img/indel_levenshtein.svg\n\n\n Other weights:\n The implementation for other weights is based on Wagner-Fischer.\n It has a performance of ``O(N * M)`` and has a memory usage of ``O(N)``.\n Further details can be found in [2]_.\n\n References\n ----------\n .. [1] Hyyr\303\266, Heikki. \"A Bit-Vector Algorithm for Computing\n Levenshtein and Damerau Edit Distances.\"\n Nordic Journal of Computing, Volume 10 (2003): 29-39.\n .. [2] Wagner, Robert & Fischer, Michael\n \"The String-to-String Correction Problem.\"\n J. ACM. 21. (1974): 168-173\n .. [3] Myers, Gene. \"A fast bit-vector algorithm for approximate\n string matching based on dynamic programming.\"\n Journal of the ACM (JACM) 46.3 (1999): 395-415.\n .. [4] Loving, Joshua & Hern\303\241ndez, Y\303\266zen & Benson, Gary.\n \"BitPAl: A Bit-Parallel, General Integer-Scoring Sequence\n Alignment Algorithm. Bioinformatics\"\n Bioinformatics, Volume 30 (2014): 3166\342\200\2233173\n\n Examples\n --------\n Find the Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import levenshtein\n >>> levenshtein(\"lewenstein\", \"levenshtein\")\n 2\n\n Setting a maximum distance allows the implementation to select\n a more efficient implementation:\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", max=1)\n -1\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 3\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_1levenshtein = {"levenshtein", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_1levenshtein, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_levenshtein}; static PyObject *__pyx_pw_17cpp_string_metric_1levenshtein(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -3993,7 +3993,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_2levenshtein_editops, "\n Return list of 3-tuples describing how to turn s1 into s2.\n Each tuple is of the form (tag, src_pos, dest_pos).\n\n The tags are strings, with these meanings:\n 'replace': s1[src_pos] should be replaced by s2[dest_pos]\n 'delete': s1[src_pos] should be deleted.\n 'insert': s2[dest_pos] should be inserted at s1[src_pos].\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n\n Returns\n -------\n editops : list[]\n edit operations required to turn s1 into s2\n\n Examples\n --------\n >>> from rapidfuzz.string_metric import levenshtein_editops\n >>> for tag, src_pos, dest_pos in levenshtein_editops(\"qabxcd\", \"abycdf\"):\n ... print((\"%7s s1[%d] s2[%d]\" % (tag, src_pos, dest_pos)))\n delete s1[1] s2[0]\n replace s1[4] s2[3]\n insert s1[6] s2[6]\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_2levenshtein_editops, "\n Return list of 3-tuples describing how to turn s1 into s2.\n Each tuple is of the form (tag, src_pos, dest_pos).\n\n The tags are strings, with these meanings:\n 'replace': s1[src_pos] should be replaced by s2[dest_pos]\n 'delete': s1[src_pos] should be deleted.\n 'insert': s2[dest_pos] should be inserted at s1[src_pos].\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n\n Returns\n -------\n editops : list[]\n edit operations required to turn s1 into s2\n\n Examples\n --------\n >>> from rapidfuzz.string_metric import levenshtein_editops\n >>> for tag, src_pos, dest_pos in levenshtein_editops(\"qabxcd\", \"abycdf\"):\n ... print((\"%7s s1[%d] s2[%d]\" % (tag, src_pos, dest_pos)))\n delete s1[1] s2[0]\n replace s1[4] s2[3]\n insert s1[6] s2[6]\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_3levenshtein_editops = {"levenshtein_editops", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_3levenshtein_editops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_2levenshtein_editops}; static PyObject *__pyx_pw_17cpp_string_metric_3levenshtein_editops(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4346,7 +4346,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_4normalized_levenshtein, "\n Calculates a normalized levenshtein distance using custom\n costs for insertion, deletion and substitution.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n See Also\n --------\n levenshtein : Levenshtein distance\n\n Notes\n -----\n The normalization of the Levenshtein distance is performed in the following way:\n\n .. math::\n :nowrap:\n\n \\begin{align*}\n dist_{max} &= \\begin{cases}\n min(len(s1), len(s2)) \\cdot sub, & \\text{if } sub \\leq ins + del \\\\\n len(s1) \\cdot del + len(s2) \\cdot ins, & \\text{otherwise}\n \\end{cases}\\\\[10pt]\n\n dist_{max} &= \\begin{cases}\n dist_{max} + (len(s1) - len(s2)) \\cdot del, & \\text{if } len(s1) > len(s2) \\\\\n dist_{max} + (len(s2) - len(s1)) \\cdot ins, & \\text{if } len(s1) < len(s2) \\\\\n dist_{max}, & \\text{if } len(s1) = len(s2)\n \\end{""cases}\\\\[10pt]\n\n ratio &= 100 \\cdot \\frac{distance(s1, s2)}{dist_{max}}\n \\end{align*}\n\n Examples\n --------\n Find the normalized Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import normalized_levenshtein\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\")\n 81.81818181818181\n\n Setting a score_cutoff allows the implementation to select\n a more efficient implementation:\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", score_cutoff=85)\n 0.0\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 85.71428571428571\n\n When a different processor is used s1 and s2 do not have to be strings\n\n >>> normalized_levenshtein([\"lewenstein\"], [\"levenshtein\"], processor=lambda s: s[0])\n 81.81818181818181\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_4normalized_levenshtein, "\n Calculates a normalized levenshtein distance using custom\n costs for insertion, deletion and substitution.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n weights : Tuple[int, int, int] or None, optional\n The weights for the three operations in the form\n (insertion, deletion, substitution). Default is (1, 1, 1),\n which gives all three operations a weight of 1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If unsupported weights are provided a ValueError is thrown\n\n See Also\n --------\n levenshtein : Levenshtein distance\n\n Notes\n -----\n The normalization of the Levenshtein distance is performed in the following way:\n\n .. math::\n :nowrap:\n\n \\begin{align*}\n dist_{max} &= \\begin{cases}\n min(len(s1), len(s2)) \\cdot sub, & \\text{if } sub \\leq ins + del \\\\\n len(s1) \\cdot del + len(s2) \\cdot ins, & \\text{otherwise}\n \\end{cases}\\\\[10pt]\n\n dist_{max} &= \\begin{cases}\n dist_{max} + (len(s1) - len(s2)) \\cdot del, & \\text{if } len(s1) > len(s2) \\\\\n dist_{max} + (len(s2) - len(s1)) \\cdot ins, & \\text{if } len(s1) < len(s2) \\\\\n dist_{max}, & \\text{if } len""(s1) = len(s2)\n \\end{cases}\\\\[10pt]\n\n ratio &= 100 \\cdot \\frac{distance(s1, s2)}{dist_{max}}\n \\end{align*}\n\n Examples\n --------\n Find the normalized Levenshtein distance between two strings:\n\n >>> from rapidfuzz.string_metric import normalized_levenshtein\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\")\n 81.81818181818181\n\n Setting a score_cutoff allows the implementation to select\n a more efficient implementation:\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", score_cutoff=85)\n 0.0\n\n It is possible to select different weights by passing a `weight`\n tuple.\n\n >>> normalized_levenshtein(\"lewenstein\", \"levenshtein\", weights=(1,1,2))\n 85.71428571428571\n\n When a different processor is used s1 and s2 do not have to be strings\n\n >>> normalized_levenshtein([\"lewenstein\"], [\"levenshtein\"], processor=lambda s: s[0])\n 81.81818181818181\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_5normalized_levenshtein = {"normalized_levenshtein", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_5normalized_levenshtein, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_4normalized_levenshtein}; static PyObject *__pyx_pw_17cpp_string_metric_5normalized_levenshtein(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4844,7 +4844,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_6hamming, "\n Calculates the Hamming distance between two strings.\n The hamming distance is defined as the number of positions \n where the two strings differ. It describes the minimum\n amount of substitutions required to transform s1 into s2.\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If s1 and s2 have a different length\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_6hamming, "\n Calculates the Hamming distance between two strings.\n The hamming distance is defined as the number of positions \n where the two strings differ. It describes the minimum\n amount of substitutions required to transform s1 into s2.\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n max : int or None, optional\n Maximum distance between s1 and s2, that is\n considered as a result. If the distance is bigger than max,\n -1 is returned instead. Default is None, which deactivates\n this behaviour.\n\n Returns\n -------\n distance : int\n distance between s1 and s2\n\n Raises\n ------\n ValueError\n If s1 and s2 have a different length\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_7hamming = {"hamming", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_7hamming, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_6hamming}; static PyObject *__pyx_pw_17cpp_string_metric_7hamming(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5228,7 +5228,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_8normalized_hamming, "\n Calculates a normalized hamming distance\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If s1 and s2 have a different length\n\n See Also\n --------\n hamming : Hamming distance\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_8normalized_hamming, "\n Calculates a normalized hamming distance\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If s1 and s2 have a different length\n\n See Also\n --------\n hamming : Hamming distance\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_9normalized_hamming = {"normalized_hamming", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_9normalized_hamming, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_8normalized_hamming}; static PyObject *__pyx_pw_17cpp_string_metric_9normalized_hamming(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5612,7 +5612,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_10jaro_similarity, "\n Calculates the jaro similarity\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_10jaro_similarity, "\n Calculates the jaro similarity\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_11jaro_similarity = {"jaro_similarity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_11jaro_similarity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_10jaro_similarity}; static PyObject *__pyx_pw_17cpp_string_metric_11jaro_similarity(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -5996,7 +5996,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_12jaro_winkler_similarity, "\n Calculates the jaro winkler similarity\n\n Parameters\n ----------\n s1 : str\n First string to compare.\n s2 : str\n Second string to compare.\n prefix_weight : float, optional\n Weight used for the common prefix of the two strings.\n Has to be between 0 and 0.25. Default is 0.1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If prefix_weight is invalid\n "); +PyDoc_STRVAR(__pyx_doc_17cpp_string_metric_12jaro_winkler_similarity, "\n Calculates the jaro winkler similarity\n\n Parameters\n ----------\n s1 : Sequence[Hashable]\n First string to compare.\n s2 : Sequence[Hashable]\n Second string to compare.\n prefix_weight : float, optional\n Weight used for the common prefix of the two strings.\n Has to be between 0 and 0.25. Default is 0.1.\n processor: bool or callable, optional\n Optional callable that is used to preprocess the strings before\n comparing them. When processor is True ``utils.default_process``\n is used. Default is None, which deactivates this behaviour.\n score_cutoff : float, optional\n Optional argument for a score threshold as a float between 0 and 100.\n For ratio < score_cutoff 0 is returned instead. Default is 0,\n which deactivates this behaviour.\n\n Returns\n -------\n similarity : float\n similarity between s1 and s2 as a float between 0 and 100\n\n Raises\n ------\n ValueError\n If prefix_weight is invalid\n "); static PyMethodDef __pyx_mdef_17cpp_string_metric_13jaro_winkler_similarity = {"jaro_winkler_similarity", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17cpp_string_metric_13jaro_winkler_similarity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_17cpp_string_metric_12jaro_winkler_similarity}; static PyObject *__pyx_pw_17cpp_string_metric_13jaro_winkler_similarity(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -6368,8 +6368,8 @@ static PyObject *__pyx_pf_17cpp_string_metric_12jaro_winkler_similarity(CYTHON_U return __pyx_r; } -/* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + +/* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -6411,30 +6411,30 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_array", 0); - /* "cpp_common.pxd":30 + /* "cpp_common.pxd":31 * # TODO on Cpython this does not require any copies * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode # <<<<<<<<<<<<<< * s_proc.length = len(arr) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_typecode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_typecode = ((Py_UCS4)__pyx_t_2); - /* "cpp_common.pxd":31 + /* "cpp_common.pxd":32 * cdef proc_string s_proc * cdef Py_UCS4 typecode = arr.typecode * s_proc.length = len(arr) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 32, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_3); - /* "cpp_common.pxd":33 + /* "cpp_common.pxd":34 * s_proc.length = len(arr) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -6443,7 +6443,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -6453,16 +6453,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_4 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_4)) { - /* "cpp_common.pxd":36 + /* "cpp_common.pxd":37 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 36, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 37, __pyx_L1_error) - /* "cpp_common.pxd":35 + /* "cpp_common.pxd":36 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -6471,7 +6471,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6487,7 +6487,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -6498,7 +6498,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx case 98: case 66: - /* "cpp_common.pxd":41 + /* "cpp_common.pxd":42 * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6507,7 +6507,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":42 + /* "cpp_common.pxd":43 * if typecode in {'b', 'B'}: # signed/unsigned char * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6519,21 +6519,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":43 + /* "cpp_common.pxd":44 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 43, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 44, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":40 + /* "cpp_common.pxd":41 * try: * # ignore signed/unsigned, since it is not relevant in any of the algorithms * if typecode in {'b', 'B'}: # signed/unsigned char # <<<<<<<<<<<<<< @@ -6543,7 +6543,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x75: - /* "cpp_common.pxd":45 + /* "cpp_common.pxd":46 * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6552,7 +6552,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":46 + /* "cpp_common.pxd":47 * elif typecode == 'u': # 'u' wchar_t * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6564,21 +6564,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":47 + /* "cpp_common.pxd":48 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L4_error) + __pyx_t_2 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_2)); } - /* "cpp_common.pxd":44 + /* "cpp_common.pxd":45 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode == 'u': # 'u' wchar_t # <<<<<<<<<<<<<< @@ -6588,7 +6588,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x68: - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -6597,7 +6597,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 72: - /* "cpp_common.pxd":49 + /* "cpp_common.pxd":50 * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6606,7 +6606,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":50 + /* "cpp_common.pxd":51 * elif typecode in {'h', 'H'}: # signed/unsigned short * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6618,21 +6618,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":51 + /* "cpp_common.pxd":52 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":48 + /* "cpp_common.pxd":49 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'h', 'H'}: # signed/unsigned short # <<<<<<<<<<<<<< @@ -6642,7 +6642,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x69: - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -6651,7 +6651,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 73: - /* "cpp_common.pxd":53 + /* "cpp_common.pxd":54 * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6660,7 +6660,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":54 + /* "cpp_common.pxd":55 * elif typecode in {'i', 'I'}: # signed/unsigned int * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6672,21 +6672,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":55 + /* "cpp_common.pxd":56 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":52 + /* "cpp_common.pxd":53 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'i', 'I'}: # signed/unsigned int # <<<<<<<<<<<<<< @@ -6696,7 +6696,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x6C: - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -6705,7 +6705,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 76: - /* "cpp_common.pxd":57 + /* "cpp_common.pxd":58 * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6714,7 +6714,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":58 + /* "cpp_common.pxd":59 * elif typecode in {'l', 'L'}: # signed/unsigned long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6726,21 +6726,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":59 + /* "cpp_common.pxd":60 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 59, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":56 + /* "cpp_common.pxd":57 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'l', 'L'}: # signed/unsigned long # <<<<<<<<<<<<<< @@ -6750,7 +6750,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; case 0x71: - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -6759,7 +6759,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ case 81: - /* "cpp_common.pxd":61 + /* "cpp_common.pxd":62 * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 # <<<<<<<<<<<<<< @@ -6768,7 +6768,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_UINT64; - /* "cpp_common.pxd":62 + /* "cpp_common.pxd":63 * elif typecode in {'q', 'Q'}: # signed/unsigned long long * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6780,21 +6780,21 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":63 + /* "cpp_common.pxd":64 * s_proc.kind = RAPIDFUZZ_UINT64 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] # <<<<<<<<<<<<<< * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 63, __pyx_L4_error) + __pyx_t_11 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_11); } - /* "cpp_common.pxd":60 + /* "cpp_common.pxd":61 * for i in range(s_proc.length): * (s_proc.data)[i] = arr[i] * elif typecode in {'q', 'Q'}: # signed/unsigned long long # <<<<<<<<<<<<<< @@ -6804,7 +6804,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx break; default: - /* "cpp_common.pxd":65 + /* "cpp_common.pxd":66 * (s_proc.data)[i] = arr[i] * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -6813,7 +6813,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":66 + /* "cpp_common.pxd":67 * else: # float/double are hashed * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -6825,23 +6825,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "cpp_common.pxd":67 + /* "cpp_common.pxd":68 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) # <<<<<<<<<<<<<< * except Exception as e: * free(s_proc.data) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 67, __pyx_L4_error) + __pyx_t_12 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_hash_t)-1))) __PYX_ERR(1, 68, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_12); } break; } - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6856,7 +6856,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -6866,7 +6866,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("cpp_common.hash_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 68, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_14, &__pyx_t_15) < 0) __PYX_ERR(1, 69, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_14); __Pyx_GOTREF(__pyx_t_15); @@ -6874,7 +6874,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_v_e = __pyx_t_14; /*try:*/ { - /* "cpp_common.pxd":69 + /* "cpp_common.pxd":70 * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -6883,7 +6883,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":70 + /* "cpp_common.pxd":71 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -6892,7 +6892,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":71 + /* "cpp_common.pxd":72 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -6904,10 +6904,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_14, __pyx_t_15); __pyx_t_1 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; - __PYX_ERR(1, 71, __pyx_L29_error) + __PYX_ERR(1, 72, __pyx_L29_error) } - /* "cpp_common.pxd":68 + /* "cpp_common.pxd":69 * for i in range(s_proc.length): * (s_proc.data)[i] = hash(arr[i]) * except Exception as e: # <<<<<<<<<<<<<< @@ -6951,7 +6951,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":38 + /* "cpp_common.pxd":39 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -6966,7 +6966,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_L9_try_end:; } - /* "cpp_common.pxd":73 + /* "cpp_common.pxd":74 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -6975,7 +6975,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":74 + /* "cpp_common.pxd":75 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -6985,8 +6985,8 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":27 - * void validate_string(object py_str, const char* err) except + + /* "cpp_common.pxd":28 + * proc_string default_process_func(proc_string sentence) except + * * cdef inline proc_string hash_array(arr) except *: # <<<<<<<<<<<<<< * # TODO on Cpython this does not require any copies @@ -7006,7 +7006,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_array(PyObject *__pyx return __pyx_r; } -/* "cpp_common.pxd":77 +/* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -7050,17 +7050,17 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_sequence", 0); - /* "cpp_common.pxd":79 + /* "cpp_common.pxd":80 * cdef inline proc_string hash_sequence(seq) except *: * cdef proc_string s_proc * s_proc.length = len(seq) # <<<<<<<<<<<<<< * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) */ - __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 80, __pyx_L1_error) __pyx_v_s_proc.length = ((size_t)__pyx_t_1); - /* "cpp_common.pxd":81 + /* "cpp_common.pxd":82 * s_proc.length = len(seq) * * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) # <<<<<<<<<<<<<< @@ -7069,7 +7069,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = malloc((__pyx_v_s_proc.length * (sizeof(uint64_t)))); - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -7079,16 +7079,16 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = ((__pyx_v_s_proc.data == NULL) != 0); if (unlikely(__pyx_t_2)) { - /* "cpp_common.pxd":84 + /* "cpp_common.pxd":85 * * if s_proc.data == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * try: */ - PyErr_NoMemory(); __PYX_ERR(1, 84, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(1, 85, __pyx_L1_error) - /* "cpp_common.pxd":83 + /* "cpp_common.pxd":84 * s_proc.data = malloc(s_proc.length * sizeof(uint64_t)) * * if s_proc.data == NULL: # <<<<<<<<<<<<<< @@ -7097,7 +7097,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7113,7 +7113,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "cpp_common.pxd":87 + /* "cpp_common.pxd":88 * * try: * s_proc.kind = RAPIDFUZZ_INT64 # <<<<<<<<<<<<<< @@ -7122,7 +7122,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.kind = RAPIDFUZZ_INT64; - /* "cpp_common.pxd":88 + /* "cpp_common.pxd":89 * try: * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): # <<<<<<<<<<<<<< @@ -7134,19 +7134,19 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "cpp_common.pxd":89 + /* "cpp_common.pxd":90 * s_proc.kind = RAPIDFUZZ_INT64 * for i in range(s_proc.length): * elem = seq[i] # <<<<<<<<<<<<<< * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L4_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_i, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 90, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -7160,23 +7160,23 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_2 = __pyx_t_11; goto __pyx_L13_bool_binop_done; } - __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 91, __pyx_L4_error) + __pyx_t_1 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 92, __pyx_L4_error) __pyx_t_11 = ((__pyx_t_1 == 1) != 0); __pyx_t_2 = __pyx_t_11; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "cpp_common.pxd":92 + /* "cpp_common.pxd":93 * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: * (s_proc.data)[i] = elem # <<<<<<<<<<<<<< * else: * (s_proc.data)[i] = hash(elem) */ - __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L4_error) + __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_v_elem); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)((Py_UCS4)__pyx_t_12)); - /* "cpp_common.pxd":91 + /* "cpp_common.pxd":92 * elem = seq[i] * # this is required so e.g. a list of char can be compared to a string * if isinstance(elem, str) and len(elem) == 1: # <<<<<<<<<<<<<< @@ -7186,7 +7186,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L12; } - /* "cpp_common.pxd":94 + /* "cpp_common.pxd":95 * (s_proc.data)[i] = elem * else: * (s_proc.data)[i] = hash(elem) # <<<<<<<<<<<<<< @@ -7194,13 +7194,13 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ * free(s_proc.data) */ /*else*/ { - __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 94, __pyx_L4_error) + __pyx_t_13 = PyObject_Hash(__pyx_v_elem); if (unlikely(__pyx_t_13 == ((Py_hash_t)-1))) __PYX_ERR(1, 95, __pyx_L4_error) (((uint64_t *)__pyx_v_s_proc.data)[__pyx_v_i]) = ((uint64_t)__pyx_t_13); } __pyx_L12:; } - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7215,7 +7215,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -7225,7 +7225,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_14) { __Pyx_AddTraceback("cpp_common.hash_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 95, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_15, &__pyx_t_16) < 0) __PYX_ERR(1, 96, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_15); __Pyx_GOTREF(__pyx_t_16); @@ -7233,7 +7233,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_v_e = __pyx_t_15; /*try:*/ { - /* "cpp_common.pxd":96 + /* "cpp_common.pxd":97 * (s_proc.data)[i] = hash(elem) * except Exception as e: * free(s_proc.data) # <<<<<<<<<<<<<< @@ -7242,7 +7242,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ free(__pyx_v_s_proc.data); - /* "cpp_common.pxd":97 + /* "cpp_common.pxd":98 * except Exception as e: * free(s_proc.data) * s_proc.data = NULL # <<<<<<<<<<<<<< @@ -7251,7 +7251,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.data = NULL; - /* "cpp_common.pxd":98 + /* "cpp_common.pxd":99 * free(s_proc.data) * s_proc.data = NULL * raise # <<<<<<<<<<<<<< @@ -7263,10 +7263,10 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_15, __pyx_t_16); __pyx_t_9 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; - __PYX_ERR(1, 98, __pyx_L20_error) + __PYX_ERR(1, 99, __pyx_L20_error) } - /* "cpp_common.pxd":95 + /* "cpp_common.pxd":96 * else: * (s_proc.data)[i] = hash(elem) * except Exception as e: # <<<<<<<<<<<<<< @@ -7310,7 +7310,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "cpp_common.pxd":86 + /* "cpp_common.pxd":87 * raise MemoryError * * try: # <<<<<<<<<<<<<< @@ -7325,7 +7325,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_L9_try_end:; } - /* "cpp_common.pxd":100 + /* "cpp_common.pxd":101 * raise * * s_proc.allocated = True # <<<<<<<<<<<<<< @@ -7333,7 +7333,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ */ __pyx_v_s_proc.allocated = 1; - /* "cpp_common.pxd":101 + /* "cpp_common.pxd":102 * * s_proc.allocated = True * return move(s_proc) # <<<<<<<<<<<<<< @@ -7341,7 +7341,7 @@ static CYTHON_INLINE proc_string __pyx_f_10cpp_common_hash_sequence(PyObject *__ __pyx_r = cython_std::move(__pyx_v_s_proc); goto __pyx_L0; - /* "cpp_common.pxd":77 + /* "cpp_common.pxd":78 * * * cdef inline proc_string hash_sequence(seq) except *: # <<<<<<<<<<<<<< @@ -9515,7 +9515,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 36, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 37, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 29, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -10958,6 +10958,14 @@ if (!__Pyx_RefNanny) { /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#if _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4127 ) +#endif + + + /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ @@ -16114,5 +16122,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { } +/* #### Code section: utility_code_pragmas_end ### */ +#if _MSV_VER +#pragma warning( pop ) +#endif + + + /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ diff --git a/src/cpp_string_metric.pyx b/src/cpp_string_metric.pyx index 57ff266..aca4874 100644 --- a/src/cpp_string_metric.pyx +++ b/src/cpp_string_metric.pyx @@ -55,9 +55,9 @@ def levenshtein(s1, s2, *, weights=(1,1,1), processor=None, max=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. weights : Tuple[int, int, int] or None, optional The weights for the three operations in the form @@ -259,9 +259,9 @@ def levenshtein_editops(s1, s2, *, processor=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -301,9 +301,9 @@ def normalized_levenshtein(s1, s2, *, weights=(1,1,1), processor=None, score_cut Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. weights : Tuple[int, int, int] or None, optional The weights for the three operations in the form @@ -407,9 +407,9 @@ def hamming(s1, s2, *, processor=None, max=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -451,9 +451,9 @@ def normalized_hamming(s1, s2, *, processor=None, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -498,9 +498,9 @@ def jaro_similarity(s1, s2, *, processor=None, score_cutoff=None): Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. processor: bool or callable, optional Optional callable that is used to preprocess the strings before @@ -537,9 +537,9 @@ def jaro_winkler_similarity(s1, s2, *, double prefix_weight=0.1, processor=None, Parameters ---------- - s1 : str + s1 : Sequence[Hashable] First string to compare. - s2 : str + s2 : Sequence[Hashable] Second string to compare. prefix_weight : float, optional Weight used for the common prefix of the two strings. diff --git a/src/rapidfuzz/process.py b/src/rapidfuzz/process.py index 492c501..0108135 100644 --- a/src/rapidfuzz/process.py +++ b/src/rapidfuzz/process.py @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT # Copyright (C) 2021 Max Bachmann -from rapidfuzz.cpp_process import extract, extractOne, extract_iter +from rapidfuzz.cpp_process import extract, extractOne, extract_iter, cdist diff --git a/tests/test_hypothesis.py b/tests/test_hypothesis.py index 2dcb14f..3c85521 100644 --- a/tests/test_hypothesis.py +++ b/tests/test_hypothesis.py @@ -9,6 +9,7 @@ import pytest from rapidfuzz import fuzz, process, utils, string_metric import random from math import isclose +import numpy as np def levenshtein(s1, s2, weights=(1, 1, 1)): """ @@ -79,6 +80,24 @@ def partial_ratio_short_needle(s1, s2): res = max(res, fuzz.ratio(s1, part)) return res +def cdist_scorer(queries, choices, scorer): + matrix = np.zeros((len(queries), len(choices)), dtype=np.uint8) + + for i, query in enumerate(queries): + for j, choice in enumerate(choices): + matrix[i, j] = scorer(query, choice) + + return matrix + +def cdist_distance(queries, choices, scorer): + matrix = np.zeros((len(queries), len(choices)), dtype=np.int32) + + for i, query in enumerate(queries): + for j, choice in enumerate(choices): + matrix[i, j] = scorer(query, choice) + + return matrix + def extractOne_scorer(s1, s2, scorer, processor=None, **kwargs): return process.extractOne(s1, [s2], processor=processor, scorer=scorer, **kwargs)[1] @@ -294,3 +313,19 @@ def test_only_identical_strings_extracted(scorer, processor, choices): for match in matches: assert processor(query) == processor(match[0]) + + +@given(queries=st.lists(st.text(), min_size=1), choices=st.lists(st.text(), min_size=1)) +@settings(max_examples=500, deadline=5000) +def test_cdist(queries, choices): + """ + Test that cdist returns correct results + """ + + reference_matrix = cdist_distance(queries, choices, scorer=string_metric.levenshtein) + matrix = process.cdist(queries, choices, scorer=string_metric.levenshtein) + assert (matrix == reference_matrix).all() + + reference_matrix = cdist_distance(queries, queries, scorer=string_metric.levenshtein) + matrix = process.cdist(queries, queries, scorer=string_metric.levenshtein) + assert (matrix == reference_matrix).all()