From 31eade3328f87b2eccca00014b91c5e9d30a3e1a Mon Sep 17 00:00:00 2001 From: MSeal Date: Sun, 22 Oct 2017 21:57:27 -0700 Subject: [PATCH] Fixed empty string MemoryErrors --- hunspell/hunspell.cpp | 1594 +++++++++++++++++++--------------------- hunspell/hunspell.pyx | 14 +- tests/hunspell_test.py | 22 +- 3 files changed, 766 insertions(+), 864 deletions(-) diff --git a/hunspell/hunspell.cpp b/hunspell/hunspell.cpp index a2cdee5..80d27cc 100644 --- a/hunspell/hunspell.cpp +++ b/hunspell/hunspell.cpp @@ -678,7 +678,7 @@ struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs; /* "hunspell/hunspell.pyx":22 * return 'ascii' - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * if isinstance(py_string, bytes): * return byte_to_c_string(py_string, holder, encoding) @@ -690,7 +690,7 @@ struct __pyx_opt_args_8hunspell_8hunspell_copy_to_c_string { /* "hunspell/hunspell.pyx":28 * return byte_to_c_string(py_string.encode(encoding, 'strict'), holder, encoding) - * + * * cdef int byte_to_c_string(bytes py_byte_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * cdef size_t str_len = len(py_byte_string) * cdef char *c_raw_string = py_byte_string @@ -702,7 +702,7 @@ struct __pyx_opt_args_8hunspell_8hunspell_byte_to_c_string { /* "hunspell/hunspell.pyx":38 * return str_len - * + * * cdef unicode c_string_to_unicode_no_except(char* s, basestring encoding='UTF-8'): # <<<<<<<<<<<<<< * # Convert c_string to python unicode * try: @@ -714,10 +714,10 @@ struct __pyx_opt_args_8hunspell_8hunspell_c_string_to_unicode_no_except { /* "hunspell/hunspell.pyx":49 * #////////////////////////////////////////////////////////////////////////////// - * + * * cdef struct ThreadWorkerArgs: # <<<<<<<<<<<<<< * # Structure for defining worker args - * + * */ struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs { int tid; @@ -730,7 +730,7 @@ struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs { }; /* "hunspell/hunspell.pyx":81 - * + * * #////////////////////////////////////////////////////////////////////////////// * cdef class HunspellWrap(object): # <<<<<<<<<<<<<< * # C-realm properties @@ -1194,7 +1194,6 @@ static const char __pyx_k_hunspell[] = "hunspell"; static const char __pyx_k_platform[] = "platform"; static const char __pyx_k_TimeCount[] = "TimeCount"; static const char __pyx_k_enumerate[] = "enumerate"; -static const char __pyx_k_BYTES_TYPE[] = "BYTES_TYPE"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_LookupError[] = "LookupError"; static const char __pyx_k_MemoryError[] = "MemoryError"; @@ -1228,7 +1227,6 @@ static const char __pyx_k_C_Users_Matthew_Workspace_cython[] = "C:\\Users\\Matth static PyObject *__pyx_kp_s_; static PyObject *__pyx_kp_u_; static PyObject *__pyx_n_s_AutoSyncCache; -static PyObject *__pyx_n_s_BYTES_TYPE; static PyObject *__pyx_kp_s_C_Users_Matthew_Workspace_cython; static PyObject *__pyx_kp_s_Could_not_create_thread; static PyObject *__pyx_kp_s_Could_not_join_thread; @@ -1358,7 +1356,7 @@ static PyObject *__pyx_codeobj__20; /* "hunspell/hunspell.pyx":15 * from hunspell.thread cimport * - * + * * def valid_encoding(basestring encoding): # <<<<<<<<<<<<<< * try: * "".encode(encoding, 'strict') @@ -1397,7 +1395,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj __Pyx_RefNannySetupContext("valid_encoding", 0); /* "hunspell/hunspell.pyx":16 - * + * * def valid_encoding(basestring encoding): * try: # <<<<<<<<<<<<<< * "".encode(encoding, 'strict') @@ -1481,7 +1479,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj goto __pyx_L7_try_return; /* "hunspell/hunspell.pyx":16 - * + * * def valid_encoding(basestring encoding): * try: # <<<<<<<<<<<<<< * "".encode(encoding, 'strict') @@ -1500,7 +1498,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj * return encoding * except LookupError: # <<<<<<<<<<<<<< * return 'ascii' - * + * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_LookupError); if (__pyx_t_7) { @@ -1514,7 +1512,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj * return encoding * except LookupError: * return 'ascii' # <<<<<<<<<<<<<< - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: */ __Pyx_XDECREF(__pyx_r); @@ -1529,7 +1527,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj __pyx_L5_except_error:; /* "hunspell/hunspell.pyx":16 - * + * * def valid_encoding(basestring encoding): * try: # <<<<<<<<<<<<<< * "".encode(encoding, 'strict') @@ -1559,7 +1557,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj /* "hunspell/hunspell.pyx":15 * from hunspell.thread cimport * - * + * * def valid_encoding(basestring encoding): # <<<<<<<<<<<<<< * try: * "".encode(encoding, 'strict') @@ -1581,7 +1579,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_valid_encoding(CYTHON_UNUSED PyObj /* "hunspell/hunspell.pyx":22 * return 'ascii' - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * if isinstance(py_string, bytes): * return byte_to_c_string(py_string, holder, encoding) @@ -1607,13 +1605,13 @@ static int __pyx_f_8hunspell_8hunspell_copy_to_c_string(PyObject *__pyx_v_py_str } /* "hunspell/hunspell.pyx":23 - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: * if isinstance(py_string, bytes): # <<<<<<<<<<<<<< * return byte_to_c_string(py_string, holder, encoding) * else: */ - __pyx_t_1 = PyBytes_Check(__pyx_v_py_string); + __pyx_t_1 = PyBytes_Check(__pyx_v_py_string); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { @@ -1631,7 +1629,7 @@ static int __pyx_f_8hunspell_8hunspell_copy_to_c_string(PyObject *__pyx_v_py_str goto __pyx_L0; /* "hunspell/hunspell.pyx":23 - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: * if isinstance(py_string, bytes): # <<<<<<<<<<<<<< * return byte_to_c_string(py_string, holder, encoding) @@ -1643,7 +1641,7 @@ static int __pyx_f_8hunspell_8hunspell_copy_to_c_string(PyObject *__pyx_v_py_str * return byte_to_c_string(py_string, holder, encoding) * else: * return byte_to_c_string(py_string.encode(encoding, 'strict'), holder, encoding) # <<<<<<<<<<<<<< - * + * * cdef int byte_to_c_string(bytes py_byte_string, char **holder, basestring encoding='UTF-8') except -1: */ /*else*/ { @@ -1704,7 +1702,7 @@ static int __pyx_f_8hunspell_8hunspell_copy_to_c_string(PyObject *__pyx_v_py_str /* "hunspell/hunspell.pyx":22 * return 'ascii' - * + * * cdef int copy_to_c_string(basestring py_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * if isinstance(py_string, bytes): * return byte_to_c_string(py_string, holder, encoding) @@ -1725,7 +1723,7 @@ static int __pyx_f_8hunspell_8hunspell_copy_to_c_string(PyObject *__pyx_v_py_str /* "hunspell/hunspell.pyx":28 * return byte_to_c_string(py_string.encode(encoding, 'strict'), holder, encoding) - * + * * cdef int byte_to_c_string(bytes py_byte_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * cdef size_t str_len = len(py_byte_string) * cdef char *c_raw_string = py_byte_string @@ -1744,7 +1742,7 @@ static int __pyx_f_8hunspell_8hunspell_byte_to_c_string(PyObject *__pyx_v_py_byt } /* "hunspell/hunspell.pyx":29 - * + * * cdef int byte_to_c_string(bytes py_byte_string, char **holder, basestring encoding='UTF-8') except -1: * cdef size_t str_len = len(py_byte_string) # <<<<<<<<<<<<<< * cdef char *c_raw_string = py_byte_string @@ -1818,7 +1816,7 @@ static int __pyx_f_8hunspell_8hunspell_byte_to_c_string(PyObject *__pyx_v_py_byt * strncpy(deref(holder), c_raw_string, str_len) * holder[0][str_len] = 0 # <<<<<<<<<<<<<< * return str_len - * + * */ ((__pyx_v_holder[0])[__pyx_v_str_len]) = 0; @@ -1826,7 +1824,7 @@ static int __pyx_f_8hunspell_8hunspell_byte_to_c_string(PyObject *__pyx_v_py_byt * strncpy(deref(holder), c_raw_string, str_len) * holder[0][str_len] = 0 * return str_len # <<<<<<<<<<<<<< - * + * * cdef unicode c_string_to_unicode_no_except(char* s, basestring encoding='UTF-8'): */ __pyx_r = __pyx_v_str_len; @@ -1834,7 +1832,7 @@ static int __pyx_f_8hunspell_8hunspell_byte_to_c_string(PyObject *__pyx_v_py_byt /* "hunspell/hunspell.pyx":28 * return byte_to_c_string(py_string.encode(encoding, 'strict'), holder, encoding) - * + * * cdef int byte_to_c_string(bytes py_byte_string, char **holder, basestring encoding='UTF-8') except -1: # <<<<<<<<<<<<<< * cdef size_t str_len = len(py_byte_string) * cdef char *c_raw_string = py_byte_string @@ -1851,7 +1849,7 @@ static int __pyx_f_8hunspell_8hunspell_byte_to_c_string(PyObject *__pyx_v_py_byt /* "hunspell/hunspell.pyx":38 * return str_len - * + * * cdef unicode c_string_to_unicode_no_except(char* s, basestring encoding='UTF-8'): # <<<<<<<<<<<<<< * # Convert c_string to python unicode * try: @@ -1975,7 +1973,7 @@ static PyObject *__pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(char * return s.decode(encoding, 'strict') * except UnicodeDecodeError: # <<<<<<<<<<<<<< * return u"" - * + * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_7) { @@ -1989,7 +1987,7 @@ static PyObject *__pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(char * return s.decode(encoding, 'strict') * except UnicodeDecodeError: * return u"" # <<<<<<<<<<<<<< - * + * * #////////////////////////////////////////////////////////////////////////////// */ __Pyx_XDECREF(__pyx_r); @@ -2034,7 +2032,7 @@ static PyObject *__pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(char /* "hunspell/hunspell.pyx":38 * return str_len - * + * * cdef unicode c_string_to_unicode_no_except(char* s, basestring encoding='UTF-8'): # <<<<<<<<<<<<<< * # Convert c_string to python unicode * try: @@ -2056,7 +2054,7 @@ static PyObject *__pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(char /* "hunspell/hunspell.pyx":67 * bint stem_action - * + * * cdef void *hunspell_worker(void *argument) nogil: # <<<<<<<<<<<<<< * cdef ThreadWorkerArgs args * cdef int i @@ -2073,14 +2071,14 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) * cdef ThreadWorkerArgs args * cdef int i * args = deref(argument) # <<<<<<<<<<<<<< - * + * * for i from 0 <= i < args.n_words: */ __pyx_v_args = (*((struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs *)__pyx_v_argument)); /* "hunspell/hunspell.pyx":72 * args = deref(argument) - * + * * for i from 0 <= i < args.n_words: # <<<<<<<<<<<<<< * if args.stem_action: * args.output_counts[i] = args.hspell.stem(args.output_array_ptr + i, deref(args.word_list + i)) @@ -2089,7 +2087,7 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "hunspell/hunspell.pyx":73 - * + * * for i from 0 <= i < args.n_words: * if args.stem_action: # <<<<<<<<<<<<<< * args.output_counts[i] = args.hspell.stem(args.output_array_ptr + i, deref(args.word_list + i)) @@ -2108,7 +2106,7 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) (__pyx_v_args.output_counts[__pyx_v_i]) = __pyx_v_args.hspell->stem((__pyx_v_args.output_array_ptr + __pyx_v_i), (*(__pyx_v_args.word_list + __pyx_v_i))); /* "hunspell/hunspell.pyx":73 - * + * * for i from 0 <= i < args.n_words: * if args.stem_action: # <<<<<<<<<<<<<< * args.output_counts[i] = args.hspell.stem(args.output_array_ptr + i, deref(args.word_list + i)) @@ -2121,7 +2119,7 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) * args.output_counts[i] = args.hspell.stem(args.output_array_ptr + i, deref(args.word_list + i)) * else: * args.output_counts[i] = args.hspell.suggest(args.output_array_ptr + i, deref(args.word_list + i)) # <<<<<<<<<<<<<< - * + * * return NULL */ /*else*/ { @@ -2132,9 +2130,9 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) /* "hunspell/hunspell.pyx":78 * args.output_counts[i] = args.hspell.suggest(args.output_array_ptr + i, deref(args.word_list + i)) - * + * * return NULL # <<<<<<<<<<<<<< - * + * * #////////////////////////////////////////////////////////////////////////////// */ __pyx_r = NULL; @@ -2142,7 +2140,7 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) /* "hunspell/hunspell.pyx":67 * bint stem_action - * + * * cdef void *hunspell_worker(void *argument) nogil: # <<<<<<<<<<<<<< * cdef ThreadWorkerArgs args * cdef int i @@ -2155,7 +2153,7 @@ static void *__pyx_f_8hunspell_8hunspell_hunspell_worker(void *__pyx_v_argument) /* "hunspell/hunspell.pyx":94 * cdef char *dpath - * + * * cdef Hunspell *_create_hspell_inst(self, basestring lang) except *: # <<<<<<<<<<<<<< * # C-realm Create Hunspell Instance * if self.affpath: @@ -2251,7 +2249,7 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( * free(self.dpath) * self.dpath = NULL # <<<<<<<<<<<<<< * cdef Hunspell *holder = NULL - * + * */ __pyx_v_self->dpath = NULL; @@ -2259,14 +2257,14 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( * free(self.dpath) * self.dpath = NULL * cdef Hunspell *holder = NULL # <<<<<<<<<<<<<< - * + * * pyaffpath = os.path.join(self._hunspell_dir, '{}.aff'.format(lang)) */ __pyx_v_holder = NULL; /* "hunspell/hunspell.pyx":104 * cdef Hunspell *holder = NULL - * + * * pyaffpath = os.path.join(self._hunspell_dir, '{}.aff'.format(lang)) # <<<<<<<<<<<<<< * pydpath = os.path.join(self._hunspell_dir, '{}.dic'.format(lang)) * for fpath in (pyaffpath, pydpath): @@ -2375,7 +2373,7 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( __pyx_t_2 = 0; /* "hunspell/hunspell.pyx":105 - * + * * pyaffpath = os.path.join(self._hunspell_dir, '{}.aff'.format(lang)) * pydpath = os.path.join(self._hunspell_dir, '{}.dic'.format(lang)) # <<<<<<<<<<<<<< * for fpath in (pyaffpath, pydpath): @@ -2517,7 +2515,7 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( * for fpath in (pyaffpath, pydpath): * if not os.path.isfile(fpath) or not os.access(fpath, os.R_OK): # <<<<<<<<<<<<<< * raise IOError("File '{}' not found or accessible".format(fpath)) - * + * */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -2646,8 +2644,8 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( * for fpath in (pyaffpath, pydpath): * if not os.path.isfile(fpath) or not os.access(fpath, os.R_OK): * raise IOError("File '{}' not found or accessible".format(fpath)) # <<<<<<<<<<<<<< - * - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or + * + * copy_to_c_string(pyaffpath, &self.affpath) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_not_found_or_accessible, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -2711,7 +2709,7 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( * for fpath in (pyaffpath, pydpath): * if not os.path.isfile(fpath) or not os.access(fpath, os.R_OK): # <<<<<<<<<<<<<< * raise IOError("File '{}' not found or accessible".format(fpath)) - * + * */ } @@ -2727,102 +2725,66 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( /* "hunspell/hunspell.pyx":110 * raise IOError("File '{}' not found or accessible".format(fpath)) - * - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or # <<<<<<<<<<<<<< - * copy_to_c_string(pydpath, &self.dpath) <= 0): - * raise MemoryError() + * + * copy_to_c_string(pyaffpath, &self.affpath) # <<<<<<<<<<<<<< + * copy_to_c_string(pydpath, &self.dpath) + * holder = new Hunspell(self.affpath, self.dpath) */ if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_pyaffpath))||((__pyx_v_pyaffpath) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_pyaffpath)->tp_name), 0))) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_t_8 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(((PyObject*)__pyx_v_pyaffpath), (&__pyx_v_self->affpath), NULL); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 110, __pyx_L1_error) - __pyx_t_10 = ((__pyx_t_8 <= 0) != 0); - if (!__pyx_t_10) { - } else { - __pyx_t_1 = __pyx_t_10; - goto __pyx_L11_bool_binop_done; - } /* "hunspell/hunspell.pyx":111 - * - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or - * copy_to_c_string(pydpath, &self.dpath) <= 0): # <<<<<<<<<<<<<< - * raise MemoryError() + * + * copy_to_c_string(pyaffpath, &self.affpath) + * copy_to_c_string(pydpath, &self.dpath) # <<<<<<<<<<<<<< * holder = new Hunspell(self.affpath, self.dpath) + * if holder is NULL: */ if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_pydpath))||((__pyx_v_pydpath) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_pydpath)->tp_name), 0))) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_8 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(((PyObject*)__pyx_v_pydpath), (&__pyx_v_self->dpath), NULL); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 111, __pyx_L1_error) - __pyx_t_10 = ((__pyx_t_8 <= 0) != 0); - __pyx_t_1 = __pyx_t_10; - __pyx_L11_bool_binop_done:; - - /* "hunspell/hunspell.pyx":110 - * raise IOError("File '{}' not found or accessible".format(fpath)) - * - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or # <<<<<<<<<<<<<< - * copy_to_c_string(pydpath, &self.dpath) <= 0): - * raise MemoryError() - */ - if (__pyx_t_1) { - - /* "hunspell/hunspell.pyx":112 - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or - * copy_to_c_string(pydpath, &self.dpath) <= 0): - * raise MemoryError() # <<<<<<<<<<<<<< - * holder = new Hunspell(self.affpath, self.dpath) - * if holder is NULL: - */ - PyErr_NoMemory(); __PYX_ERR(0, 112, __pyx_L1_error) - /* "hunspell/hunspell.pyx":110 - * raise IOError("File '{}' not found or accessible".format(fpath)) - * - * if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or # <<<<<<<<<<<<<< - * copy_to_c_string(pydpath, &self.dpath) <= 0): - * raise MemoryError() - */ - } - - /* "hunspell/hunspell.pyx":113 - * copy_to_c_string(pydpath, &self.dpath) <= 0): - * raise MemoryError() + /* "hunspell/hunspell.pyx":112 + * copy_to_c_string(pyaffpath, &self.affpath) + * copy_to_c_string(pydpath, &self.dpath) * holder = new Hunspell(self.affpath, self.dpath) # <<<<<<<<<<<<<< * if holder is NULL: * raise MemoryError() */ __pyx_v_holder = new Hunspell(__pyx_v_self->affpath, __pyx_v_self->dpath, NULL); - /* "hunspell/hunspell.pyx":114 - * raise MemoryError() + /* "hunspell/hunspell.pyx":113 + * copy_to_c_string(pydpath, &self.dpath) * holder = new Hunspell(self.affpath, self.dpath) * if holder is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ __pyx_t_1 = ((__pyx_v_holder == NULL) != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":115 + /* "hunspell/hunspell.pyx":114 * holder = new Hunspell(self.affpath, self.dpath) * if holder is NULL: * raise MemoryError() # <<<<<<<<<<<<<< - * + * * return holder */ - PyErr_NoMemory(); __PYX_ERR(0, 115, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 114, __pyx_L1_error) - /* "hunspell/hunspell.pyx":114 - * raise MemoryError() + /* "hunspell/hunspell.pyx":113 + * copy_to_c_string(pydpath, &self.dpath) * holder = new Hunspell(self.affpath, self.dpath) * if holder is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ } - /* "hunspell/hunspell.pyx":117 + /* "hunspell/hunspell.pyx":116 * raise MemoryError() - * + * * return holder # <<<<<<<<<<<<<< - * + * * def __init__(self, basestring lang='en_US', basestring cache_manager="hunspell", */ __pyx_r = __pyx_v_holder; @@ -2830,7 +2792,7 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( /* "hunspell/hunspell.pyx":94 * cdef char *dpath - * + * * cdef Hunspell *_create_hspell_inst(self, basestring lang) except *: # <<<<<<<<<<<<<< * # C-realm Create Hunspell Instance * if self.affpath: @@ -2854,9 +2816,9 @@ static Hunspell *__pyx_f_8hunspell_8hunspell_12HunspellWrap__create_hspell_inst( return __pyx_r; } -/* "hunspell/hunspell.pyx":119 +/* "hunspell/hunspell.pyx":118 * return holder - * + * * def __init__(self, basestring lang='en_US', basestring cache_manager="hunspell", # <<<<<<<<<<<<<< * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): * # TODO - make these LRU caches so that you don't destroy your memory! @@ -2878,8 +2840,8 @@ static int __pyx_pw_8hunspell_8hunspell_12HunspellWrap_1__init__(PyObject *__pyx values[0] = ((PyObject*)__pyx_n_s_en_US); values[1] = ((PyObject*)__pyx_n_s_hunspell); - /* "hunspell/hunspell.pyx":120 - * + /* "hunspell/hunspell.pyx":119 + * * def __init__(self, basestring lang='en_US', basestring cache_manager="hunspell", * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): # <<<<<<<<<<<<<< * # TODO - make these LRU caches so that you don't destroy your memory! @@ -2922,7 +2884,7 @@ static int __pyx_pw_8hunspell_8hunspell_12HunspellWrap_1__init__(PyObject *__pyx } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 118, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2941,21 +2903,21 @@ static int __pyx_pw_8hunspell_8hunspell_12HunspellWrap_1__init__(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("hunspell.hunspell.HunspellWrap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lang), (&PyBaseString_Type), 1, "lang", 1))) __PYX_ERR(0, 119, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cache_manager), (&PyBaseString_Type), 1, "cache_manager", 1))) __PYX_ERR(0, 119, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disk_cache_dir), (&PyBaseString_Type), 1, "disk_cache_dir", 1))) __PYX_ERR(0, 120, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hunspell_data_dir), (&PyBaseString_Type), 1, "hunspell_data_dir", 1))) __PYX_ERR(0, 120, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lang), (&PyBaseString_Type), 1, "lang", 1))) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cache_manager), (&PyBaseString_Type), 1, "cache_manager", 1))) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disk_cache_dir), (&PyBaseString_Type), 1, "disk_cache_dir", 1))) __PYX_ERR(0, 119, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hunspell_data_dir), (&PyBaseString_Type), 1, "hunspell_data_dir", 1))) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), __pyx_v_lang, __pyx_v_cache_manager, __pyx_v_disk_cache_dir, __pyx_v_hunspell_data_dir); - /* "hunspell/hunspell.pyx":119 + /* "hunspell/hunspell.pyx":118 * return holder - * + * * def __init__(self, basestring lang='en_US', basestring cache_manager="hunspell", # <<<<<<<<<<<<<< * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): * # TODO - make these LRU caches so that you don't destroy your memory! @@ -2989,7 +2951,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_hunspell_data_dir); - /* "hunspell/hunspell.pyx":122 + /* "hunspell/hunspell.pyx":121 * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): * # TODO - make these LRU caches so that you don't destroy your memory! * if hunspell_data_dir is None: # <<<<<<<<<<<<<< @@ -3000,29 +2962,29 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "hunspell/hunspell.pyx":123 + /* "hunspell/hunspell.pyx":122 * # TODO - make these LRU caches so that you don't destroy your memory! * if hunspell_data_dir is None: * hunspell_data_dir = os.environ.get("HUNSPELL_DATA") # <<<<<<<<<<<<<< * if hunspell_data_dir is None: * hunspell_data_dir = os.path.join(os.path.dirname(__file__), '..', 'dictionaries') */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 123, __pyx_L1_error) + if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_hunspell_data_dir, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":122 + /* "hunspell/hunspell.pyx":121 * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): * # TODO - make these LRU caches so that you don't destroy your memory! * if hunspell_data_dir is None: # <<<<<<<<<<<<<< @@ -3031,7 +2993,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj */ } - /* "hunspell/hunspell.pyx":124 + /* "hunspell/hunspell.pyx":123 * if hunspell_data_dir is None: * hunspell_data_dir = os.environ.get("HUNSPELL_DATA") * if hunspell_data_dir is None: # <<<<<<<<<<<<<< @@ -3042,30 +3004,30 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":125 + /* "hunspell/hunspell.pyx":124 * hunspell_data_dir = os.environ.get("HUNSPELL_DATA") * if hunspell_data_dir is None: * hunspell_data_dir = os.path.join(os.path.dirname(__file__), '..', 'dictionaries') # <<<<<<<<<<<<<< * self._hunspell_dir = os.path.abspath(hunspell_data_dir) - * + * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -3078,14 +3040,14 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } } if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -3094,20 +3056,20 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -3128,7 +3090,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s__3, __pyx_n_s_dictionaries}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -3137,14 +3099,14 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s__3, __pyx_n_s_dictionaries}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -3158,16 +3120,16 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __Pyx_GIVEREF(__pyx_n_s_dictionaries); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_10, __pyx_n_s_dictionaries); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 125, __pyx_L1_error) + if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_hunspell_data_dir, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":124 + /* "hunspell/hunspell.pyx":123 * if hunspell_data_dir is None: * hunspell_data_dir = os.environ.get("HUNSPELL_DATA") * if hunspell_data_dir is None: # <<<<<<<<<<<<<< @@ -3176,19 +3138,19 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj */ } - /* "hunspell/hunspell.pyx":126 + /* "hunspell/hunspell.pyx":125 * if hunspell_data_dir is None: * hunspell_data_dir = os.path.join(os.path.dirname(__file__), '..', 'dictionaries') * self._hunspell_dir = os.path.abspath(hunspell_data_dir) # <<<<<<<<<<<<<< - * + * * self.lang = lang */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_abspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_abspath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -3202,13 +3164,13 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } } if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hunspell_data_dir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hunspell_data_dir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_hunspell_data_dir}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -3216,34 +3178,34 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_hunspell_data_dir}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_hunspell_data_dir); __Pyx_GIVEREF(__pyx_v_hunspell_data_dir); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_hunspell_data_dir); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 126, __pyx_L1_error) + if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_hunspell_dir); __Pyx_DECREF(__pyx_v_self->_hunspell_dir); __pyx_v_self->_hunspell_dir = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":128 + /* "hunspell/hunspell.pyx":127 * self._hunspell_dir = os.path.abspath(hunspell_data_dir) - * + * * self.lang = lang # <<<<<<<<<<<<<< * self._cxx_hunspell = self._create_hspell_inst(lang) * self._dic_encoding = valid_encoding(c_string_to_unicode_no_except(self._cxx_hunspell.get_dic_encoding())) @@ -3254,26 +3216,26 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->lang); __pyx_v_self->lang = __pyx_v_lang; - /* "hunspell/hunspell.pyx":129 - * + /* "hunspell/hunspell.pyx":128 + * * self.lang = lang * self._cxx_hunspell = self._create_hspell_inst(lang) # <<<<<<<<<<<<<< * self._dic_encoding = valid_encoding(c_string_to_unicode_no_except(self._cxx_hunspell.get_dic_encoding())) * self.max_threads = detect_cpus() */ - __pyx_t_11 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_create_hspell_inst(__pyx_v_self, __pyx_v_lang); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_11 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_create_hspell_inst(__pyx_v_self, __pyx_v_lang); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_v_self->_cxx_hunspell = __pyx_t_11; - /* "hunspell/hunspell.pyx":130 + /* "hunspell/hunspell.pyx":129 * self.lang = lang * self._cxx_hunspell = self._create_hspell_inst(lang) * self._dic_encoding = valid_encoding(c_string_to_unicode_no_except(self._cxx_hunspell.get_dic_encoding())) # <<<<<<<<<<<<<< * self.max_threads = detect_cpus() - * + * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_valid_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_valid_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(__pyx_v_self->_cxx_hunspell->get_dic_encoding(), NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_5 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(__pyx_v_self->_cxx_hunspell->get_dic_encoding(), NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3286,14 +3248,14 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } } if (!__pyx_t_9) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -3302,40 +3264,40 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 130, __pyx_L1_error) + if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_dic_encoding); __Pyx_DECREF(__pyx_v_self->_dic_encoding); __pyx_v_self->_dic_encoding = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":131 + /* "hunspell/hunspell.pyx":130 * self._cxx_hunspell = self._create_hspell_inst(lang) * self._dic_encoding = valid_encoding(c_string_to_unicode_no_except(self._cxx_hunspell.get_dic_encoding())) * self.max_threads = detect_cpus() # <<<<<<<<<<<<<< - * + * * self._cache_manager_name = cache_manager */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_detect_cpus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_detect_cpus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3348,20 +3310,20 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } } if (__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->max_threads = __pyx_t_10; - /* "hunspell/hunspell.pyx":133 + /* "hunspell/hunspell.pyx":132 * self.max_threads = detect_cpus() - * + * * self._cache_manager_name = cache_manager # <<<<<<<<<<<<<< * manager = get_cache_manager(self._cache_manager_name) * if disk_cache_dir: @@ -3372,14 +3334,14 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __Pyx_DECREF(__pyx_v_self->_cache_manager_name); __pyx_v_self->_cache_manager_name = __pyx_v_cache_manager; - /* "hunspell/hunspell.pyx":134 - * + /* "hunspell/hunspell.pyx":133 + * * self._cache_manager_name = cache_manager * manager = get_cache_manager(self._cache_manager_name) # <<<<<<<<<<<<<< * if disk_cache_dir: * manager.cache_directory = disk_cache_dir */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_cache_manager); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_cache_manager); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3392,13 +3354,13 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } } if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_cache_manager_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_cache_manager_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_self->_cache_manager_name}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -3406,19 +3368,19 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_self->_cache_manager_name}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_self->_cache_manager_name); __Pyx_GIVEREF(__pyx_v_self->_cache_manager_name); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->_cache_manager_name); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -3427,26 +3389,26 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_v_manager = __pyx_t_4; __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":135 + /* "hunspell/hunspell.pyx":134 * self._cache_manager_name = cache_manager * manager = get_cache_manager(self._cache_manager_name) * if disk_cache_dir: # <<<<<<<<<<<<<< * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 134, __pyx_L1_error) if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":136 + /* "hunspell/hunspell.pyx":135 * manager = get_cache_manager(self._cache_manager_name) * if disk_cache_dir: * manager.cache_directory = disk_cache_dir # <<<<<<<<<<<<<< * if not manager.cache_registered("hunspell_suggest"): * if disk_cache_dir: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_manager, __pyx_n_s_cache_directory, __pyx_v_disk_cache_dir) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_manager, __pyx_n_s_cache_directory, __pyx_v_disk_cache_dir) < 0) __PYX_ERR(0, 135, __pyx_L1_error) - /* "hunspell/hunspell.pyx":135 + /* "hunspell/hunspell.pyx":134 * self._cache_manager_name = cache_manager * manager = get_cache_manager(self._cache_manager_name) * if disk_cache_dir: # <<<<<<<<<<<<<< @@ -3455,56 +3417,56 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj */ } - /* "hunspell/hunspell.pyx":137 + /* "hunspell/hunspell.pyx":136 * if disk_cache_dir: * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): # <<<<<<<<<<<<<< * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_cache_registered); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_cache_registered); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { - /* "hunspell/hunspell.pyx":138 + /* "hunspell/hunspell.pyx":137 * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): * if disk_cache_dir: # <<<<<<<<<<<<<< * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 137, __pyx_L1_error) if (__pyx_t_2) { - /* "hunspell/hunspell.pyx":139 + /* "hunspell/hunspell.pyx":138 * if not manager.cache_registered("hunspell_suggest"): * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] # <<<<<<<<<<<<<< * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) * else: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); @@ -3518,26 +3480,26 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_v_custom_time_checks = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "hunspell/hunspell.pyx":140 + /* "hunspell/hunspell.pyx":139 * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) # <<<<<<<<<<<<<< * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AutoSyncCache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AutoSyncCache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 140, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_time_checks, __pyx_v_custom_time_checks) < 0) __PYX_ERR(0, 140, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_time_checks, __pyx_v_custom_time_checks) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":138 + /* "hunspell/hunspell.pyx":137 * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): * if disk_cache_dir: # <<<<<<<<<<<<<< @@ -3547,7 +3509,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj goto __pyx_L7; } - /* "hunspell/hunspell.pyx":142 + /* "hunspell/hunspell.pyx":141 * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) # <<<<<<<<<<<<<< @@ -3555,12 +3517,12 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj * if disk_cache_dir: */ /*else*/ { - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NonPersistentCache); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NonPersistentCache); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 142, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__9, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__9, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -3568,7 +3530,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } __pyx_L7:; - /* "hunspell/hunspell.pyx":137 + /* "hunspell/hunspell.pyx":136 * if disk_cache_dir: * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): # <<<<<<<<<<<<<< @@ -3577,56 +3539,56 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj */ } - /* "hunspell/hunspell.pyx":143 + /* "hunspell/hunspell.pyx":142 * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) * if not manager.cache_registered("hunspell_stem"): # <<<<<<<<<<<<<< * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_cache_registered); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_cache_registered); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":144 + /* "hunspell/hunspell.pyx":143 * NonPersistentCache("hunspell_suggest", cache_manager=manager) * if not manager.cache_registered("hunspell_stem"): * if disk_cache_dir: # <<<<<<<<<<<<<< * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disk_cache_dir); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 143, __pyx_L1_error) if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":145 + /* "hunspell/hunspell.pyx":144 * if not manager.cache_registered("hunspell_stem"): * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] # <<<<<<<<<<<<<< * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) * else: */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_TimeCount); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); @@ -3640,26 +3602,26 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __Pyx_XDECREF_SET(__pyx_v_custom_time_checks, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; - /* "hunspell/hunspell.pyx":146 + /* "hunspell/hunspell.pyx":145 * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) # <<<<<<<<<<<<<< * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AutoSyncCache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_AutoSyncCache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_time_checks, __pyx_v_custom_time_checks) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__14, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_time_checks, __pyx_v_custom_time_checks) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__14, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":144 + /* "hunspell/hunspell.pyx":143 * NonPersistentCache("hunspell_suggest", cache_manager=manager) * if not manager.cache_registered("hunspell_stem"): * if disk_cache_dir: # <<<<<<<<<<<<<< @@ -3669,7 +3631,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj goto __pyx_L9; } - /* "hunspell/hunspell.pyx":148 + /* "hunspell/hunspell.pyx":147 * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) # <<<<<<<<<<<<<< @@ -3677,12 +3639,12 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj * self._stem_cache = manager.retrieve_cache("hunspell_stem") */ /*else*/ { - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NonPersistentCache); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_NonPersistentCache); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cache_manager, __pyx_v_manager) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3690,7 +3652,7 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj } __pyx_L9:; - /* "hunspell/hunspell.pyx":143 + /* "hunspell/hunspell.pyx":142 * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) * if not manager.cache_registered("hunspell_stem"): # <<<<<<<<<<<<<< @@ -3699,16 +3661,16 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj */ } - /* "hunspell/hunspell.pyx":149 + /* "hunspell/hunspell.pyx":148 * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) * self._suggest_cache = manager.retrieve_cache("hunspell_suggest") # <<<<<<<<<<<<<< * self._stem_cache = manager.retrieve_cache("hunspell_stem") - * + * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_retrieve_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_retrieve_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_4); @@ -3717,16 +3679,16 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_v_self->_suggest_cache = __pyx_t_4; __pyx_t_4 = 0; - /* "hunspell/hunspell.pyx":150 + /* "hunspell/hunspell.pyx":149 * NonPersistentCache("hunspell_stem", cache_manager=manager) * self._suggest_cache = manager.retrieve_cache("hunspell_suggest") * self._stem_cache = manager.retrieve_cache("hunspell_stem") # <<<<<<<<<<<<<< - * + * * def __dealloc__(self): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_retrieve_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_retrieve_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_6); @@ -3735,9 +3697,9 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj __pyx_v_self->_stem_cache = __pyx_t_6; __pyx_t_6 = 0; - /* "hunspell/hunspell.pyx":119 + /* "hunspell/hunspell.pyx":118 * return holder - * + * * def __init__(self, basestring lang='en_US', basestring cache_manager="hunspell", # <<<<<<<<<<<<<< * basestring disk_cache_dir=None, basestring hunspell_data_dir=None): * # TODO - make these LRU caches so that you don't destroy your memory! @@ -3764,9 +3726,9 @@ static int __pyx_pf_8hunspell_8hunspell_12HunspellWrap___init__(struct __pyx_obj return __pyx_r; } -/* "hunspell/hunspell.pyx":152 +/* "hunspell/hunspell.pyx":151 * self._stem_cache = manager.retrieve_cache("hunspell_stem") - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * del self._cxx_hunspell * free(self.affpath) @@ -3787,8 +3749,8 @@ static void __pyx_pf_8hunspell_8hunspell_12HunspellWrap_2__dealloc__(struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "hunspell/hunspell.pyx":153 - * + /* "hunspell/hunspell.pyx":152 + * * def __dealloc__(self): * del self._cxx_hunspell # <<<<<<<<<<<<<< * free(self.affpath) @@ -3796,27 +3758,27 @@ static void __pyx_pf_8hunspell_8hunspell_12HunspellWrap_2__dealloc__(struct __py */ delete __pyx_v_self->_cxx_hunspell; - /* "hunspell/hunspell.pyx":154 + /* "hunspell/hunspell.pyx":153 * def __dealloc__(self): * del self._cxx_hunspell * free(self.affpath) # <<<<<<<<<<<<<< * free(self.dpath) - * + * */ free(__pyx_v_self->affpath); - /* "hunspell/hunspell.pyx":155 + /* "hunspell/hunspell.pyx":154 * del self._cxx_hunspell * free(self.affpath) * free(self.dpath) # <<<<<<<<<<<<<< - * + * * def spell(self, basestring word): */ free(__pyx_v_self->dpath); - /* "hunspell/hunspell.pyx":152 + /* "hunspell/hunspell.pyx":151 * self._stem_cache = manager.retrieve_cache("hunspell_stem") - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * del self._cxx_hunspell * free(self.affpath) @@ -3826,9 +3788,9 @@ static void __pyx_pf_8hunspell_8hunspell_12HunspellWrap_2__dealloc__(struct __py __Pyx_RefNannyFinishContext(); } -/* "hunspell/hunspell.pyx":157 +/* "hunspell/hunspell.pyx":156 * free(self.dpath) - * + * * def spell(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word spellcheck * cdef char *c_word = NULL @@ -3840,7 +3802,7 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_5spell(PyObject *__ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("spell (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 157, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap_4spell(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), ((PyObject*)__pyx_v_word)); /* function exit code */ @@ -3860,137 +3822,116 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_4spell(struct __pyx int __pyx_t_2; struct __pyx_opt_args_8hunspell_8hunspell_copy_to_c_string __pyx_t_3; int __pyx_t_4; - int __pyx_t_5; - char const *__pyx_t_6; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("spell", 0); - /* "hunspell/hunspell.pyx":159 + /* "hunspell/hunspell.pyx":158 * def spell(self, basestring word): * # Python individual word spellcheck * cdef char *c_word = NULL # <<<<<<<<<<<<<< - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - * raise MemoryError() + * copy_to_c_string(word, &c_word, self._dic_encoding) + * try: */ __pyx_v_c_word = NULL; - /* "hunspell/hunspell.pyx":160 + /* "hunspell/hunspell.pyx":159 * # Python individual word spellcheck * cdef char *c_word = NULL - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() + * copy_to_c_string(word, &c_word, self._dic_encoding) # <<<<<<<<<<<<<< * try: + * return self._cxx_hunspell.spell(c_word) != 0 */ __pyx_t_1 = __pyx_v_self->_dic_encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_3.__pyx_n = 1; __pyx_t_3.encoding = ((PyObject*)__pyx_t_1); - __pyx_t_2 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(__pyx_v_word, (&__pyx_v_c_word), &__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(__pyx_v_word, (&__pyx_v_c_word), &__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = ((__pyx_t_2 <= 0) != 0); - if (__pyx_t_4) { - - /* "hunspell/hunspell.pyx":161 - * cdef char *c_word = NULL - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - * raise MemoryError() # <<<<<<<<<<<<<< - * try: - * return self._cxx_hunspell.spell(c_word) != 0 - */ - PyErr_NoMemory(); __PYX_ERR(0, 161, __pyx_L1_error) - /* "hunspell/hunspell.pyx":160 - * # Python individual word spellcheck + /* "hunspell/hunspell.pyx":160 * cdef char *c_word = NULL - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * try: - */ - } - - /* "hunspell/hunspell.pyx":162 - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - * raise MemoryError() + * copy_to_c_string(word, &c_word, self._dic_encoding) * try: # <<<<<<<<<<<<<< * return self._cxx_hunspell.spell(c_word) != 0 * finally: */ /*try:*/ { - /* "hunspell/hunspell.pyx":163 - * raise MemoryError() + /* "hunspell/hunspell.pyx":161 + * copy_to_c_string(word, &c_word, self._dic_encoding) * try: * return self._cxx_hunspell.spell(c_word) != 0 # <<<<<<<<<<<<<< * finally: * free(c_word) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->_cxx_hunspell->spell(__pyx_v_c_word, NULL) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->_cxx_hunspell->spell(__pyx_v_c_word, NULL) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - goto __pyx_L4_return; + goto __pyx_L3_return; } - /* "hunspell/hunspell.pyx":165 + /* "hunspell/hunspell.pyx":163 * return self._cxx_hunspell.spell(c_word) != 0 * finally: * free(c_word) # <<<<<<<<<<<<<< - * + * * def suggest(self, basestring word): */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare - __pyx_L5_error:; - __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_L4_error:; + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); - __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + __pyx_t_2 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { free(__pyx_v_c_word); } __Pyx_PyThreadState_assign if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_XGIVEREF(__pyx_t_12); - __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } + __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_XGIVEREF(__pyx_t_9); - __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); - __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; - __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } - __pyx_L4_return: { - __pyx_t_12 = __pyx_r; + __pyx_L3_return: { + __pyx_t_11 = __pyx_r; __pyx_r = 0; free(__pyx_v_c_word); - __pyx_r = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; goto __pyx_L0; } } - /* "hunspell/hunspell.pyx":157 + /* "hunspell/hunspell.pyx":156 * free(self.dpath) - * + * * def spell(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word spellcheck * cdef char *c_word = NULL @@ -4007,9 +3948,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_4spell(struct __pyx return __pyx_r; } -/* "hunspell/hunspell.pyx":167 +/* "hunspell/hunspell.pyx":165 * free(c_word) - * + * * def suggest(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word suggestions * return self.action('suggest', word) @@ -4021,7 +3962,7 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_7suggest(PyObject * PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("suggest (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 167, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), ((PyObject*)__pyx_v_word)); /* function exit code */ @@ -4043,15 +3984,15 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("suggest", 0); - /* "hunspell/hunspell.pyx":169 + /* "hunspell/hunspell.pyx":167 * def suggest(self, basestring word): * # Python individual word suggestions * return self.action('suggest', word) # <<<<<<<<<<<<<< - * + * * def stem(self, basestring word): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -4068,7 +4009,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_suggest, __pyx_v_word}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4076,13 +4017,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_suggest, __pyx_v_word}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -4093,7 +4034,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p __Pyx_INCREF(__pyx_v_word); __Pyx_GIVEREF(__pyx_v_word); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_word); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -4102,9 +4043,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p __pyx_t_1 = 0; goto __pyx_L0; - /* "hunspell/hunspell.pyx":167 + /* "hunspell/hunspell.pyx":165 * free(c_word) - * + * * def suggest(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word suggestions * return self.action('suggest', word) @@ -4124,9 +4065,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_6suggest(struct __p return __pyx_r; } -/* "hunspell/hunspell.pyx":171 +/* "hunspell/hunspell.pyx":169 * return self.action('suggest', word) - * + * * def stem(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word stemming * return self.action('stem', word) @@ -4138,7 +4079,7 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_9stem(PyObject *__p PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stem (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 171, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 169, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), ((PyObject*)__pyx_v_word)); /* function exit code */ @@ -4160,15 +4101,15 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("stem", 0); - /* "hunspell/hunspell.pyx":173 + /* "hunspell/hunspell.pyx":171 * def stem(self, basestring word): * # Python individual word stemming * return self.action('stem', word) # <<<<<<<<<<<<<< - * + * * def action(self, basestring action, basestring word): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -4185,7 +4126,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_stem, __pyx_v_word}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4193,13 +4134,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_stem, __pyx_v_word}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -4210,7 +4151,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ __Pyx_INCREF(__pyx_v_word); __Pyx_GIVEREF(__pyx_v_word); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_word); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -4219,9 +4160,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ __pyx_t_1 = 0; goto __pyx_L0; - /* "hunspell/hunspell.pyx":171 + /* "hunspell/hunspell.pyx":169 * return self.action('suggest', word) - * + * * def stem(self, basestring word): # <<<<<<<<<<<<<< * # Python individual word stemming * return self.action('stem', word) @@ -4241,9 +4182,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_8stem(struct __pyx_ return __pyx_r; } -/* "hunspell/hunspell.pyx":175 +/* "hunspell/hunspell.pyx":173 * return self.action('stem', word) - * + * * def action(self, basestring action, basestring word): # <<<<<<<<<<<<<< * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache @@ -4277,11 +4218,11 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_11action(PyObject * case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_word)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("action", 1, 2, 2, 1); __PYX_ERR(0, 175, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("action", 1, 2, 2, 1); __PYX_ERR(0, 173, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "action") < 0)) __PYX_ERR(0, 175, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "action") < 0)) __PYX_ERR(0, 173, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4294,14 +4235,14 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_11action(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("action", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 175, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("action", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 173, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("hunspell.hunspell.HunspellWrap.action", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_action), (&PyBaseString_Type), 1, "action", 1))) __PYX_ERR(0, 175, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_action), (&PyBaseString_Type), 1, "action", 1))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_word), (&PyBaseString_Type), 1, "word", 1))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), __pyx_v_action, __pyx_v_word); /* function exit code */ @@ -4343,17 +4284,17 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p char const *__pyx_t_17; __Pyx_RefNannySetupContext("action", 0); - /* "hunspell/hunspell.pyx":176 - * + /* "hunspell/hunspell.pyx":174 + * * def action(self, basestring action, basestring word): * cdef bint stem_action = (action == 'stem') # <<<<<<<<<<<<<< * cache = self._stem_cache if stem_action else self._suggest_cache * if word in cache: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_action, __pyx_n_s_stem, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_action, __pyx_n_s_stem, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 174, __pyx_L1_error) __pyx_v_stem_action = __pyx_t_1; - /* "hunspell/hunspell.pyx":177 + /* "hunspell/hunspell.pyx":175 * def action(self, basestring action, basestring word): * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache # <<<<<<<<<<<<<< @@ -4370,51 +4311,51 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p __pyx_v_cache = __pyx_t_2; __pyx_t_2 = 0; - /* "hunspell/hunspell.pyx":178 + /* "hunspell/hunspell.pyx":176 * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache * if word in cache: # <<<<<<<<<<<<<< * return cache[word] - * + * */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_word, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_word, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":179 + /* "hunspell/hunspell.pyx":177 * cache = self._stem_cache if stem_action else self._suggest_cache * if word in cache: * return cache[word] # <<<<<<<<<<<<<< - * + * * cdef char **s_list = NULL */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetItem(__pyx_v_cache, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_2 = PyObject_GetItem(__pyx_v_cache, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "hunspell/hunspell.pyx":178 + /* "hunspell/hunspell.pyx":176 * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache * if word in cache: # <<<<<<<<<<<<<< * return cache[word] - * + * */ } - /* "hunspell/hunspell.pyx":181 + /* "hunspell/hunspell.pyx":179 * return cache[word] - * + * * cdef char **s_list = NULL # <<<<<<<<<<<<<< * cdef char *c_word = NULL * cdef list stem_list */ __pyx_v_s_list = NULL; - /* "hunspell/hunspell.pyx":182 - * + /* "hunspell/hunspell.pyx":180 + * * cdef char **s_list = NULL * cdef char *c_word = NULL # <<<<<<<<<<<<<< * cdef list stem_list @@ -4422,51 +4363,31 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p */ __pyx_v_c_word = NULL; - /* "hunspell/hunspell.pyx":185 + /* "hunspell/hunspell.pyx":183 * cdef list stem_list * cdef tuple stem_result - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * + * copy_to_c_string(word, &c_word, self._dic_encoding) # <<<<<<<<<<<<<< + * + * try: */ __pyx_t_2 = __pyx_v_self->_dic_encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_5.__pyx_n = 1; __pyx_t_5.encoding = ((PyObject*)__pyx_t_2); - __pyx_t_4 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(__pyx_v_word, (&__pyx_v_c_word), &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(__pyx_v_word, (&__pyx_v_c_word), &__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = ((__pyx_t_4 <= 0) != 0); - if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":186 - * cdef tuple stem_result - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - * raise MemoryError() # <<<<<<<<<<<<<< - * - * try: - */ - PyErr_NoMemory(); __PYX_ERR(0, 186, __pyx_L1_error) - - /* "hunspell/hunspell.pyx":185 - * cdef list stem_list - * cdef tuple stem_result - * if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ - } - - /* "hunspell/hunspell.pyx":188 - * raise MemoryError() - * + /* "hunspell/hunspell.pyx":185 + * copy_to_c_string(word, &c_word, self._dic_encoding) + * * try: # <<<<<<<<<<<<<< * if stem_action: * count = self._cxx_hunspell.stem(&s_list, c_word) */ /*try:*/ { - /* "hunspell/hunspell.pyx":189 - * + /* "hunspell/hunspell.pyx":186 + * * try: * if stem_action: # <<<<<<<<<<<<<< * count = self._cxx_hunspell.stem(&s_list, c_word) @@ -4475,7 +4396,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p __pyx_t_3 = (__pyx_v_stem_action != 0); if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":190 + /* "hunspell/hunspell.pyx":187 * try: * if stem_action: * count = self._cxx_hunspell.stem(&s_list, c_word) # <<<<<<<<<<<<<< @@ -4484,99 +4405,99 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p */ __pyx_v_count = __pyx_v_self->_cxx_hunspell->stem((&__pyx_v_s_list), __pyx_v_c_word); - /* "hunspell/hunspell.pyx":189 - * + /* "hunspell/hunspell.pyx":186 + * * try: * if stem_action: # <<<<<<<<<<<<<< * count = self._cxx_hunspell.stem(&s_list, c_word) * else: */ - goto __pyx_L8; + goto __pyx_L7; } - /* "hunspell/hunspell.pyx":192 + /* "hunspell/hunspell.pyx":189 * count = self._cxx_hunspell.stem(&s_list, c_word) * else: * count = self._cxx_hunspell.suggest(&s_list, c_word) # <<<<<<<<<<<<<< - * + * * try: */ /*else*/ { __pyx_v_count = __pyx_v_self->_cxx_hunspell->suggest((&__pyx_v_s_list), __pyx_v_c_word); } - __pyx_L8:; + __pyx_L7:; - /* "hunspell/hunspell.pyx":194 + /* "hunspell/hunspell.pyx":191 * count = self._cxx_hunspell.suggest(&s_list, c_word) - * + * * try: # <<<<<<<<<<<<<< * stem_list = [] * for i from 0 <= i < count: */ /*try:*/ { - /* "hunspell/hunspell.pyx":195 - * + /* "hunspell/hunspell.pyx":192 + * * try: * stem_list = [] # <<<<<<<<<<<<<< * for i from 0 <= i < count: * stem_list.append(c_string_to_unicode_no_except(s_list[i], self._dic_encoding)) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_stem_list = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "hunspell/hunspell.pyx":196 + /* "hunspell/hunspell.pyx":193 * try: * stem_list = [] * for i from 0 <= i < count: # <<<<<<<<<<<<<< * stem_list.append(c_string_to_unicode_no_except(s_list[i], self._dic_encoding)) - * + * */ __pyx_t_4 = __pyx_v_count; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":197 + /* "hunspell/hunspell.pyx":194 * stem_list = [] * for i from 0 <= i < count: * stem_list.append(c_string_to_unicode_no_except(s_list[i], self._dic_encoding)) # <<<<<<<<<<<<<< - * + * * stem_result = tuple(stem_list) */ __pyx_t_2 = __pyx_v_self->_dic_encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_7.__pyx_n = 1; __pyx_t_7.encoding = ((PyObject*)__pyx_t_2); - __pyx_t_6 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except((__pyx_v_s_list[__pyx_v_i]), &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L10_error) + __pyx_t_6 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except((__pyx_v_s_list[__pyx_v_i]), &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_stem_list, __pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 197, __pyx_L10_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_stem_list, __pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 194, __pyx_L9_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "hunspell/hunspell.pyx":199 + /* "hunspell/hunspell.pyx":196 * stem_list.append(c_string_to_unicode_no_except(s_list[i], self._dic_encoding)) - * + * * stem_result = tuple(stem_list) # <<<<<<<<<<<<<< * cache[word] = stem_result * return stem_result */ - __pyx_t_6 = PyList_AsTuple(__pyx_v_stem_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L10_error) + __pyx_t_6 = PyList_AsTuple(__pyx_v_stem_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_stem_result = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "hunspell/hunspell.pyx":200 - * + /* "hunspell/hunspell.pyx":197 + * * stem_result = tuple(stem_list) * cache[word] = stem_result # <<<<<<<<<<<<<< * return stem_result * finally: */ - if (unlikely(PyObject_SetItem(__pyx_v_cache, __pyx_v_word, __pyx_v_stem_result) < 0)) __PYX_ERR(0, 200, __pyx_L10_error) + if (unlikely(PyObject_SetItem(__pyx_v_cache, __pyx_v_word, __pyx_v_stem_result) < 0)) __PYX_ERR(0, 197, __pyx_L9_error) - /* "hunspell/hunspell.pyx":201 + /* "hunspell/hunspell.pyx":198 * stem_result = tuple(stem_list) * cache[word] = stem_result * return stem_result # <<<<<<<<<<<<<< @@ -4586,10 +4507,10 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_stem_result); __pyx_r = __pyx_v_stem_result; - goto __pyx_L9_return; + goto __pyx_L8_return; } - /* "hunspell/hunspell.pyx":203 + /* "hunspell/hunspell.pyx":200 * return stem_result * finally: * self._cxx_hunspell.free_list(&s_list, count) # <<<<<<<<<<<<<< @@ -4599,7 +4520,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare - __pyx_L10_error:; + __pyx_L9_error:; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4629,30 +4550,30 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; - goto __pyx_L6_error; + goto __pyx_L5_error; } - __pyx_L9_return: { + __pyx_L8_return: { __pyx_t_16 = __pyx_r; __pyx_r = 0; __pyx_v_self->_cxx_hunspell->free_list((&__pyx_v_s_list), __pyx_v_count); __pyx_r = __pyx_t_16; __pyx_t_16 = 0; - goto __pyx_L5_return; + goto __pyx_L4_return; } } } - /* "hunspell/hunspell.pyx":205 + /* "hunspell/hunspell.pyx":202 * self._cxx_hunspell.free_list(&s_list, count) * finally: * free(c_word) # <<<<<<<<<<<<<< - * + * * def bulk_suggest(self, words): */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare - __pyx_L6_error:; + __pyx_L5_error:; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4684,7 +4605,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_17; goto __pyx_L1_error; } - __pyx_L5_return: { + __pyx_L4_return: { __pyx_t_11 = __pyx_r; __pyx_r = 0; free(__pyx_v_c_word); @@ -4694,9 +4615,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p } } - /* "hunspell/hunspell.pyx":175 + /* "hunspell/hunspell.pyx":173 * return self.action('stem', word) - * + * * def action(self, basestring action, basestring word): # <<<<<<<<<<<<<< * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache @@ -4717,12 +4638,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_10action(struct __p return __pyx_r; } -/* "hunspell/hunspell.pyx":207 +/* "hunspell/hunspell.pyx":204 * free(c_word) - * + * * def bulk_suggest(self, words): # <<<<<<<<<<<<<< * return self.bulk_action('suggest', words) - * + * */ /* Python wrapper */ @@ -4748,15 +4669,15 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("bulk_suggest", 0); - /* "hunspell/hunspell.pyx":208 - * + /* "hunspell/hunspell.pyx":205 + * * def bulk_suggest(self, words): * return self.bulk_action('suggest', words) # <<<<<<<<<<<<<< - * + * * def bulk_stem(self, words): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bulk_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bulk_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -4773,7 +4694,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_suggest, __pyx_v_words}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4781,13 +4702,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_suggest, __pyx_v_words}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -4798,7 +4719,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru __Pyx_INCREF(__pyx_v_words); __Pyx_GIVEREF(__pyx_v_words); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_words); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -4807,12 +4728,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru __pyx_t_1 = 0; goto __pyx_L0; - /* "hunspell/hunspell.pyx":207 + /* "hunspell/hunspell.pyx":204 * free(c_word) - * + * * def bulk_suggest(self, words): # <<<<<<<<<<<<<< * return self.bulk_action('suggest', words) - * + * */ /* function exit code */ @@ -4829,12 +4750,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_12bulk_suggest(stru return __pyx_r; } -/* "hunspell/hunspell.pyx":210 +/* "hunspell/hunspell.pyx":207 * return self.bulk_action('suggest', words) - * + * * def bulk_stem(self, words): # <<<<<<<<<<<<<< * return self.bulk_action('stem', words) - * + * */ /* Python wrapper */ @@ -4860,15 +4781,15 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("bulk_stem", 0); - /* "hunspell/hunspell.pyx":211 - * + /* "hunspell/hunspell.pyx":208 + * * def bulk_stem(self, words): * return self.bulk_action('stem', words) # <<<<<<<<<<<<<< - * + * * def bulk_action(self, basestring action, words): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bulk_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bulk_action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -4885,7 +4806,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_stem, __pyx_v_words}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -4893,13 +4814,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_stem, __pyx_v_words}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -4910,7 +4831,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct __Pyx_INCREF(__pyx_v_words); __Pyx_GIVEREF(__pyx_v_words); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_words); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -4919,12 +4840,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "hunspell/hunspell.pyx":210 + /* "hunspell/hunspell.pyx":207 * return self.bulk_action('suggest', words) - * + * * def bulk_stem(self, words): # <<<<<<<<<<<<<< * return self.bulk_action('stem', words) - * + * */ /* function exit code */ @@ -4941,9 +4862,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_14bulk_stem(struct return __pyx_r; } -/* "hunspell/hunspell.pyx":213 +/* "hunspell/hunspell.pyx":210 * return self.bulk_action('stem', words) - * + * * def bulk_action(self, basestring action, words): # <<<<<<<<<<<<<< * '''Accepts a list of words, returns a dict of words mapped to a list * # of their hunspell suggestions''' @@ -4978,11 +4899,11 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_17bulk_action(PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_words)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("bulk_action", 1, 2, 2, 1); __PYX_ERR(0, 213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bulk_action", 1, 2, 2, 1); __PYX_ERR(0, 210, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bulk_action") < 0)) __PYX_ERR(0, 213, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bulk_action") < 0)) __PYX_ERR(0, 210, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -4995,13 +4916,13 @@ static PyObject *__pyx_pw_8hunspell_8hunspell_12HunspellWrap_17bulk_action(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("bulk_action", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("bulk_action", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("hunspell.hunspell.HunspellWrap.bulk_action", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_action), (&PyBaseString_Type), 1, "action", 1))) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_action), (&PyBaseString_Type), 1, "action", 1))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_r = __pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(((struct __pyx_obj_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self), __pyx_v_action, __pyx_v_words); /* function exit code */ @@ -5033,45 +4954,45 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc int __pyx_t_10; __Pyx_RefNannySetupContext("bulk_action", 0); - /* "hunspell/hunspell.pyx":216 + /* "hunspell/hunspell.pyx":213 * '''Accepts a list of words, returns a dict of words mapped to a list * # of their hunspell suggestions''' * cdef dict ret_dict = {} # <<<<<<<<<<<<<< * cdef list unknown_words = [] * cdef bint stem_action = (action == 'stem') */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret_dict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "hunspell/hunspell.pyx":217 + /* "hunspell/hunspell.pyx":214 * # of their hunspell suggestions''' * cdef dict ret_dict = {} * cdef list unknown_words = [] # <<<<<<<<<<<<<< * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_unknown_words = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "hunspell/hunspell.pyx":218 + /* "hunspell/hunspell.pyx":215 * cdef dict ret_dict = {} * cdef list unknown_words = [] * cdef bint stem_action = (action == 'stem') # <<<<<<<<<<<<<< * cache = self._stem_cache if stem_action else self._suggest_cache - * + * */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_action, __pyx_n_s_stem, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_action, __pyx_n_s_stem, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_v_stem_action = __pyx_t_2; - /* "hunspell/hunspell.pyx":219 + /* "hunspell/hunspell.pyx":216 * cdef list unknown_words = [] * cdef bint stem_action = (action == 'stem') * cache = self._stem_cache if stem_action else self._suggest_cache # <<<<<<<<<<<<<< - * + * * for word in words: */ if ((__pyx_v_stem_action != 0)) { @@ -5084,9 +5005,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc __pyx_v_cache = __pyx_t_1; __pyx_t_1 = 0; - /* "hunspell/hunspell.pyx":221 + /* "hunspell/hunspell.pyx":218 * cache = self._stem_cache if stem_action else self._suggest_cache - * + * * for word in words: # <<<<<<<<<<<<<< * if not stem_action and self.spell(word): * # No need to check correctly spelled words @@ -5095,26 +5016,26 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc __pyx_t_1 = __pyx_v_words; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 218, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 218, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -5124,7 +5045,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 221, __pyx_L1_error) + else __PYX_ERR(0, 218, __pyx_L1_error) } break; } @@ -5133,8 +5054,8 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":222 - * + /* "hunspell/hunspell.pyx":219 + * * for word in words: * if not stem_action and self.spell(word): # <<<<<<<<<<<<<< * # No need to check correctly spelled words @@ -5146,7 +5067,7 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc __pyx_t_2 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spell); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spell); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -5159,13 +5080,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc } } if (!__pyx_t_8) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_word}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); } else @@ -5173,47 +5094,47 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_word}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_word); __Pyx_GIVEREF(__pyx_v_word); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_word); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { - /* "hunspell/hunspell.pyx":224 + /* "hunspell/hunspell.pyx":221 * if not stem_action and self.spell(word): * # No need to check correctly spelled words * ret_dict[word] = (word,) # <<<<<<<<<<<<<< * elif word in cache: * ret_dict[word] = cache[word] */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_word); __Pyx_GIVEREF(__pyx_v_word); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_word); - if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":222 - * + /* "hunspell/hunspell.pyx":219 + * * for word in words: * if not stem_action and self.spell(word): # <<<<<<<<<<<<<< * # No need to check correctly spelled words @@ -5222,30 +5143,30 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc goto __pyx_L5; } - /* "hunspell/hunspell.pyx":225 + /* "hunspell/hunspell.pyx":222 * # No need to check correctly spelled words * ret_dict[word] = (word,) * elif word in cache: # <<<<<<<<<<<<<< * ret_dict[word] = cache[word] * else: */ - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_word, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_word, __pyx_v_cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 222, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { - /* "hunspell/hunspell.pyx":226 + /* "hunspell/hunspell.pyx":223 * ret_dict[word] = (word,) * elif word in cache: * ret_dict[word] = cache[word] # <<<<<<<<<<<<<< * else: * # This will turn into a tuple when completed */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_cache, __pyx_v_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_5 = PyObject_GetItem(__pyx_v_cache, __pyx_v_word); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":225 + /* "hunspell/hunspell.pyx":222 * # No need to check correctly spelled words * ret_dict[word] = (word,) * elif word in cache: # <<<<<<<<<<<<<< @@ -5255,33 +5176,33 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc goto __pyx_L5; } - /* "hunspell/hunspell.pyx":229 + /* "hunspell/hunspell.pyx":226 * else: * # This will turn into a tuple when completed * ret_dict[word] = [] # <<<<<<<<<<<<<< * unknown_words.append(word) - * + * */ /*else*/ { - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_v_word, __pyx_t_5) < 0)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "hunspell/hunspell.pyx":230 + /* "hunspell/hunspell.pyx":227 * # This will turn into a tuple when completed * ret_dict[word] = [] * unknown_words.append(word) # <<<<<<<<<<<<<< - * + * * if unknown_words: */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_unknown_words, __pyx_v_word); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_unknown_words, __pyx_v_word); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 227, __pyx_L1_error) } __pyx_L5:; - /* "hunspell/hunspell.pyx":221 + /* "hunspell/hunspell.pyx":218 * cache = self._stem_cache if stem_action else self._suggest_cache - * + * * for word in words: # <<<<<<<<<<<<<< * if not stem_action and self.spell(word): * # No need to check correctly spelled words @@ -5289,49 +5210,49 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hunspell/hunspell.pyx":232 + /* "hunspell/hunspell.pyx":229 * unknown_words.append(word) - * + * * if unknown_words: # <<<<<<<<<<<<<< * self._bulk_unknown_words(unknown_words, stem_action, ret_dict) - * + * */ __pyx_t_6 = (__pyx_v_unknown_words != Py_None) && (PyList_GET_SIZE(__pyx_v_unknown_words) != 0); if (__pyx_t_6) { - /* "hunspell/hunspell.pyx":233 - * + /* "hunspell/hunspell.pyx":230 + * * if unknown_words: * self._bulk_unknown_words(unknown_words, stem_action, ret_dict) # <<<<<<<<<<<<<< - * + * * return ret_dict */ ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_bulk_unknown_words(__pyx_v_self, __pyx_v_unknown_words, __pyx_v_stem_action, __pyx_v_ret_dict); - /* "hunspell/hunspell.pyx":232 + /* "hunspell/hunspell.pyx":229 * unknown_words.append(word) - * + * * if unknown_words: # <<<<<<<<<<<<<< * self._bulk_unknown_words(unknown_words, stem_action, ret_dict) - * + * */ } - /* "hunspell/hunspell.pyx":235 + /* "hunspell/hunspell.pyx":232 * self._bulk_unknown_words(unknown_words, stem_action, ret_dict) - * + * * return ret_dict # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret_dict); __pyx_r = __pyx_v_ret_dict; goto __pyx_L0; - /* "hunspell/hunspell.pyx":213 + /* "hunspell/hunspell.pyx":210 * return self.bulk_action('stem', words) - * + * * def bulk_action(self, basestring action, words): # <<<<<<<<<<<<<< * '''Accepts a list of words, returns a dict of words mapped to a list * # of their hunspell suggestions''' @@ -5356,12 +5277,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_16bulk_action(struc return __pyx_r; } -/* "hunspell/hunspell.pyx":238 - * - * +/* "hunspell/hunspell.pyx":235 + * + * * def save_cache(self): # <<<<<<<<<<<<<< * get_cache_manager(self._cache_manager_name).save_all_cache_contents() - * + * */ /* Python wrapper */ @@ -5387,14 +5308,14 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_18save_cache(struct PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("save_cache", 0); - /* "hunspell/hunspell.pyx":239 - * + /* "hunspell/hunspell.pyx":236 + * * def save_cache(self): * get_cache_manager(self._cache_manager_name).save_all_cache_contents() # <<<<<<<<<<<<<< - * + * * def set_concurrency(self, max_threads): */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_cache_manager); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_cache_manager); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -5407,13 +5328,13 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_18save_cache(struct } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_cache_manager_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_cache_manager_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->_cache_manager_name}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -5421,25 +5342,25 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_18save_cache(struct #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->_cache_manager_name}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->_cache_manager_name); __Pyx_GIVEREF(__pyx_v_self->_cache_manager_name); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->_cache_manager_name); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_save_all_cache_contents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_save_all_cache_contents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -5453,21 +5374,21 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_18save_cache(struct } } if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "hunspell/hunspell.pyx":238 - * - * + /* "hunspell/hunspell.pyx":235 + * + * * def save_cache(self): # <<<<<<<<<<<<<< * get_cache_manager(self._cache_manager_name).save_all_cache_contents() - * + * */ /* function exit code */ @@ -5487,12 +5408,12 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_18save_cache(struct return __pyx_r; } -/* "hunspell/hunspell.pyx":241 +/* "hunspell/hunspell.pyx":238 * get_cache_manager(self._cache_manager_name).save_all_cache_contents() - * + * * def set_concurrency(self, max_threads): # <<<<<<<<<<<<<< * self.max_threads = max_threads - * + * */ /* Python wrapper */ @@ -5514,22 +5435,22 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_20set_concurrency(s int __pyx_t_1; __Pyx_RefNannySetupContext("set_concurrency", 0); - /* "hunspell/hunspell.pyx":242 - * + /* "hunspell/hunspell.pyx":239 + * * def set_concurrency(self, max_threads): * self.max_threads = max_threads # <<<<<<<<<<<<<< - * + * * ################### */ - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_threads); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_max_threads); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_v_self->max_threads = __pyx_t_1; - /* "hunspell/hunspell.pyx":241 + /* "hunspell/hunspell.pyx":238 * get_cache_manager(self._cache_manager_name).save_all_cache_contents() - * + * * def set_concurrency(self, max_threads): # <<<<<<<<<<<<<< * self.max_threads = max_threads - * + * */ /* function exit code */ @@ -5544,9 +5465,9 @@ static PyObject *__pyx_pf_8hunspell_8hunspell_12HunspellWrap_20set_concurrency(s return __pyx_r; } -/* "hunspell/hunspell.pyx":248 +/* "hunspell/hunspell.pyx":245 * ################### - * + * * cdef int _c_bulk_action(self, char **word_array, char ***output_array, int n_words, bint stem_action, int *output_counts) except -1: # <<<<<<<<<<<<<< * '''C realm thread dispatcher''' * # Allocate all memory per thread @@ -5578,7 +5499,7 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("_c_bulk_action", 0); - /* "hunspell/hunspell.pyx":251 + /* "hunspell/hunspell.pyx":248 * '''C realm thread dispatcher''' * # Allocate all memory per thread * cdef thread_t **threads = calloc(self.max_threads, sizeof(thread_t *)) # <<<<<<<<<<<<<< @@ -5587,21 +5508,21 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py */ __pyx_v_threads = ((thread_t **)calloc(__pyx_v_self->max_threads, (sizeof(thread_t *)))); - /* "hunspell/hunspell.pyx":252 + /* "hunspell/hunspell.pyx":249 * # Allocate all memory per thread * cdef thread_t **threads = calloc(self.max_threads, sizeof(thread_t *)) * cdef ThreadWorkerArgs *thread_args = calloc(self.max_threads, sizeof(ThreadWorkerArgs)) # <<<<<<<<<<<<<< * cdef int rc, i, stride - * + * */ __pyx_v_thread_args = ((struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs *)calloc(__pyx_v_self->max_threads, (sizeof(struct __pyx_t_8hunspell_8hunspell_ThreadWorkerArgs)))); - /* "hunspell/hunspell.pyx":255 + /* "hunspell/hunspell.pyx":252 * cdef int rc, i, stride - * + * * if thread_args is NULL or threads is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ __pyx_t_2 = ((__pyx_v_thread_args == NULL) != 0); if (!__pyx_t_2) { @@ -5614,34 +5535,34 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":256 - * + /* "hunspell/hunspell.pyx":253 + * * if thread_args is NULL or threads is NULL: * raise MemoryError() # <<<<<<<<<<<<<< - * + * * try: */ - PyErr_NoMemory(); __PYX_ERR(0, 256, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 253, __pyx_L1_error) - /* "hunspell/hunspell.pyx":255 + /* "hunspell/hunspell.pyx":252 * cdef int rc, i, stride - * + * * if thread_args is NULL or threads is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ } - /* "hunspell/hunspell.pyx":258 + /* "hunspell/hunspell.pyx":255 * raise MemoryError() - * + * * try: # <<<<<<<<<<<<<< * # Divide workload between threads * words_per_thread = n_words // self.max_threads */ /*try:*/ { - /* "hunspell/hunspell.pyx":260 + /* "hunspell/hunspell.pyx":257 * try: * # Divide workload between threads * words_per_thread = n_words // self.max_threads # <<<<<<<<<<<<<< @@ -5650,18 +5571,18 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py */ if (unlikely(__pyx_v_self->max_threads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 260, __pyx_L7_error) + __PYX_ERR(0, 257, __pyx_L7_error) } else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->max_threads == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_n_words))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 260, __pyx_L7_error) + __PYX_ERR(0, 257, __pyx_L7_error) } - __pyx_t_3 = __Pyx_PyInt_From_int(__Pyx_div_int(__pyx_v_n_words, __pyx_v_self->max_threads)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__Pyx_div_int(__pyx_v_n_words, __pyx_v_self->max_threads)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_words_per_thread = __pyx_t_3; __pyx_t_3 = 0; - /* "hunspell/hunspell.pyx":261 + /* "hunspell/hunspell.pyx":258 * # Divide workload between threads * words_per_thread = n_words // self.max_threads * words_distributed = 0 # <<<<<<<<<<<<<< @@ -5671,12 +5592,12 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __Pyx_INCREF(__pyx_int_0); __pyx_v_words_distributed = __pyx_int_0; - /* "hunspell/hunspell.pyx":263 + /* "hunspell/hunspell.pyx":260 * words_distributed = 0 * # If uneven, round down on workers per thread (but the last thread will have extra work to do) * if n_words == 0 or n_words % self.max_threads != 0: # <<<<<<<<<<<<<< * words_per_thread = (n_words - (n_words % self.max_threads)) // self.max_threads - * + * */ __pyx_t_2 = ((__pyx_v_n_words == 0) != 0); if (!__pyx_t_2) { @@ -5686,50 +5607,50 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py } if (unlikely(__pyx_v_self->max_threads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 263, __pyx_L7_error) + __PYX_ERR(0, 260, __pyx_L7_error) } __pyx_t_2 = ((__Pyx_mod_int(__pyx_v_n_words, __pyx_v_self->max_threads) != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":264 + /* "hunspell/hunspell.pyx":261 * # If uneven, round down on workers per thread (but the last thread will have extra work to do) * if n_words == 0 or n_words % self.max_threads != 0: * words_per_thread = (n_words - (n_words % self.max_threads)) // self.max_threads # <<<<<<<<<<<<<< - * + * * for i from 0 <= i < self.max_threads: */ if (unlikely(__pyx_v_self->max_threads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 264, __pyx_L7_error) + __PYX_ERR(0, 261, __pyx_L7_error) } __pyx_t_4 = (__pyx_v_n_words - __Pyx_mod_int(__pyx_v_n_words, __pyx_v_self->max_threads)); if (unlikely(__pyx_v_self->max_threads == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - __PYX_ERR(0, 264, __pyx_L7_error) + __PYX_ERR(0, 261, __pyx_L7_error) } else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->max_threads == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); - __PYX_ERR(0, 264, __pyx_L7_error) + __PYX_ERR(0, 261, __pyx_L7_error) } - __pyx_t_3 = __Pyx_PyInt_From_int(__Pyx_div_int(__pyx_t_4, __pyx_v_self->max_threads)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__Pyx_div_int(__pyx_t_4, __pyx_v_self->max_threads)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_words_per_thread, __pyx_t_3); __pyx_t_3 = 0; - /* "hunspell/hunspell.pyx":263 + /* "hunspell/hunspell.pyx":260 * words_distributed = 0 * # If uneven, round down on workers per thread (but the last thread will have extra work to do) * if n_words == 0 or n_words % self.max_threads != 0: # <<<<<<<<<<<<<< * words_per_thread = (n_words - (n_words % self.max_threads)) // self.max_threads - * + * */ } - /* "hunspell/hunspell.pyx":266 + /* "hunspell/hunspell.pyx":263 * words_per_thread = (n_words - (n_words % self.max_threads)) // self.max_threads - * + * * for i from 0 <= i < self.max_threads: # <<<<<<<<<<<<<< * stride = i * words_per_thread * thread_args[i].tid = i @@ -5737,55 +5658,55 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __pyx_t_4 = __pyx_v_self->max_threads; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":267 - * + /* "hunspell/hunspell.pyx":264 + * * for i from 0 <= i < self.max_threads: * stride = i * words_per_thread # <<<<<<<<<<<<<< * thread_args[i].tid = i * thread_args[i].stem_action = stem_action */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_words_per_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L7_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_words_per_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L7_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L7_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_stride = __pyx_t_6; - /* "hunspell/hunspell.pyx":268 + /* "hunspell/hunspell.pyx":265 * for i from 0 <= i < self.max_threads: * stride = i * words_per_thread * thread_args[i].tid = i # <<<<<<<<<<<<<< * thread_args[i].stem_action = stem_action - * + * */ (__pyx_v_thread_args[__pyx_v_i]).tid = __pyx_v_i; - /* "hunspell/hunspell.pyx":269 + /* "hunspell/hunspell.pyx":266 * stride = i * words_per_thread * thread_args[i].tid = i * thread_args[i].stem_action = stem_action # <<<<<<<<<<<<<< - * + * * # Allocate one Hunspell Dict per thread since it isn't safe. */ (__pyx_v_thread_args[__pyx_v_i]).stem_action = __pyx_v_stem_action; - /* "hunspell/hunspell.pyx":272 - * + /* "hunspell/hunspell.pyx":269 + * * # Allocate one Hunspell Dict per thread since it isn't safe. * thread_args[i].hspell = self._create_hspell_inst(self.lang) # <<<<<<<<<<<<<< - * + * * # Account for leftovers */ __pyx_t_5 = __pyx_v_self->lang; __Pyx_INCREF(__pyx_t_5); - __pyx_t_7 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_create_hspell_inst(__pyx_v_self, ((PyObject*)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L7_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_create_hspell_inst(__pyx_v_self, ((PyObject*)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L7_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_thread_args[__pyx_v_i]).hspell = __pyx_t_7; - /* "hunspell/hunspell.pyx":275 - * + /* "hunspell/hunspell.pyx":272 + * * # Account for leftovers * if i == self.max_threads - 1: # <<<<<<<<<<<<<< * thread_args[i].n_words = n_words - words_distributed @@ -5794,24 +5715,24 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __pyx_t_1 = ((__pyx_v_i == (__pyx_v_self->max_threads - 1)) != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":276 + /* "hunspell/hunspell.pyx":273 * # Account for leftovers * if i == self.max_threads - 1: * thread_args[i].n_words = n_words - words_distributed # <<<<<<<<<<<<<< * else: * thread_args[i].n_words = words_per_thread */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n_words); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L7_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n_words); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_words_distributed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L7_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_words_distributed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L7_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_thread_args[__pyx_v_i]).n_words = __pyx_t_6; - /* "hunspell/hunspell.pyx":275 - * + /* "hunspell/hunspell.pyx":272 + * * # Account for leftovers * if i == self.max_threads - 1: # <<<<<<<<<<<<<< * thread_args[i].n_words = n_words - words_distributed @@ -5820,33 +5741,33 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py goto __pyx_L14; } - /* "hunspell/hunspell.pyx":278 + /* "hunspell/hunspell.pyx":275 * thread_args[i].n_words = n_words - words_distributed * else: * thread_args[i].n_words = words_per_thread # <<<<<<<<<<<<<< * words_distributed += words_per_thread - * + * */ /*else*/ { - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_words_per_thread); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L7_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_words_per_thread); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L7_error) (__pyx_v_thread_args[__pyx_v_i]).n_words = __pyx_t_6; - /* "hunspell/hunspell.pyx":279 + /* "hunspell/hunspell.pyx":276 * else: * thread_args[i].n_words = words_per_thread * words_distributed += words_per_thread # <<<<<<<<<<<<<< - * + * * # Find the stride into each array */ - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_words_distributed, __pyx_v_words_per_thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L7_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_words_distributed, __pyx_v_words_per_thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_words_distributed, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L14:; - /* "hunspell/hunspell.pyx":282 - * + /* "hunspell/hunspell.pyx":279 + * * # Find the stride into each array * thread_args[i].word_list = &word_array[stride] # <<<<<<<<<<<<<< * thread_args[i].output_array_ptr = &output_array[stride] @@ -5854,26 +5775,26 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py */ (__pyx_v_thread_args[__pyx_v_i]).word_list = (&(__pyx_v_word_array[__pyx_v_stride])); - /* "hunspell/hunspell.pyx":283 + /* "hunspell/hunspell.pyx":280 * # Find the stride into each array * thread_args[i].word_list = &word_array[stride] * thread_args[i].output_array_ptr = &output_array[stride] # <<<<<<<<<<<<<< * thread_args[i].output_counts = &output_counts[stride] - * + * */ (__pyx_v_thread_args[__pyx_v_i]).output_array_ptr = (&(__pyx_v_output_array[__pyx_v_stride])); - /* "hunspell/hunspell.pyx":284 + /* "hunspell/hunspell.pyx":281 * thread_args[i].word_list = &word_array[stride] * thread_args[i].output_array_ptr = &output_array[stride] * thread_args[i].output_counts = &output_counts[stride] # <<<<<<<<<<<<<< - * + * * # Create thread */ (__pyx_v_thread_args[__pyx_v_i]).output_counts = (&(__pyx_v_output_counts[__pyx_v_stride])); - /* "hunspell/hunspell.pyx":287 - * + /* "hunspell/hunspell.pyx":284 + * * # Create thread * threads[i] = thread_create(&hunspell_worker, &thread_args[i]) # <<<<<<<<<<<<<< * if threads[i] is NULL: @@ -5881,41 +5802,41 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py */ (__pyx_v_threads[__pyx_v_i]) = thread_create((&__pyx_f_8hunspell_8hunspell_hunspell_worker), ((void *)(&(__pyx_v_thread_args[__pyx_v_i])))); - /* "hunspell/hunspell.pyx":288 + /* "hunspell/hunspell.pyx":285 * # Create thread * threads[i] = thread_create(&hunspell_worker, &thread_args[i]) * if threads[i] is NULL: # <<<<<<<<<<<<<< * raise OSError("Could not create thread") - * + * */ __pyx_t_1 = (((__pyx_v_threads[__pyx_v_i]) == NULL) != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":289 + /* "hunspell/hunspell.pyx":286 * threads[i] = thread_create(&hunspell_worker, &thread_args[i]) * if threads[i] is NULL: * raise OSError("Could not create thread") # <<<<<<<<<<<<<< - * + * * # wait for each thread to complete */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L7_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, 289, __pyx_L7_error) + __PYX_ERR(0, 286, __pyx_L7_error) - /* "hunspell/hunspell.pyx":288 + /* "hunspell/hunspell.pyx":285 * # Create thread * threads[i] = thread_create(&hunspell_worker, &thread_args[i]) * if threads[i] is NULL: # <<<<<<<<<<<<<< * raise OSError("Could not create thread") - * + * */ } } - /* "hunspell/hunspell.pyx":292 - * + /* "hunspell/hunspell.pyx":289 + * * # wait for each thread to complete * for i from 0 <= i < self.max_threads: # <<<<<<<<<<<<<< * # block until thread i completes @@ -5924,7 +5845,7 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __pyx_t_4 = __pyx_v_self->max_threads; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":294 + /* "hunspell/hunspell.pyx":291 * for i from 0 <= i < self.max_threads: * # block until thread i completes * rc = thread_join(threads[i]) # <<<<<<<<<<<<<< @@ -5933,26 +5854,26 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py */ __pyx_v_rc = thread_join((__pyx_v_threads[__pyx_v_i])); - /* "hunspell/hunspell.pyx":295 + /* "hunspell/hunspell.pyx":292 * # block until thread i completes * rc = thread_join(threads[i]) * if rc: # <<<<<<<<<<<<<< * raise OSError(rc, "Could not join thread") - * + * */ __pyx_t_1 = (__pyx_v_rc != 0); if (__pyx_t_1) { - /* "hunspell/hunspell.pyx":296 + /* "hunspell/hunspell.pyx":293 * rc = thread_join(threads[i]) * if rc: * raise OSError(rc, "Could not join thread") # <<<<<<<<<<<<<< - * + * * # Free Hunspell Dict */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L7_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); @@ -5960,24 +5881,24 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __Pyx_GIVEREF(__pyx_kp_s_Could_not_join_thread); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_Could_not_join_thread); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 296, __pyx_L7_error) + __PYX_ERR(0, 293, __pyx_L7_error) - /* "hunspell/hunspell.pyx":295 + /* "hunspell/hunspell.pyx":292 * # block until thread i completes * rc = thread_join(threads[i]) * if rc: # <<<<<<<<<<<<<< * raise OSError(rc, "Could not join thread") - * + * */ } - /* "hunspell/hunspell.pyx":299 - * + /* "hunspell/hunspell.pyx":296 + * * # Free Hunspell Dict * del thread_args[i].hspell # <<<<<<<<<<<<<< * return 1 @@ -5986,7 +5907,7 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py delete (__pyx_v_thread_args[__pyx_v_i]).hspell; } - /* "hunspell/hunspell.pyx":300 + /* "hunspell/hunspell.pyx":297 * # Free Hunspell Dict * del thread_args[i].hspell * return 1 # <<<<<<<<<<<<<< @@ -5997,12 +5918,12 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py goto __pyx_L6_return; } - /* "hunspell/hunspell.pyx":303 + /* "hunspell/hunspell.pyx":300 * finally: * # Free top level stuff * free(thread_args) # <<<<<<<<<<<<<< * dealloc_threads(threads, self.max_threads) - * + * */ /*finally:*/ { /*exception exit:*/{ @@ -6024,11 +5945,11 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py { free(__pyx_v_thread_args); - /* "hunspell/hunspell.pyx":304 + /* "hunspell/hunspell.pyx":301 * # Free top level stuff * free(thread_args) * dealloc_threads(threads, self.max_threads) # <<<<<<<<<<<<<< - * + * * cdef void _parse_bulk_results(self, dict ret_dict, list unknown_words, int *output_counts, char ***output_array) except *: */ dealloc_threads(__pyx_v_threads, __pyx_v_self->max_threads); @@ -6051,20 +5972,20 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py __pyx_L6_return: { __pyx_t_6 = __pyx_r; - /* "hunspell/hunspell.pyx":303 + /* "hunspell/hunspell.pyx":300 * finally: * # Free top level stuff * free(thread_args) # <<<<<<<<<<<<<< * dealloc_threads(threads, self.max_threads) - * + * */ free(__pyx_v_thread_args); - /* "hunspell/hunspell.pyx":304 + /* "hunspell/hunspell.pyx":301 * # Free top level stuff * free(thread_args) * dealloc_threads(threads, self.max_threads) # <<<<<<<<<<<<<< - * + * * cdef void _parse_bulk_results(self, dict ret_dict, list unknown_words, int *output_counts, char ***output_array) except *: */ dealloc_threads(__pyx_v_threads, __pyx_v_self->max_threads); @@ -6073,9 +5994,9 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py } } - /* "hunspell/hunspell.pyx":248 + /* "hunspell/hunspell.pyx":245 * ################### - * + * * cdef int _c_bulk_action(self, char **word_array, char ***output_array, int n_words, bint stem_action, int *output_counts) except -1: # <<<<<<<<<<<<<< * '''C realm thread dispatcher''' * # Allocate all memory per thread @@ -6094,9 +6015,9 @@ static int __pyx_f_8hunspell_8hunspell_12HunspellWrap__c_bulk_action(struct __py return __pyx_r; } -/* "hunspell/hunspell.pyx":306 +/* "hunspell/hunspell.pyx":303 * dealloc_threads(threads, self.max_threads) - * + * * cdef void _parse_bulk_results(self, dict ret_dict, list unknown_words, int *output_counts, char ***output_array) except *: # <<<<<<<<<<<<<< * '''Parse the return of a bulk action''' * cdef int unknown_len = len(unknown_words) @@ -6125,7 +6046,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc int __pyx_t_16; __Pyx_RefNannySetupContext("_parse_bulk_results", 0); - /* "hunspell/hunspell.pyx":308 + /* "hunspell/hunspell.pyx":305 * cdef void _parse_bulk_results(self, dict ret_dict, list unknown_words, int *output_counts, char ***output_array) except *: * '''Parse the return of a bulk action''' * cdef int unknown_len = len(unknown_words) # <<<<<<<<<<<<<< @@ -6134,12 +6055,12 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc */ if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 308, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_unknown_words); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_unknown_words); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 305, __pyx_L1_error) __pyx_v_unknown_len = __pyx_t_1; - /* "hunspell/hunspell.pyx":310 + /* "hunspell/hunspell.pyx":307 * cdef int unknown_len = len(unknown_words) * cdef int i, j * try: # <<<<<<<<<<<<<< @@ -6148,7 +6069,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc */ /*try:*/ { - /* "hunspell/hunspell.pyx":311 + /* "hunspell/hunspell.pyx":308 * cdef int i, j * try: * for i from 0 <= i < unknown_len: # <<<<<<<<<<<<<< @@ -6158,7 +6079,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_t_2 = __pyx_v_unknown_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":312 + /* "hunspell/hunspell.pyx":309 * try: * for i from 0 <= i < unknown_len: * for j from 0 <= j < output_counts[i]: # <<<<<<<<<<<<<< @@ -6168,7 +6089,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_t_3 = (__pyx_v_output_counts[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "hunspell/hunspell.pyx":313 + /* "hunspell/hunspell.pyx":310 * for i from 0 <= i < unknown_len: * for j from 0 <= j < output_counts[i]: * ret_dict[unknown_words[i]].append(c_string_to_unicode_no_except(output_array[i][j], self._dic_encoding)) # <<<<<<<<<<<<<< @@ -6177,30 +6098,30 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc */ if (unlikely(__pyx_v_ret_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 313, __pyx_L4_error) + __PYX_ERR(0, 310, __pyx_L4_error) } if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 313, __pyx_L4_error) + __PYX_ERR(0, 310, __pyx_L4_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L4_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L4_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_v_self->_dic_encoding; __Pyx_INCREF(__pyx_t_4); __pyx_t_7.__pyx_n = 1; __pyx_t_7.encoding = ((PyObject*)__pyx_t_4); - __pyx_t_6 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(((__pyx_v_output_array[__pyx_v_i])[__pyx_v_j]), &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L4_error) + __pyx_t_6 = __pyx_f_8hunspell_8hunspell_c_string_to_unicode_no_except(((__pyx_v_output_array[__pyx_v_i])[__pyx_v_j]), &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 313, __pyx_L4_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 310, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - /* "hunspell/hunspell.pyx":314 + /* "hunspell/hunspell.pyx":311 * for j from 0 <= j < output_counts[i]: * ret_dict[unknown_words[i]].append(c_string_to_unicode_no_except(output_array[i][j], self._dic_encoding)) * ret_dict[unknown_words[i]] = tuple(ret_dict[unknown_words[i]]) # <<<<<<<<<<<<<< @@ -6209,37 +6130,37 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc */ if (unlikely(__pyx_v_ret_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 314, __pyx_L4_error) + __PYX_ERR(0, 311, __pyx_L4_error) } if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 314, __pyx_L4_error) + __PYX_ERR(0, 311, __pyx_L4_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L4_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L4_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L4_error) + __pyx_t_6 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_ret_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 314, __pyx_L4_error) + __PYX_ERR(0, 311, __pyx_L4_error) } if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 314, __pyx_L4_error) + __PYX_ERR(0, 311, __pyx_L4_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L4_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 314, __pyx_L4_error) + if (unlikely(PyDict_SetItem(__pyx_v_ret_dict, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 311, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } - /* "hunspell/hunspell.pyx":316 + /* "hunspell/hunspell.pyx":313 * ret_dict[unknown_words[i]] = tuple(ret_dict[unknown_words[i]]) * finally: * for i from 0 <= i < unknown_len: # <<<<<<<<<<<<<< @@ -6251,11 +6172,11 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_t_2 = __pyx_v_unknown_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":318 + /* "hunspell/hunspell.pyx":315 * for i from 0 <= i < unknown_len: * # Free each suggestion list * self._cxx_hunspell.free_list(output_array + i, output_counts[i]) # <<<<<<<<<<<<<< - * + * * cdef void _bulk_unknown_words(self, list unknown_words, bint stem_action, dict ret_dict): */ __pyx_v_self->_cxx_hunspell->free_list((__pyx_v_output_array + __pyx_v_i), (__pyx_v_output_counts[__pyx_v_i])); @@ -6281,7 +6202,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { - /* "hunspell/hunspell.pyx":316 + /* "hunspell/hunspell.pyx":313 * ret_dict[unknown_words[i]] = tuple(ret_dict[unknown_words[i]]) * finally: * for i from 0 <= i < unknown_len: # <<<<<<<<<<<<<< @@ -6291,11 +6212,11 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_t_16 = __pyx_v_unknown_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_16; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":318 + /* "hunspell/hunspell.pyx":315 * for i from 0 <= i < unknown_len: * # Free each suggestion list * self._cxx_hunspell.free_list(output_array + i, output_counts[i]) # <<<<<<<<<<<<<< - * + * * cdef void _bulk_unknown_words(self, list unknown_words, bint stem_action, dict ret_dict): */ __pyx_v_self->_cxx_hunspell->free_list((__pyx_v_output_array + __pyx_v_i), (__pyx_v_output_counts[__pyx_v_i])); @@ -6319,9 +6240,9 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __pyx_L5:; } - /* "hunspell/hunspell.pyx":306 + /* "hunspell/hunspell.pyx":303 * dealloc_threads(threads, self.max_threads) - * + * * cdef void _parse_bulk_results(self, dict ret_dict, list unknown_words, int *output_counts, char ***output_array) except *: # <<<<<<<<<<<<<< * '''Parse the return of a bulk action''' * cdef int unknown_len = len(unknown_words) @@ -6338,9 +6259,9 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__parse_bulk_results(struc __Pyx_RefNannyFinishContext(); } -/* "hunspell/hunspell.pyx":320 +/* "hunspell/hunspell.pyx":317 * self._cxx_hunspell.free_list(output_array + i, output_counts[i]) - * + * * cdef void _bulk_unknown_words(self, list unknown_words, bint stem_action, dict ret_dict): # <<<<<<<<<<<<<< * cdef int unknown_len = len(unknown_words) * # C version of: ["foo", "bar", "baz"] @@ -6374,8 +6295,8 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc char const *__pyx_t_17; __Pyx_RefNannySetupContext("_bulk_unknown_words", 0); - /* "hunspell/hunspell.pyx":321 - * + /* "hunspell/hunspell.pyx":318 + * * cdef void _bulk_unknown_words(self, list unknown_words, bint stem_action, dict ret_dict): * cdef int unknown_len = len(unknown_words) # <<<<<<<<<<<<<< * # C version of: ["foo", "bar", "baz"] @@ -6383,12 +6304,12 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 321, __pyx_L1_error) + __PYX_ERR(0, 318, __pyx_L1_error) } - __pyx_t_1 = PyList_GET_SIZE(__pyx_v_unknown_words); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = PyList_GET_SIZE(__pyx_v_unknown_words); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_v_unknown_len = __pyx_t_1; - /* "hunspell/hunspell.pyx":323 + /* "hunspell/hunspell.pyx":320 * cdef int unknown_len = len(unknown_words) * # C version of: ["foo", "bar", "baz"] * cdef char ***output_array = NULL # <<<<<<<<<<<<<< @@ -6397,7 +6318,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ __pyx_v_output_array = NULL; - /* "hunspell/hunspell.pyx":324 + /* "hunspell/hunspell.pyx":321 * # C version of: ["foo", "bar", "baz"] * cdef char ***output_array = NULL * cdef int *output_counts = NULL # <<<<<<<<<<<<<< @@ -6406,20 +6327,20 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ __pyx_v_output_counts = NULL; - /* "hunspell/hunspell.pyx":325 + /* "hunspell/hunspell.pyx":322 * cdef char ***output_array = NULL * cdef int *output_counts = NULL * cdef char **word_array = calloc(unknown_len, sizeof(char *)) # <<<<<<<<<<<<<< * cache = self._stem_cache if stem_action else self._suggest_cache - * + * */ __pyx_v_word_array = ((char **)calloc(__pyx_v_unknown_len, (sizeof(char *)))); - /* "hunspell/hunspell.pyx":326 + /* "hunspell/hunspell.pyx":323 * cdef int *output_counts = NULL * cdef char **word_array = calloc(unknown_len, sizeof(char *)) * cache = self._stem_cache if stem_action else self._suggest_cache # <<<<<<<<<<<<<< - * + * * if word_array is NULL: */ if ((__pyx_v_stem_action != 0)) { @@ -6432,9 +6353,9 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_v_cache = __pyx_t_2; __pyx_t_2 = 0; - /* "hunspell/hunspell.pyx":328 + /* "hunspell/hunspell.pyx":325 * cache = self._stem_cache if stem_action else self._suggest_cache - * + * * if word_array is NULL: # <<<<<<<<<<<<<< * raise MemoryError() * for i, unknown_word in enumerate(unknown_words): @@ -6442,39 +6363,39 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_t_3 = ((__pyx_v_word_array == NULL) != 0); if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":329 - * + /* "hunspell/hunspell.pyx":326 + * * if word_array is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * for i, unknown_word in enumerate(unknown_words): - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: + * copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) */ - PyErr_NoMemory(); __PYX_ERR(0, 329, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 326, __pyx_L1_error) - /* "hunspell/hunspell.pyx":328 + /* "hunspell/hunspell.pyx":325 * cache = self._stem_cache if stem_action else self._suggest_cache - * + * * if word_array is NULL: # <<<<<<<<<<<<<< * raise MemoryError() * for i, unknown_word in enumerate(unknown_words): */ } - /* "hunspell/hunspell.pyx":330 + /* "hunspell/hunspell.pyx":327 * if word_array is NULL: * raise MemoryError() * for i, unknown_word in enumerate(unknown_words): # <<<<<<<<<<<<<< - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: - * raise MemoryError() + * copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) + * */ __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_unknown_words; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_unknown_word, __pyx_t_5); @@ -6482,70 +6403,50 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_v_i = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); - /* "hunspell/hunspell.pyx":331 + /* "hunspell/hunspell.pyx":328 * raise MemoryError() * for i, unknown_word in enumerate(unknown_words): - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * + * copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) # <<<<<<<<<<<<<< + * + * try: */ - if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_unknown_word))||((__pyx_v_unknown_word) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_unknown_word)->tp_name), 0))) __PYX_ERR(0, 331, __pyx_L1_error) + if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_unknown_word))||((__pyx_v_unknown_word) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_unknown_word)->tp_name), 0))) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_t_5 = __pyx_v_self->_dic_encoding; __Pyx_INCREF(__pyx_t_5); __pyx_t_7.__pyx_n = 1; __pyx_t_7.encoding = ((PyObject*)__pyx_t_5); - __pyx_t_6 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(((PyObject*)__pyx_v_unknown_word), (&(__pyx_v_word_array[__pyx_v_i])), &__pyx_t_7); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_6 = __pyx_f_8hunspell_8hunspell_copy_to_c_string(((PyObject*)__pyx_v_unknown_word), (&(__pyx_v_word_array[__pyx_v_i])), &__pyx_t_7); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = ((__pyx_t_6 <= 0) != 0); - if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":332 - * for i, unknown_word in enumerate(unknown_words): - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: - * raise MemoryError() # <<<<<<<<<<<<<< - * - * try: - */ - PyErr_NoMemory(); __PYX_ERR(0, 332, __pyx_L1_error) - - /* "hunspell/hunspell.pyx":331 - * raise MemoryError() - * for i, unknown_word in enumerate(unknown_words): - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ - } - - /* "hunspell/hunspell.pyx":330 + /* "hunspell/hunspell.pyx":327 * if word_array is NULL: * raise MemoryError() * for i, unknown_word in enumerate(unknown_words): # <<<<<<<<<<<<<< - * if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: - * raise MemoryError() + * copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) + * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "hunspell/hunspell.pyx":334 - * raise MemoryError() - * + /* "hunspell/hunspell.pyx":330 + * copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) + * * try: # <<<<<<<<<<<<<< * # Create output arrays * # Array of arrays of C strings (e.g. [["food", ...], ["bar"], ["bad", ...]]) */ /*try:*/ { - /* "hunspell/hunspell.pyx":339 + /* "hunspell/hunspell.pyx":335 * # This array will be divided evenly amongst the threads for the return values * # of Hunspell.suggest(), each call returns an array of C strings * output_array = calloc(unknown_len, sizeof(char **)) # <<<<<<<<<<<<<< - * + * * # Array of integers, each the length of the corresponding C string array */ __pyx_v_output_array = ((char ***)calloc(__pyx_v_unknown_len, (sizeof(char **)))); - /* "hunspell/hunspell.pyx":344 + /* "hunspell/hunspell.pyx":340 * # This array will be divided evenly amongst the threads for the length of the * # arrays returned by each call to Hunspell.suggest() * output_counts = calloc(unknown_len, sizeof(int)) # <<<<<<<<<<<<<< @@ -6554,71 +6455,71 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ __pyx_v_output_counts = ((int *)calloc(__pyx_v_unknown_len, (sizeof(int)))); - /* "hunspell/hunspell.pyx":345 + /* "hunspell/hunspell.pyx":341 * # arrays returned by each call to Hunspell.suggest() * output_counts = calloc(unknown_len, sizeof(int)) * if output_counts is NULL or output_array is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ __pyx_t_8 = ((__pyx_v_output_counts == NULL) != 0); if (!__pyx_t_8) { } else { __pyx_t_3 = __pyx_t_8; - goto __pyx_L11_bool_binop_done; + goto __pyx_L10_bool_binop_done; } __pyx_t_8 = ((__pyx_v_output_array == NULL) != 0); __pyx_t_3 = __pyx_t_8; - __pyx_L11_bool_binop_done:; + __pyx_L10_bool_binop_done:; if (__pyx_t_3) { - /* "hunspell/hunspell.pyx":346 + /* "hunspell/hunspell.pyx":342 * output_counts = calloc(unknown_len, sizeof(int)) * if output_counts is NULL or output_array is NULL: * raise MemoryError() # <<<<<<<<<<<<<< - * + * * try: */ - PyErr_NoMemory(); __PYX_ERR(0, 346, __pyx_L8_error) + PyErr_NoMemory(); __PYX_ERR(0, 342, __pyx_L7_error) - /* "hunspell/hunspell.pyx":345 + /* "hunspell/hunspell.pyx":341 * # arrays returned by each call to Hunspell.suggest() * output_counts = calloc(unknown_len, sizeof(int)) * if output_counts is NULL or output_array is NULL: # <<<<<<<<<<<<<< * raise MemoryError() - * + * */ } - /* "hunspell/hunspell.pyx":348 + /* "hunspell/hunspell.pyx":344 * raise MemoryError() - * + * * try: # <<<<<<<<<<<<<< * # Schedule bulk job * self._c_bulk_action(word_array, output_array, unknown_len, stem_action, output_counts) */ /*try:*/ { - /* "hunspell/hunspell.pyx":350 + /* "hunspell/hunspell.pyx":346 * try: * # Schedule bulk job * self._c_bulk_action(word_array, output_array, unknown_len, stem_action, output_counts) # <<<<<<<<<<<<<< - * + * * # Parse the return */ - __pyx_t_6 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_c_bulk_action(__pyx_v_self, __pyx_v_word_array, __pyx_v_output_array, __pyx_v_unknown_len, __pyx_v_stem_action, __pyx_v_output_counts); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 350, __pyx_L14_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_c_bulk_action(__pyx_v_self, __pyx_v_word_array, __pyx_v_output_array, __pyx_v_unknown_len, __pyx_v_stem_action, __pyx_v_output_counts); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 346, __pyx_L13_error) - /* "hunspell/hunspell.pyx":353 - * + /* "hunspell/hunspell.pyx":349 + * * # Parse the return * self._parse_bulk_results(ret_dict, unknown_words, output_counts, output_array) # <<<<<<<<<<<<<< - * + * * # Add ret_dict words to cache */ - ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_parse_bulk_results(__pyx_v_self, __pyx_v_ret_dict, __pyx_v_unknown_words, __pyx_v_output_counts, __pyx_v_output_array); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L14_error) + ((struct __pyx_vtabstruct_8hunspell_8hunspell_HunspellWrap *)__pyx_v_self->__pyx_vtab)->_parse_bulk_results(__pyx_v_self, __pyx_v_ret_dict, __pyx_v_unknown_words, __pyx_v_output_counts, __pyx_v_output_array); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L13_error) - /* "hunspell/hunspell.pyx":356 - * + /* "hunspell/hunspell.pyx":352 + * * # Add ret_dict words to cache * for i from 0 <= i < unknown_len: # <<<<<<<<<<<<<< * cache[unknown_words[i]] = ret_dict[unknown_words[i]] @@ -6627,7 +6528,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_t_6 = __pyx_v_unknown_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - /* "hunspell/hunspell.pyx":357 + /* "hunspell/hunspell.pyx":353 * # Add ret_dict words to cache * for i from 0 <= i < unknown_len: * cache[unknown_words[i]] = ret_dict[unknown_words[i]] # <<<<<<<<<<<<<< @@ -6636,30 +6537,30 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ if (unlikely(__pyx_v_ret_dict == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 357, __pyx_L14_error) + __PYX_ERR(0, 353, __pyx_L13_error) } if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 357, __pyx_L14_error) + __PYX_ERR(0, 353, __pyx_L13_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L14_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L14_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_ret_dict, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_unknown_words == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 357, __pyx_L14_error) + __PYX_ERR(0, 353, __pyx_L13_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L14_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_unknown_words, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_v_cache, __pyx_t_2, __pyx_t_5) < 0)) __PYX_ERR(0, 357, __pyx_L14_error) + if (unlikely(PyObject_SetItem(__pyx_v_cache, __pyx_t_2, __pyx_t_5) < 0)) __PYX_ERR(0, 353, __pyx_L13_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } - /* "hunspell/hunspell.pyx":360 + /* "hunspell/hunspell.pyx":356 * finally: * # Free top level stuff * free(output_array) # <<<<<<<<<<<<<< @@ -6670,7 +6571,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc /*normal exit:*/{ free(__pyx_v_output_array); - /* "hunspell/hunspell.pyx":361 + /* "hunspell/hunspell.pyx":357 * # Free top level stuff * free(output_array) * free(output_counts) # <<<<<<<<<<<<<< @@ -6678,11 +6579,11 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc * self._cxx_hunspell.free_list(&word_array, unknown_len) */ free(__pyx_v_output_counts); - goto __pyx_L15; + goto __pyx_L14; } /*exception exit:*/{ __Pyx_PyThreadState_declare - __pyx_L14_error:; + __pyx_L13_error:; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6698,7 +6599,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_t_6 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { - /* "hunspell/hunspell.pyx":360 + /* "hunspell/hunspell.pyx":356 * finally: * # Free top level stuff * free(output_array) # <<<<<<<<<<<<<< @@ -6707,7 +6608,7 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc */ free(__pyx_v_output_array); - /* "hunspell/hunspell.pyx":361 + /* "hunspell/hunspell.pyx":357 * # Free top level stuff * free(output_array) * free(output_counts) # <<<<<<<<<<<<<< @@ -6729,13 +6630,13 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; - goto __pyx_L8_error; + goto __pyx_L7_error; } - __pyx_L15:; + __pyx_L14:; } } - /* "hunspell/hunspell.pyx":363 + /* "hunspell/hunspell.pyx":359 * free(output_counts) * finally: * self._cxx_hunspell.free_list(&word_array, unknown_len) # <<<<<<<<<<<<<< @@ -6743,11 +6644,11 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc /*finally:*/ { /*normal exit:*/{ __pyx_v_self->_cxx_hunspell->free_list((&__pyx_v_word_array), __pyx_v_unknown_len); - goto __pyx_L9; + goto __pyx_L8; } /*exception exit:*/{ __Pyx_PyThreadState_declare - __pyx_L8_error:; + __pyx_L7_error:; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6779,12 +6680,12 @@ static void __pyx_f_8hunspell_8hunspell_12HunspellWrap__bulk_unknown_words(struc __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_17; goto __pyx_L1_error; } - __pyx_L9:; + __pyx_L8:; } - /* "hunspell/hunspell.pyx":320 + /* "hunspell/hunspell.pyx":317 * self._cxx_hunspell.free_list(output_array + i, output_counts[i]) - * + * * cdef void _bulk_unknown_words(self, list unknown_words, bint stem_action, dict ret_dict): # <<<<<<<<<<<<<< * cdef int unknown_len = len(unknown_words) * # C version of: ["foo", "bar", "baz"] @@ -7758,7 +7659,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, {&__pyx_n_s_AutoSyncCache, __pyx_k_AutoSyncCache, sizeof(__pyx_k_AutoSyncCache), 0, 0, 1, 1}, - {&__pyx_n_s_BYTES_TYPE, __pyx_k_BYTES_TYPE, sizeof(__pyx_k_BYTES_TYPE), 0, 0, 1, 1}, {&__pyx_kp_s_C_Users_Matthew_Workspace_cython, __pyx_k_C_Users_Matthew_Workspace_cython, sizeof(__pyx_k_C_Users_Matthew_Workspace_cython), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_create_thread, __pyx_k_Could_not_create_thread, sizeof(__pyx_k_Could_not_create_thread), 0, 0, 1, 0}, {&__pyx_kp_s_Could_not_join_thread, __pyx_k_Could_not_join_thread, sizeof(__pyx_k_Could_not_join_thread), 0, 0, 1, 0}, @@ -7834,8 +7734,8 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 42, __pyx_L1_error) __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 108, __pyx_L1_error) - __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 327, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7845,153 +7745,153 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "hunspell/hunspell.pyx":123 + /* "hunspell/hunspell.pyx":122 * # TODO - make these LRU caches so that you don't destroy your memory! * if hunspell_data_dir is None: * hunspell_data_dir = os.environ.get("HUNSPELL_DATA") # <<<<<<<<<<<<<< * if hunspell_data_dir is None: * hunspell_data_dir = os.path.join(os.path.dirname(__file__), '..', 'dictionaries') */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_HUNSPELL_DATA); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_HUNSPELL_DATA); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "hunspell/hunspell.pyx":137 + /* "hunspell/hunspell.pyx":136 * if disk_cache_dir: * manager.cache_directory = disk_cache_dir * if not manager.cache_registered("hunspell_suggest"): # <<<<<<<<<<<<<< * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "hunspell/hunspell.pyx":139 + /* "hunspell/hunspell.pyx":138 * if not manager.cache_registered("hunspell_suggest"): * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] # <<<<<<<<<<<<<< * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) * else: */ - __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_60, __pyx_int_1000000); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_60, __pyx_int_1000000); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_300, __pyx_int_10000); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_300, __pyx_int_10000); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_900, __pyx_int_1); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_900, __pyx_int_1); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "hunspell/hunspell.pyx":140 + /* "hunspell/hunspell.pyx":139 * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) # <<<<<<<<<<<<<< * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "hunspell/hunspell.pyx":142 + /* "hunspell/hunspell.pyx":141 * AutoSyncCache("hunspell_suggest", cache_manager=manager, time_checks=custom_time_checks) * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) # <<<<<<<<<<<<<< * if not manager.cache_registered("hunspell_stem"): * if disk_cache_dir: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "hunspell/hunspell.pyx":143 + /* "hunspell/hunspell.pyx":142 * else: * NonPersistentCache("hunspell_suggest", cache_manager=manager) * if not manager.cache_registered("hunspell_stem"): # <<<<<<<<<<<<<< * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "hunspell/hunspell.pyx":145 + /* "hunspell/hunspell.pyx":144 * if not manager.cache_registered("hunspell_stem"): * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] # <<<<<<<<<<<<<< * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) * else: */ - __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_60, __pyx_int_1000000); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_60, __pyx_int_1000000); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_300, __pyx_int_10000); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_300, __pyx_int_10000); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_tuple__13 = PyTuple_Pack(2, __pyx_int_900, __pyx_int_1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_int_900, __pyx_int_1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "hunspell/hunspell.pyx":146 + /* "hunspell/hunspell.pyx":145 * if disk_cache_dir: * custom_time_checks = [TimeCount(60, 1000000), TimeCount(300, 10000), TimeCount(900, 1)] * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) # <<<<<<<<<<<<<< * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "hunspell/hunspell.pyx":148 + /* "hunspell/hunspell.pyx":147 * AutoSyncCache("hunspell_stem", cache_manager=manager, time_checks=custom_time_checks) * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) # <<<<<<<<<<<<<< * self._suggest_cache = manager.retrieve_cache("hunspell_suggest") * self._stem_cache = manager.retrieve_cache("hunspell_stem") */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "hunspell/hunspell.pyx":149 + /* "hunspell/hunspell.pyx":148 * else: * NonPersistentCache("hunspell_stem", cache_manager=manager) * self._suggest_cache = manager.retrieve_cache("hunspell_suggest") # <<<<<<<<<<<<<< * self._stem_cache = manager.retrieve_cache("hunspell_stem") - * + * */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_hunspell_suggest); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "hunspell/hunspell.pyx":150 + /* "hunspell/hunspell.pyx":149 * NonPersistentCache("hunspell_stem", cache_manager=manager) * self._suggest_cache = manager.retrieve_cache("hunspell_suggest") * self._stem_cache = manager.retrieve_cache("hunspell_stem") # <<<<<<<<<<<<<< - * + * * def __dealloc__(self): */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_hunspell_stem); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - /* "hunspell/hunspell.pyx":289 + /* "hunspell/hunspell.pyx":286 * threads[i] = thread_create(&hunspell_worker, &thread_args[i]) * if threads[i] is NULL: * raise OSError("Could not create thread") # <<<<<<<<<<<<<< - * + * * # wait for each thread to complete */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Could_not_create_thread); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Could_not_create_thread); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "hunspell/hunspell.pyx":15 * from hunspell.thread cimport * - * + * * def valid_encoding(basestring encoding): # <<<<<<<<<<<<<< * try: * "".encode(encoding, 'strict') @@ -8180,7 +8080,7 @@ PyMODINIT_FUNC PyInit_hunspell(void) * from cacheman.cachewrap import NonPersistentCache * from cacheman.cacher import get_cache_manager # <<<<<<<<<<<<<< * from cacheman.autosync import TimeCount, AutoSyncCache - * + * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8200,7 +8100,7 @@ PyMODINIT_FUNC PyInit_hunspell(void) * from cacheman.cachewrap import NonPersistentCache * from cacheman.cacher import get_cache_manager * from cacheman.autosync import TimeCount, AutoSyncCache # <<<<<<<<<<<<<< - * + * * from libc.stdlib cimport * */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) @@ -8226,7 +8126,7 @@ PyMODINIT_FUNC PyInit_hunspell(void) /* "hunspell/hunspell.pyx":15 * from hunspell.thread cimport * - * + * * def valid_encoding(basestring encoding): # <<<<<<<<<<<<<< * try: * "".encode(encoding, 'strict') @@ -8238,7 +8138,7 @@ PyMODINIT_FUNC PyInit_hunspell(void) /* "hunspell/hunspell.pyx":1 * import os # <<<<<<<<<<<<<< - * from .platform import detect_cpus, BYTES_TYPE + * from .platform import detect_cpus * from cacheman.cachewrap import NonPersistentCache */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) diff --git a/hunspell/hunspell.pyx b/hunspell/hunspell.pyx index 781b157..e45e616 100644 --- a/hunspell/hunspell.pyx +++ b/hunspell/hunspell.pyx @@ -107,9 +107,8 @@ cdef class HunspellWrap(object): if not os.path.isfile(fpath) or not os.access(fpath, os.R_OK): raise IOError("File '{}' not found or accessible".format(fpath)) - if (copy_to_c_string(pyaffpath, &self.affpath) <= 0 or - copy_to_c_string(pydpath, &self.dpath) <= 0): - raise MemoryError() + copy_to_c_string(pyaffpath, &self.affpath) + copy_to_c_string(pydpath, &self.dpath) holder = new Hunspell(self.affpath, self.dpath) if holder is NULL: raise MemoryError() @@ -157,8 +156,7 @@ cdef class HunspellWrap(object): def spell(self, basestring word): # Python individual word spellcheck cdef char *c_word = NULL - if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - raise MemoryError() + copy_to_c_string(word, &c_word, self._dic_encoding) try: return self._cxx_hunspell.spell(c_word) != 0 finally: @@ -182,8 +180,7 @@ cdef class HunspellWrap(object): cdef char *c_word = NULL cdef list stem_list cdef tuple stem_result - if copy_to_c_string(word, &c_word, self._dic_encoding) <= 0: - raise MemoryError() + copy_to_c_string(word, &c_word, self._dic_encoding) try: if stem_action: @@ -328,8 +325,7 @@ cdef class HunspellWrap(object): if word_array is NULL: raise MemoryError() for i, unknown_word in enumerate(unknown_words): - if copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) <= 0: - raise MemoryError() + copy_to_c_string(unknown_word, &word_array[i], self._dic_encoding) try: # Create output arrays diff --git a/tests/hunspell_test.py b/tests/hunspell_test.py index 2c61892..2186467 100644 --- a/tests/hunspell_test.py +++ b/tests/hunspell_test.py @@ -23,39 +23,45 @@ def assertAllIn(self, checked, expected): self.assertTrue(all(x in expected for x in checked), u"{} not all found in {}".format(checked, expected)) - def test_hunspell_create_destroy(self): + def test_create_destroy(self): del self.h def test_missing_dict(self): with self.assertRaises(IOError): Hunspell('not_avail', hunspell_data_dir=DICT_DIR) - def test_hunspell_spell(self): + def test_spell(self): self.assertFalse(self.h.spell('dpg')) self.assertTrue(self.h.spell('dog')) - def test_hunspell_spell_utf8(self): + def test_spell_utf8(self): self.assertTrue(self.h.spell(u'café')) self.assertFalse(self.h.spell(u'uncafé')) - def test_hunspell_suggest(self): + def test_spell_empty(self): + self.assertTrue(self.h.spell('')) + + def test_suggest(self): required = ('dog', 'pg', 'deg', 'dig', 'dpt', 'dug', 'mpg', 'd pg') suggest = self.h.suggest('dpg') self.assertIsInstance(suggest, tuple) self.assertAllIn(required, suggest) - def test_hunspell_suggest_utf8(self): + def test_suggest_utf8(self): required = (u'café', u'Cerf') for variant in ('cefé', u'cefé'): suggest = self.h.suggest(variant) self.assertIsInstance(suggest, tuple) self.assertAllIn(required, suggest) - def test_hunspell_stem(self): + def test_suggest_empty(self): + self.assertEqual(self.h.suggest(''), ()) + + def test_stem(self): self.assertEqual(self.h.stem('dog'), ('dog',)) self.assertEqual(self.h.stem('permanently'), ('permanent',)) - def test_hunspell_bulk_suggest(self): + def test_bulk_suggest(self): self.h.set_concurrency(3) suggest = self.h.bulk_suggest(['dog', 'dpg']) self.assertEqual(sorted(suggest.keys()), ['dog', 'dpg']) @@ -70,7 +76,7 @@ def test_hunspell_bulk_suggest(self): suggest = self.h.bulk_suggest(checked) self.assertEqual(sorted(suggest.keys()), checked) - def test_hunspell_bulk_stem(self): + def test_bulk_stem(self): self.h.set_concurrency(3) self.assertDictEqual(self.h.bulk_stem(['dog', 'permanently']), { 'permanently': ('permanent',),