From 43117e971f2e30c60ff77614b51603f627e0c94b Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Wed, 19 Feb 2020 14:10:05 +0500 Subject: [PATCH] rebuild wrapper --- src/_base_types.cpp | 6 +- src/_completer.cpp | 6 +- src/_dawg.cpp | 6 +- src/_dawg_builder.cpp | 6 +- src/_dictionary.cpp | 6 +- src/_dictionary_builder.cpp | 6 +- src/_dictionary_unit.cpp | 6 +- src/_guide.cpp | 6 +- src/_guide_builder.cpp | 6 +- src/_guide_unit.cpp | 6 +- src/b64_decode.cpp | 6 +- src/dawg.cpp | 3733 +++++++++++++++++++---------------- src/iostream.cpp | 6 +- 13 files changed, 2045 insertions(+), 1760 deletions(-) diff --git a/src/_base_types.cpp b/src/_base_types.cpp index 51d3d8f..d8b598b 100644 --- a/src/_base_types.cpp +++ b/src/_base_types.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_completer.cpp b/src/_completer.cpp index a5ac57e..d3ae727 100644 --- a/src/_completer.cpp +++ b/src/_completer.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_dawg.cpp b/src/_dawg.cpp index a3181ea..8c58f3f 100644 --- a/src/_dawg.cpp +++ b/src/_dawg.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_dawg_builder.cpp b/src/_dawg_builder.cpp index 2905450..e8c228a 100644 --- a/src/_dawg_builder.cpp +++ b/src/_dawg_builder.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_dictionary.cpp b/src/_dictionary.cpp index ddea129..d9c259e 100644 --- a/src/_dictionary.cpp +++ b/src/_dictionary.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_dictionary_builder.cpp b/src/_dictionary_builder.cpp index eb40565..93f90c3 100644 --- a/src/_dictionary_builder.cpp +++ b/src/_dictionary_builder.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_dictionary_unit.cpp b/src/_dictionary_unit.cpp index 9ebe363..29a1b8a 100644 --- a/src/_dictionary_unit.cpp +++ b/src/_dictionary_unit.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_guide.cpp b/src/_guide.cpp index 0754e5d..727b001 100644 --- a/src/_guide.cpp +++ b/src/_guide.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_guide_builder.cpp b/src/_guide_builder.cpp index 2bb862e..61d97ed 100644 --- a/src/_guide_builder.cpp +++ b/src/_guide_builder.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/_guide_unit.cpp b/src/_guide_unit.cpp index 10955ce..d43356a 100644 --- a/src/_guide_unit.cpp +++ b/src/_guide_unit.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/b64_decode.cpp b/src/b64_decode.cpp index fff7bb5..33c41f8 100644 --- a/src/b64_decode.cpp +++ b/src/b64_decode.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof diff --git a/src/dawg.cpp b/src/dawg.cpp index 4f3fc61..7e9d536 100644 --- a/src/dawg.cpp +++ b/src/dawg.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -870,7 +870,7 @@ struct __pyx_opt_args_4dawg_7IntDAWG_get; struct __pyx_opt_args_4dawg_17IntCompletionDAWG_get; struct __pyx_opt_args_4dawg_17IntCompletionDAWG_items; -/* "dawg.pyx":303 +/* "dawg.pyx":307 * self.guide.Clear() * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -882,7 +882,7 @@ struct __pyx_opt_args_4dawg_14CompletionDAWG_keys { PyObject *prefix; }; -/* "dawg.pyx":522 +/* "dawg.pyx":526 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -894,7 +894,7 @@ struct __pyx_opt_args_4dawg_9BytesDAWG_get { PyObject *__pyx_default; }; -/* "dawg.pyx":578 +/* "dawg.pyx":582 * return self._value_for_index(index) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -906,7 +906,7 @@ struct __pyx_opt_args_4dawg_9BytesDAWG_items { PyObject *prefix; }; -/* "dawg.pyx":657 +/* "dawg.pyx":661 * yield (u_key, value) * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -918,7 +918,7 @@ struct __pyx_opt_args_4dawg_9BytesDAWG_keys { PyObject *prefix; }; -/* "dawg.pyx":842 +/* "dawg.pyx":846 * return [self._struct.unpack(val) for val in value] * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -930,7 +930,7 @@ struct __pyx_opt_args_4dawg_10RecordDAWG_items { PyObject *prefix; }; -/* "dawg.pyx":881 +/* "dawg.pyx":885 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -942,7 +942,7 @@ struct __pyx_opt_args_4dawg_7IntDAWG_get { PyObject *__pyx_default; }; -/* "dawg.pyx":925 +/* "dawg.pyx":929 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -954,7 +954,7 @@ struct __pyx_opt_args_4dawg_17IntCompletionDAWG_get { PyObject *__pyx_default; }; -/* "dawg.pyx":947 +/* "dawg.pyx":951 * return self.dct.Find(key) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -966,7 +966,7 @@ struct __pyx_opt_args_4dawg_17IntCompletionDAWG_items { PyObject *prefix; }; -/* "dawg.pyx":29 +/* "dawg.pyx":33 * * * cdef class DAWG: # <<<<<<<<<<<<<< @@ -981,7 +981,7 @@ struct __pyx_obj_4dawg_DAWG { }; -/* "dawg.pyx":289 +/* "dawg.pyx":293 * * * cdef class CompletionDAWG(DAWG): # <<<<<<<<<<<<<< @@ -994,7 +994,7 @@ struct __pyx_obj_4dawg_CompletionDAWG { }; -/* "dawg.pyx":456 +/* "dawg.pyx":460 * DEF MAX_VALUE_SIZE = 32768 * * cdef class BytesDAWG(CompletionDAWG): # <<<<<<<<<<<<<< @@ -1009,7 +1009,7 @@ struct __pyx_obj_4dawg_BytesDAWG { }; -/* "dawg.pyx":803 +/* "dawg.pyx":807 * * * cdef class RecordDAWG(BytesDAWG): # <<<<<<<<<<<<<< @@ -1022,7 +1022,7 @@ struct __pyx_obj_4dawg_RecordDAWG { }; -/* "dawg.pyx":862 +/* "dawg.pyx":866 * DEF LOOKUP_ERROR = -1 * * cdef class IntDAWG(DAWG): # <<<<<<<<<<<<<< @@ -1034,7 +1034,7 @@ struct __pyx_obj_4dawg_IntDAWG { }; -/* "dawg.pyx":905 +/* "dawg.pyx":909 * * # FIXME: code duplication. * cdef class IntCompletionDAWG(CompletionDAWG): # <<<<<<<<<<<<<< @@ -1046,7 +1046,7 @@ struct __pyx_obj_4dawg_IntCompletionDAWG { }; -/* "dawg.pyx":252 +/* "dawg.pyx":256 * return res * * def iterprefixes(self, unicode key): # <<<<<<<<<<<<<< @@ -1069,7 +1069,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct__iterprefixes { }; -/* "dawg.pyx":269 +/* "dawg.pyx":273 * * @classmethod * def compile_replaces(cls, replaces): # <<<<<<<<<<<<<< @@ -1082,7 +1082,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_1_compile_replaces { }; -/* "dawg.pyx":277 +/* "dawg.pyx":281 * return dict( * ( * k.encode('utf8'), # <<<<<<<<<<<<<< @@ -1097,7 +1097,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_2_genexpr { }; -/* "dawg.pyx":321 +/* "dawg.pyx":325 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -1115,7 +1115,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_3_iterkeys { }; -/* "dawg.pyx":469 +/* "dawg.pyx":473 * cdef Completer* _completer * * def __init__(self, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -1129,7 +1129,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_4___init__ { }; -/* "dawg.pyx":479 +/* "dawg.pyx":483 * self._c_payload_separator = ord(payload_separator) * * keys = (self._raw_key(d[0], d[1]) for d in arg) # <<<<<<<<<<<<<< @@ -1146,7 +1146,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_5_genexpr { }; -/* "dawg.pyx":620 +/* "dawg.pyx":624 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -1172,7 +1172,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_6_iteritems { }; -/* "dawg.pyx":682 +/* "dawg.pyx":686 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -1192,7 +1192,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_7_iterkeys { }; -/* "dawg.pyx":820 +/* "dawg.pyx":824 * cdef _struct * * def __init__(self, fmt, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -1206,7 +1206,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_8___init__ { }; -/* "dawg.pyx":835 +/* "dawg.pyx":839 * arg = [] * * keys = ((d[0], self._struct.pack(*d[1])) for d in arg) # <<<<<<<<<<<<<< @@ -1223,7 +1223,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_9_genexpr { }; -/* "dawg.pyx":846 +/* "dawg.pyx":850 * return [(key, self._struct.unpack(val)) for (key, val) in items] * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -1242,7 +1242,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_10_iteritems { }; -/* "dawg.pyx":851 +/* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< @@ -1255,9 +1255,9 @@ struct __pyx_obj_4dawg___pyx_scope_struct_11__iterable_from_argument { }; -/* "dawg.pyx":856 +/* "dawg.pyx":860 * - * if isinstance(arg, collections.Mapping): + * if isinstance(arg, Mapping): * return ((key, arg[key]) for key in arg) # <<<<<<<<<<<<<< * else: * return arg @@ -1272,7 +1272,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_12_genexpr { }; -/* "dawg.pyx":967 +/* "dawg.pyx":971 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -1292,7 +1292,7 @@ struct __pyx_obj_4dawg___pyx_scope_struct_13_iteritems { -/* "dawg.pyx":29 +/* "dawg.pyx":33 * * * cdef class DAWG: # <<<<<<<<<<<<<< @@ -1314,7 +1314,7 @@ struct __pyx_vtabstruct_4dawg_DAWG { static struct __pyx_vtabstruct_4dawg_DAWG *__pyx_vtabptr_4dawg_DAWG; -/* "dawg.pyx":289 +/* "dawg.pyx":293 * * * cdef class CompletionDAWG(DAWG): # <<<<<<<<<<<<<< @@ -1329,7 +1329,7 @@ struct __pyx_vtabstruct_4dawg_CompletionDAWG { static struct __pyx_vtabstruct_4dawg_CompletionDAWG *__pyx_vtabptr_4dawg_CompletionDAWG; -/* "dawg.pyx":456 +/* "dawg.pyx":460 * DEF MAX_VALUE_SIZE = 32768 * * cdef class BytesDAWG(CompletionDAWG): # <<<<<<<<<<<<<< @@ -1355,7 +1355,7 @@ struct __pyx_vtabstruct_4dawg_BytesDAWG { static struct __pyx_vtabstruct_4dawg_BytesDAWG *__pyx_vtabptr_4dawg_BytesDAWG; -/* "dawg.pyx":803 +/* "dawg.pyx":807 * * * cdef class RecordDAWG(BytesDAWG): # <<<<<<<<<<<<<< @@ -1369,7 +1369,7 @@ struct __pyx_vtabstruct_4dawg_RecordDAWG { static struct __pyx_vtabstruct_4dawg_RecordDAWG *__pyx_vtabptr_4dawg_RecordDAWG; -/* "dawg.pyx":862 +/* "dawg.pyx":866 * DEF LOOKUP_ERROR = -1 * * cdef class IntDAWG(DAWG): # <<<<<<<<<<<<<< @@ -1386,7 +1386,7 @@ struct __pyx_vtabstruct_4dawg_IntDAWG { static struct __pyx_vtabstruct_4dawg_IntDAWG *__pyx_vtabptr_4dawg_IntDAWG; -/* "dawg.pyx":905 +/* "dawg.pyx":909 * * # FIXME: code duplication. * cdef class IntCompletionDAWG(CompletionDAWG): # <<<<<<<<<<<<<< @@ -1935,6 +1935,14 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); @@ -1948,14 +1956,6 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj #include "descrobject.h" static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method); -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); @@ -2269,6 +2269,7 @@ extern int __pyx_module_is_main_dawg; int __pyx_module_is_main_dawg = 0; /* Implementation of 'dawg' */ +static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_open; @@ -2348,6 +2349,7 @@ static const char __pyx_k_b2a_base64[] = "b2a_base64"; static const char __pyx_k_b_prefixes[] = "b_prefixes"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_with_value[] = " (with value "; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_b_get_value[] = "b_get_value"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_iterprefixes[] = "iterprefixes"; @@ -2355,6 +2357,7 @@ static const char __pyx_k_similar_keys[] = "similar_keys"; static const char __pyx_k_src_dawg_pyx[] = "src/dawg.pyx"; static const char __pyx_k_similar_items[] = "similar_items"; static const char __pyx_k_CompletionDAWG[] = "CompletionDAWG"; +static const char __pyx_k_collections_abc[] = "collections.abc"; static const char __pyx_k_input_is_sorted[] = "input_is_sorted"; static const char __pyx_k_Can_t_insert_key[] = "Can't insert key "; static const char __pyx_k_compile_replaces[] = "compile_replaces"; @@ -2397,6 +2400,7 @@ static PyObject *__pyx_n_s_DAWG_iterprefixes; static PyObject *__pyx_n_s_Error; static PyObject *__pyx_kp_u_Error_building_completion_inform; static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_IntCompletionDAWG; static PyObject *__pyx_n_s_IntCompletionDAWG_iteritems; static PyObject *__pyx_n_s_IntDAWG; @@ -2430,6 +2434,7 @@ static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_collections_abc; static PyObject *__pyx_n_s_compile_replaces; static PyObject *__pyx_n_s_compile_replaces_locals_genexpr; static PyObject *__pyx_n_s_dawg; @@ -2596,7 +2601,7 @@ static PyObject *__pyx_tuple__14; static PyObject *__pyx_codeobj__15; /* Late includes */ -/* "dawg.pyx":36 +/* "dawg.pyx":40 * cdef _dawg.Dawg dawg * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -2643,7 +2648,7 @@ static int __pyx_pw_4dawg_4DAWG_1__init__(PyObject *__pyx_v_self, PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 40, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2660,7 +2665,7 @@ static int __pyx_pw_4dawg_4DAWG_1__init__(PyObject *__pyx_v_self, PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.DAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2688,7 +2693,7 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_arg); - /* "dawg.pyx":37 + /* "dawg.pyx":41 * * def __init__(self, arg=None, input_is_sorted=False): * if arg is None: # <<<<<<<<<<<<<< @@ -2699,19 +2704,19 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":38 + /* "dawg.pyx":42 * def __init__(self, arg=None, input_is_sorted=False): * if arg is None: * arg = [] # <<<<<<<<<<<<<< * if not input_is_sorted: * arg = [ */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":37 + /* "dawg.pyx":41 * * def __init__(self, arg=None, input_is_sorted=False): * if arg is None: # <<<<<<<<<<<<<< @@ -2720,28 +2725,28 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se */ } - /* "dawg.pyx":39 + /* "dawg.pyx":43 * if arg is None: * arg = [] * if not input_is_sorted: # <<<<<<<<<<<<<< * arg = [ * (key).encode('utf8') if isinstance(key, unicode) else key */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_input_is_sorted); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_input_is_sorted); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { - /* "dawg.pyx":40 + /* "dawg.pyx":44 * arg = [] * if not input_is_sorted: * arg = [ # <<<<<<<<<<<<<< * (key).encode('utf8') if isinstance(key, unicode) else key * for key in arg */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "dawg.pyx":42 + /* "dawg.pyx":46 * arg = [ * (key).encode('utf8') if isinstance(key, unicode) else key * for key in arg # <<<<<<<<<<<<<< @@ -2752,26 +2757,26 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __pyx_t_4 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 46, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 46, __pyx_L1_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -2781,7 +2786,7 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 42, __pyx_L1_error) + else __PYX_ERR(0, 46, __pyx_L1_error) } break; } @@ -2790,7 +2795,7 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":41 + /* "dawg.pyx":45 * if not input_is_sorted: * arg = [ * (key).encode('utf8') if isinstance(key, unicode) else key # <<<<<<<<<<<<<< @@ -2801,9 +2806,9 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se if ((__pyx_t_1 != 0)) { if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 41, __pyx_L1_error) + __PYX_ERR(0, 45, __pyx_L1_error) } - __pyx_t_8 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_key)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_key)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __pyx_t_8 = 0; @@ -2811,10 +2816,10 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __Pyx_INCREF(__pyx_v_key); __pyx_t_7 = __pyx_v_key; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 40, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":42 + /* "dawg.pyx":46 * arg = [ * (key).encode('utf8') if isinstance(key, unicode) else key * for key in arg # <<<<<<<<<<<<<< @@ -2826,14 +2831,14 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":44 + /* "dawg.pyx":48 * for key in arg * ] * arg.sort() # <<<<<<<<<<<<<< * self._build_from_iterable(arg) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -2847,12 +2852,12 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":39 + /* "dawg.pyx":43 * if arg is None: * arg = [] * if not input_is_sorted: # <<<<<<<<<<<<<< @@ -2861,14 +2866,14 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se */ } - /* "dawg.pyx":45 + /* "dawg.pyx":49 * ] * arg.sort() * self._build_from_iterable(arg) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build_from_iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build_from_iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -2882,12 +2887,12 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_arg) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_arg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":36 + /* "dawg.pyx":40 * cdef _dawg.Dawg dawg * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -2912,7 +2917,7 @@ static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_se return __pyx_r; } -/* "dawg.pyx":47 +/* "dawg.pyx":51 * self._build_from_iterable(arg) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2935,7 +2940,7 @@ static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "dawg.pyx":48 + /* "dawg.pyx":52 * * def __dealloc__(self): * self.dct.Clear() # <<<<<<<<<<<<<< @@ -2944,7 +2949,7 @@ static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx */ __pyx_v_self->dct.Clear(); - /* "dawg.pyx":49 + /* "dawg.pyx":53 * def __dealloc__(self): * self.dct.Clear() * self.dawg.Clear() # <<<<<<<<<<<<<< @@ -2953,7 +2958,7 @@ static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx */ __pyx_v_self->dawg.Clear(); - /* "dawg.pyx":47 + /* "dawg.pyx":51 * self._build_from_iterable(arg) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2965,7 +2970,7 @@ static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx __Pyx_RefNannyFinishContext(); } -/* "dawg.pyx":51 +/* "dawg.pyx":55 * self.dawg.Clear() * * def _build_from_iterable(self, iterable): # <<<<<<<<<<<<<< @@ -3011,7 +3016,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da PyObject *__pyx_t_15 = NULL; __Pyx_RefNannySetupContext("_build_from_iterable", 0); - /* "dawg.pyx":56 + /* "dawg.pyx":60 * cdef int value * * for key in iterable: # <<<<<<<<<<<<<< @@ -3022,26 +3027,26 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_1 = __pyx_v_iterable; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iterable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iterable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 60, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 60, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -3051,7 +3056,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 56, __pyx_L1_error) + else __PYX_ERR(0, 60, __pyx_L1_error) } break; } @@ -3060,7 +3065,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4); __pyx_t_4 = 0; - /* "dawg.pyx":57 + /* "dawg.pyx":61 * * for key in iterable: * if isinstance(key, tuple) or isinstance(key, list): # <<<<<<<<<<<<<< @@ -3080,7 +3085,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "dawg.pyx":58 + /* "dawg.pyx":62 * for key in iterable: * if isinstance(key, tuple) or isinstance(key, list): * key, value = key # <<<<<<<<<<<<<< @@ -3093,7 +3098,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 58, __pyx_L1_error) + __PYX_ERR(0, 62, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -3106,21 +3111,21 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -3128,16 +3133,16 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 58, __pyx_L1_error) + __PYX_ERR(0, 62, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_4); __pyx_t_4 = 0; __pyx_v_value = __pyx_t_11; - /* "dawg.pyx":59 + /* "dawg.pyx":63 * if isinstance(key, tuple) or isinstance(key, list): * key, value = key * if value < 0: # <<<<<<<<<<<<<< @@ -3147,20 +3152,20 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_5 = ((__pyx_v_value < 0) != 0); if (unlikely(__pyx_t_5)) { - /* "dawg.pyx":60 + /* "dawg.pyx":64 * key, value = key * if value < 0: * raise ValueError("Negative values are not supported") # <<<<<<<<<<<<<< * else: * value = 0 */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 60, __pyx_L1_error) + __PYX_ERR(0, 64, __pyx_L1_error) - /* "dawg.pyx":59 + /* "dawg.pyx":63 * if isinstance(key, tuple) or isinstance(key, list): * key, value = key * if value < 0: # <<<<<<<<<<<<<< @@ -3169,7 +3174,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ } - /* "dawg.pyx":57 + /* "dawg.pyx":61 * * for key in iterable: * if isinstance(key, tuple) or isinstance(key, list): # <<<<<<<<<<<<<< @@ -3179,7 +3184,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da goto __pyx_L5; } - /* "dawg.pyx":62 + /* "dawg.pyx":66 * raise ValueError("Negative values are not supported") * else: * value = 0 # <<<<<<<<<<<<<< @@ -3191,7 +3196,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da } __pyx_L5:; - /* "dawg.pyx":64 + /* "dawg.pyx":68 * value = 0 * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -3202,7 +3207,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "dawg.pyx":65 + /* "dawg.pyx":69 * * if isinstance(key, unicode): * b_key = (key).encode('utf8') # <<<<<<<<<<<<<< @@ -3211,9 +3216,9 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 65, __pyx_L1_error) + __PYX_ERR(0, 69, __pyx_L1_error) } - __pyx_t_8 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_key)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_8 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_key)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); @@ -3221,7 +3226,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __Pyx_XDECREF_SET(__pyx_v_b_key, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "dawg.pyx":64 + /* "dawg.pyx":68 * value = 0 * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -3231,7 +3236,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da goto __pyx_L11; } - /* "dawg.pyx":67 + /* "dawg.pyx":71 * b_key = (key).encode('utf8') * else: * b_key = key # <<<<<<<<<<<<<< @@ -3239,7 +3244,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da * if not dawg_builder.Insert(b_key, len(b_key), value): */ /*else*/ { - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 67, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_t_4 = __pyx_v_key; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_b_key, ((PyObject*)__pyx_t_4)); @@ -3247,7 +3252,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da } __pyx_L11:; - /* "dawg.pyx":69 + /* "dawg.pyx":73 * b_key = key * * if not dawg_builder.Insert(b_key, len(b_key), value): # <<<<<<<<<<<<<< @@ -3256,27 +3261,27 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 69, __pyx_L1_error) + __PYX_ERR(0, 73, __pyx_L1_error) } - __pyx_t_12 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 69, __pyx_L1_error) + __PYX_ERR(0, 73, __pyx_L1_error) } - __pyx_t_13 = PyBytes_GET_SIZE(__pyx_v_b_key); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_13 = PyBytes_GET_SIZE(__pyx_v_b_key); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_dawg_builder.Insert(__pyx_t_12, __pyx_t_13, __pyx_v_value) != 0)) != 0); if (unlikely(__pyx_t_6)) { - /* "dawg.pyx":70 + /* "dawg.pyx":74 * * if not dawg_builder.Insert(b_key, len(b_key), value): * raise Error("Can't insert key %r (with value %r)" % (b_key, value)) # <<<<<<<<<<<<<< * * if not dawg_builder.Finish(&self.dawg): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = 0; __pyx_t_14 = 127; @@ -3284,7 +3289,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_13 += 17; __Pyx_GIVEREF(__pyx_kp_u_Can_t_insert_key); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_u_Can_t_insert_key); - __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_b_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_b_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); @@ -3295,7 +3300,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_13 += 13; __Pyx_GIVEREF(__pyx_kp_u_with_value); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u_with_value); - __pyx_t_15 = __Pyx_PyUnicode_From_int(__pyx_v_value, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyUnicode_From_int(__pyx_v_value, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); @@ -3305,7 +3310,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_13 += 1; __Pyx_GIVEREF(__pyx_kp_u__2); PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_kp_u__2); - __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_9, 5, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_9, 5, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -3321,14 +3326,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_15); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 70, __pyx_L1_error) + __PYX_ERR(0, 74, __pyx_L1_error) - /* "dawg.pyx":69 + /* "dawg.pyx":73 * b_key = key * * if not dawg_builder.Insert(b_key, len(b_key), value): # <<<<<<<<<<<<<< @@ -3337,7 +3342,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ } - /* "dawg.pyx":56 + /* "dawg.pyx":60 * cdef int value * * for key in iterable: # <<<<<<<<<<<<<< @@ -3347,7 +3352,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":72 + /* "dawg.pyx":76 * raise Error("Can't insert key %r (with value %r)" % (b_key, value)) * * if not dawg_builder.Finish(&self.dawg): # <<<<<<<<<<<<<< @@ -3357,14 +3362,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_6 = ((!(__pyx_v_dawg_builder.Finish((&__pyx_v_self->dawg)) != 0)) != 0); if (unlikely(__pyx_t_6)) { - /* "dawg.pyx":73 + /* "dawg.pyx":77 * * if not dawg_builder.Finish(&self.dawg): * raise Error("dawg_builder.Finish error") # <<<<<<<<<<<<<< * * if not _dictionary_builder.Build(self.dawg, &self.dct): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -3378,14 +3383,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_kp_u_dawg_builder_Finish_error) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_dawg_builder_Finish_error); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 73, __pyx_L1_error) + __PYX_ERR(0, 77, __pyx_L1_error) - /* "dawg.pyx":72 + /* "dawg.pyx":76 * raise Error("Can't insert key %r (with value %r)" % (b_key, value)) * * if not dawg_builder.Finish(&self.dawg): # <<<<<<<<<<<<<< @@ -3394,7 +3399,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ } - /* "dawg.pyx":75 + /* "dawg.pyx":79 * raise Error("dawg_builder.Finish error") * * if not _dictionary_builder.Build(self.dawg, &self.dct): # <<<<<<<<<<<<<< @@ -3404,14 +3409,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da __pyx_t_6 = ((!(dawgdic::DictionaryBuilder::Build(__pyx_v_self->dawg, (&__pyx_v_self->dct)) != 0)) != 0); if (unlikely(__pyx_t_6)) { - /* "dawg.pyx":76 + /* "dawg.pyx":80 * * if not _dictionary_builder.Build(self.dawg, &self.dct): * raise Error("Can't build dictionary") # <<<<<<<<<<<<<< * * def __contains__(self, key): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -3425,14 +3430,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_kp_u_Can_t_build_dictionary) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Can_t_build_dictionary); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 76, __pyx_L1_error) + __PYX_ERR(0, 80, __pyx_L1_error) - /* "dawg.pyx":75 + /* "dawg.pyx":79 * raise Error("dawg_builder.Finish error") * * if not _dictionary_builder.Build(self.dawg, &self.dct): # <<<<<<<<<<<<<< @@ -3441,7 +3446,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da */ } - /* "dawg.pyx":51 + /* "dawg.pyx":55 * self.dawg.Clear() * * def _build_from_iterable(self, iterable): # <<<<<<<<<<<<<< @@ -3468,7 +3473,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4da return __pyx_r; } -/* "dawg.pyx":78 +/* "dawg.pyx":82 * raise Error("Can't build dictionary") * * def __contains__(self, key): # <<<<<<<<<<<<<< @@ -3496,7 +3501,7 @@ static int __pyx_pf_4dawg_4DAWG_6__contains__(struct __pyx_obj_4dawg_DAWG *__pyx int __pyx_t_2; __Pyx_RefNannySetupContext("__contains__", 0); - /* "dawg.pyx":79 + /* "dawg.pyx":83 * * def __contains__(self, key): * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -3507,18 +3512,18 @@ static int __pyx_pf_4dawg_4DAWG_6__contains__(struct __pyx_obj_4dawg_DAWG *__pyx __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":80 + /* "dawg.pyx":84 * def __contains__(self, key): * if isinstance(key, unicode): * return self.has_key(key) # <<<<<<<<<<<<<< * return self.b_has_key(key) * */ - __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->has_key(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->has_key(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; - /* "dawg.pyx":79 + /* "dawg.pyx":83 * * def __contains__(self, key): * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -3527,19 +3532,19 @@ static int __pyx_pf_4dawg_4DAWG_6__contains__(struct __pyx_obj_4dawg_DAWG *__pyx */ } - /* "dawg.pyx":81 + /* "dawg.pyx":85 * if isinstance(key, unicode): * return self.has_key(key) * return self.b_has_key(key) # <<<<<<<<<<<<<< * * cpdef bint has_key(self, unicode key) except -1: */ - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 81, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_has_key(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 81, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_has_key(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; - /* "dawg.pyx":78 + /* "dawg.pyx":82 * raise Error("Can't build dictionary") * * def __contains__(self, key): # <<<<<<<<<<<<<< @@ -3556,7 +3561,7 @@ static int __pyx_pf_4dawg_4DAWG_6__contains__(struct __pyx_obj_4dawg_DAWG *__pyx return __pyx_r; } -/* "dawg.pyx":83 +/* "dawg.pyx":87 * return self.b_has_key(key) * * cpdef bint has_key(self, unicode key) except -1: # <<<<<<<<<<<<<< @@ -3583,7 +3588,7 @@ static int __pyx_f_4dawg_4DAWG_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_self if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_9has_key)) { __Pyx_INCREF(__pyx_t_1); @@ -3599,10 +3604,10 @@ static int __pyx_f_4dawg_4DAWG_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_self } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3621,7 +3626,7 @@ static int __pyx_f_4dawg_4DAWG_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_self #endif } - /* "dawg.pyx":84 + /* "dawg.pyx":88 * * cpdef bint has_key(self, unicode key) except -1: * return self.b_has_key(key.encode('utf8')) # <<<<<<<<<<<<<< @@ -3630,16 +3635,16 @@ static int __pyx_f_4dawg_4DAWG_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_self */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 88, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_has_key(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_has_key(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; goto __pyx_L0; - /* "dawg.pyx":83 + /* "dawg.pyx":87 * return self.b_has_key(key) * * cpdef bint has_key(self, unicode key) except -1: # <<<<<<<<<<<<<< @@ -3667,7 +3672,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_9has_key(PyObject *__pyx_v_self, PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_key (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_8has_key(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -3686,8 +3691,8 @@ static PyObject *__pyx_pf_4dawg_4DAWG_8has_key(struct __pyx_obj_4dawg_DAWG *__py PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("has_key", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3704,7 +3709,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_8has_key(struct __pyx_obj_4dawg_DAWG *__py return __pyx_r; } -/* "dawg.pyx":86 +/* "dawg.pyx":90 * return self.b_has_key(key.encode('utf8')) * * cpdef bint b_has_key(self, bytes key) except -1: # <<<<<<<<<<<<<< @@ -3733,7 +3738,7 @@ static int __pyx_f_4dawg_4DAWG_b_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_se if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_11b_has_key)) { __Pyx_INCREF(__pyx_t_1); @@ -3749,10 +3754,10 @@ static int __pyx_f_4dawg_4DAWG_b_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_se } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3771,7 +3776,7 @@ static int __pyx_f_4dawg_4DAWG_b_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_se #endif } - /* "dawg.pyx":87 + /* "dawg.pyx":91 * * cpdef bint b_has_key(self, bytes key) except -1: * return self.dct.Contains(key, len(key)) # <<<<<<<<<<<<<< @@ -3780,18 +3785,18 @@ static int __pyx_f_4dawg_4DAWG_b_has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_se */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 87, __pyx_L1_error) + __PYX_ERR(0, 91, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 87, __pyx_L1_error) + __PYX_ERR(0, 91, __pyx_L1_error) } - __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_7 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_r = __pyx_v_self->dct.Contains(__pyx_t_6, __pyx_t_7); goto __pyx_L0; - /* "dawg.pyx":86 + /* "dawg.pyx":90 * return self.b_has_key(key.encode('utf8')) * * cpdef bint b_has_key(self, bytes key) except -1: # <<<<<<<<<<<<<< @@ -3819,7 +3824,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_11b_has_key(PyObject *__pyx_v_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_has_key (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 86, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_10b_has_key(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -3838,8 +3843,8 @@ static PyObject *__pyx_pf_4dawg_4DAWG_10b_has_key(struct __pyx_obj_4dawg_DAWG *_ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("b_has_key", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_b_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_b_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -3856,7 +3861,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_10b_has_key(struct __pyx_obj_4dawg_DAWG *_ return __pyx_r; } -/* "dawg.pyx":89 +/* "dawg.pyx":93 * return self.dct.Contains(key, len(key)) * * cpdef bytes tobytes(self) except +: # <<<<<<<<<<<<<< @@ -3884,7 +3889,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_tobytes(struct __pyx_obj_4dawg_DAWG *__pyx_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_13tobytes)) { __Pyx_XDECREF(__pyx_r); @@ -3901,10 +3906,10 @@ static PyObject *__pyx_f_4dawg_4DAWG_tobytes(struct __pyx_obj_4dawg_DAWG *__pyx_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 89, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 93, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3923,7 +3928,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_tobytes(struct __pyx_obj_4dawg_DAWG *__pyx_ #endif } - /* "dawg.pyx":94 + /* "dawg.pyx":98 * """ * cdef stringstream stream * self.dct.Write( &stream) # <<<<<<<<<<<<<< @@ -3934,22 +3939,22 @@ static PyObject *__pyx_f_4dawg_4DAWG_tobytes(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_v_self->dct.Write(((std::ostream *)(&__pyx_v_stream))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 94, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) } - /* "dawg.pyx":95 + /* "dawg.pyx":99 * cdef stringstream stream * self.dct.Write( &stream) * cdef bytes res = stream.str() # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":96 + /* "dawg.pyx":100 * self.dct.Write( &stream) * cdef bytes res = stream.str() * return res # <<<<<<<<<<<<<< @@ -3961,7 +3966,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_tobytes(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":89 + /* "dawg.pyx":93 * return self.dct.Contains(key, len(key)) * * cpdef bytes tobytes(self) except +: # <<<<<<<<<<<<<< @@ -4006,10 +4011,10 @@ static PyObject *__pyx_pf_4dawg_4DAWG_12tobytes(struct __pyx_obj_4dawg_DAWG *__p __Pyx_XDECREF(__pyx_r); try { __pyx_t_1 = __pyx_f_4dawg_4DAWG_tobytes(__pyx_v_self, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 89, __pyx_L1_error) + __PYX_ERR(0, 93, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -4027,7 +4032,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_12tobytes(struct __pyx_obj_4dawg_DAWG *__p return __pyx_r; } -/* "dawg.pyx":98 +/* "dawg.pyx":102 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -4067,7 +4072,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_15frombytes)) { __Pyx_XDECREF(__pyx_r); @@ -4084,7 +4089,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -4105,17 +4110,17 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py #endif } - /* "dawg.pyx":106 + /* "dawg.pyx":110 * using ``.load``). * """ * cdef string s_data = data # <<<<<<<<<<<<<< * cdef stringstream* stream = new stringstream(s_data) * */ - __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error) __pyx_v_s_data = __pyx_t_5; - /* "dawg.pyx":107 + /* "dawg.pyx":111 * """ * cdef string s_data = data * cdef stringstream* stream = new stringstream(s_data) # <<<<<<<<<<<<<< @@ -4124,7 +4129,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py */ __pyx_v_stream = new std::stringstream(__pyx_v_s_data); - /* "dawg.pyx":109 + /* "dawg.pyx":113 * cdef stringstream* stream = new stringstream(s_data) * * try: # <<<<<<<<<<<<<< @@ -4133,7 +4138,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py */ /*try:*/ { - /* "dawg.pyx":110 + /* "dawg.pyx":114 * * try: * res = self.dct.Read( stream) # <<<<<<<<<<<<<< @@ -4144,11 +4149,11 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py __pyx_t_6 = __pyx_v_self->dct.Read(((std::istream *)__pyx_v_stream)); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 110, __pyx_L4_error) + __PYX_ERR(0, 114, __pyx_L4_error) } __pyx_v_res = __pyx_t_6; - /* "dawg.pyx":112 + /* "dawg.pyx":116 * res = self.dct.Read( stream) * * if not res: # <<<<<<<<<<<<<< @@ -4158,7 +4163,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py __pyx_t_6 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_6)) { - /* "dawg.pyx":113 + /* "dawg.pyx":117 * * if not res: * self.dct.Clear() # <<<<<<<<<<<<<< @@ -4167,20 +4172,20 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py */ __pyx_v_self->dct.Clear(); - /* "dawg.pyx":114 + /* "dawg.pyx":118 * if not res: * self.dct.Clear() * raise IOError("Invalid data format") # <<<<<<<<<<<<<< * * return self */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L4_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 114, __pyx_L4_error) + __PYX_ERR(0, 118, __pyx_L4_error) - /* "dawg.pyx":112 + /* "dawg.pyx":116 * res = self.dct.Read( stream) * * if not res: # <<<<<<<<<<<<<< @@ -4189,7 +4194,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py */ } - /* "dawg.pyx":116 + /* "dawg.pyx":120 * raise IOError("Invalid data format") * * return self # <<<<<<<<<<<<<< @@ -4202,7 +4207,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py goto __pyx_L3_return; } - /* "dawg.pyx":118 + /* "dawg.pyx":122 * return self * finally: * del stream # <<<<<<<<<<<<<< @@ -4255,7 +4260,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_frombytes(struct __pyx_obj_4dawg_DAWG *__py } } - /* "dawg.pyx":98 + /* "dawg.pyx":102 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -4284,7 +4289,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_15frombytes(PyObject *__pyx_v_self, PyObje PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("frombytes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 102, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_14frombytes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_data)); /* function exit code */ @@ -4302,7 +4307,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_14frombytes(struct __pyx_obj_4dawg_DAWG *_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("frombytes", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4319,7 +4324,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_14frombytes(struct __pyx_obj_4dawg_DAWG *_ return __pyx_r; } -/* "dawg.pyx":120 +/* "dawg.pyx":124 * del stream * * def read(self, f): # <<<<<<<<<<<<<< @@ -4349,14 +4354,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_16read(struct __pyx_obj_4dawg_DAWG *__pyx_ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read", 0); - /* "dawg.pyx":126 + /* "dawg.pyx":130 * FIXME: this method should'n read the whole stream. * """ * self.frombytes(f.read()) # <<<<<<<<<<<<<< * * def write(self, f): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4370,16 +4375,16 @@ static PyObject *__pyx_pf_4dawg_4DAWG_16read(struct __pyx_obj_4dawg_DAWG *__pyx_ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->frombytes(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->frombytes(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":120 + /* "dawg.pyx":124 * del stream * * def read(self, f): # <<<<<<<<<<<<<< @@ -4402,7 +4407,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_16read(struct __pyx_obj_4dawg_DAWG *__pyx_ return __pyx_r; } -/* "dawg.pyx":128 +/* "dawg.pyx":132 * self.frombytes(f.read()) * * def write(self, f): # <<<<<<<<<<<<<< @@ -4433,21 +4438,21 @@ static PyObject *__pyx_pf_4dawg_4DAWG_18write(struct __pyx_obj_4dawg_DAWG *__pyx PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("write", 0); - /* "dawg.pyx":132 + /* "dawg.pyx":136 * Write DAWG to a file-like object. * """ * f.write(self.tobytes()) # <<<<<<<<<<<<<< * * def load(self, path): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); try { __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->tobytes(__pyx_v_self, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 132, __pyx_L1_error) + __PYX_ERR(0, 136, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; @@ -4463,12 +4468,12 @@ static PyObject *__pyx_pf_4dawg_4DAWG_18write(struct __pyx_obj_4dawg_DAWG *__pyx __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":128 + /* "dawg.pyx":132 * self.frombytes(f.read()) * * def write(self, f): # <<<<<<<<<<<<<< @@ -4492,7 +4497,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_18write(struct __pyx_obj_4dawg_DAWG *__pyx return __pyx_r; } -/* "dawg.pyx":134 +/* "dawg.pyx":138 * f.write(self.tobytes()) * * def load(self, path): # <<<<<<<<<<<<<< @@ -4531,7 +4536,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_path); - /* "dawg.pyx":138 + /* "dawg.pyx":142 * Load DAWG from a file. * """ * if isinstance(path, unicode): # <<<<<<<<<<<<<< @@ -4542,18 +4547,18 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":139 + /* "dawg.pyx":143 * """ * if isinstance(path, unicode): * path = path.encode(sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * * cdef ifstream stream */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -4568,7 +4573,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -4584,13 +4589,13 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":138 + /* "dawg.pyx":142 * Load DAWG from a file. * """ * if isinstance(path, unicode): # <<<<<<<<<<<<<< @@ -4599,22 +4604,22 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ */ } - /* "dawg.pyx":142 + /* "dawg.pyx":146 * * cdef ifstream stream * stream.open(path, iostream.binary) # <<<<<<<<<<<<<< * if stream.fail(): * raise IOError("It's not possible to read file stream") */ - __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) try { __pyx_v_stream.open(__pyx_t_8, std::stringstream::binary); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 146, __pyx_L1_error) } - /* "dawg.pyx":143 + /* "dawg.pyx":147 * cdef ifstream stream * stream.open(path, iostream.binary) * if stream.fail(): # <<<<<<<<<<<<<< @@ -4625,25 +4630,25 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_t_9 = __pyx_v_stream.fail(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 143, __pyx_L1_error) + __PYX_ERR(0, 147, __pyx_L1_error) } __pyx_t_2 = (__pyx_t_9 != 0); if (unlikely(__pyx_t_2)) { - /* "dawg.pyx":144 + /* "dawg.pyx":148 * stream.open(path, iostream.binary) * if stream.fail(): * raise IOError("It's not possible to read file stream") # <<<<<<<<<<<<<< * * res = self.dct.Read( &stream) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 148, __pyx_L1_error) - /* "dawg.pyx":143 + /* "dawg.pyx":147 * cdef ifstream stream * stream.open(path, iostream.binary) * if stream.fail(): # <<<<<<<<<<<<<< @@ -4652,7 +4657,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ */ } - /* "dawg.pyx":146 + /* "dawg.pyx":150 * raise IOError("It's not possible to read file stream") * * res = self.dct.Read( &stream) # <<<<<<<<<<<<<< @@ -4663,11 +4668,11 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_t_2 = __pyx_v_self->dct.Read(((std::istream *)(&__pyx_v_stream))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 146, __pyx_L1_error) + __PYX_ERR(0, 150, __pyx_L1_error) } __pyx_v_res = __pyx_t_2; - /* "dawg.pyx":148 + /* "dawg.pyx":152 * res = self.dct.Read( &stream) * * stream.close() # <<<<<<<<<<<<<< @@ -4678,10 +4683,10 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_v_stream.close(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 148, __pyx_L1_error) + __PYX_ERR(0, 152, __pyx_L1_error) } - /* "dawg.pyx":150 + /* "dawg.pyx":154 * stream.close() * * if not res: # <<<<<<<<<<<<<< @@ -4691,7 +4696,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_t_2 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "dawg.pyx":151 + /* "dawg.pyx":155 * * if not res: * self.dct.Clear() # <<<<<<<<<<<<<< @@ -4700,20 +4705,20 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ */ __pyx_v_self->dct.Clear(); - /* "dawg.pyx":152 + /* "dawg.pyx":156 * if not res: * self.dct.Clear() * raise IOError("Invalid data format") # <<<<<<<<<<<<<< * * return self */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 152, __pyx_L1_error) + __PYX_ERR(0, 156, __pyx_L1_error) - /* "dawg.pyx":150 + /* "dawg.pyx":154 * stream.close() * * if not res: # <<<<<<<<<<<<<< @@ -4722,7 +4727,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ */ } - /* "dawg.pyx":154 + /* "dawg.pyx":158 * raise IOError("Invalid data format") * * return self # <<<<<<<<<<<<<< @@ -4734,7 +4739,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dawg.pyx":134 + /* "dawg.pyx":138 * f.write(self.tobytes()) * * def load(self, path): # <<<<<<<<<<<<<< @@ -4758,7 +4763,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_20load(struct __pyx_obj_4dawg_DAWG *__pyx_ return __pyx_r; } -/* "dawg.pyx":156 +/* "dawg.pyx":160 * return self * * def save(self, path): # <<<<<<<<<<<<<< @@ -4797,7 +4802,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ int __pyx_t_11; __Pyx_RefNannySetupContext("save", 0); - /* "dawg.pyx":160 + /* "dawg.pyx":164 * Save DAWG to a file. * """ * with open(path, 'wb') as f: # <<<<<<<<<<<<<< @@ -4805,7 +4810,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ * */ /*with:*/ { - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); @@ -4813,12 +4818,12 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ __Pyx_INCREF(__pyx_n_u_wb); __Pyx_GIVEREF(__pyx_n_u_wb); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_wb); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L3_error) + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -4832,7 +4837,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L3_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_t_1; @@ -4850,14 +4855,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_v_f = __pyx_t_4; __pyx_t_4 = 0; - /* "dawg.pyx":161 + /* "dawg.pyx":165 * """ * with open(path, 'wb') as f: * self.write(f) # <<<<<<<<<<<<<< * * # pickling support */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -4871,12 +4876,12 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ } __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_f) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_f); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L7_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dawg.pyx":160 + /* "dawg.pyx":164 * Save DAWG to a file. * """ * with open(path, 'wb') as f: # <<<<<<<<<<<<<< @@ -4895,20 +4900,20 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("dawg.DAWG.save", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L9_except_error) + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 164, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L9_except_error) + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 160, __pyx_L9_except_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_10 < 0) __PYX_ERR(0, 160, __pyx_L9_except_error) + if (__pyx_t_10 < 0) __PYX_ERR(0, 164, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_4); @@ -4916,7 +4921,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_1); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 160, __pyx_L9_except_error) + __PYX_ERR(0, 164, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4942,7 +4947,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ if (__pyx_t_3) { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__5, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -4957,7 +4962,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ __pyx_L16:; } - /* "dawg.pyx":156 + /* "dawg.pyx":160 * return self * * def save(self, path): # <<<<<<<<<<<<<< @@ -4982,7 +4987,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_22save(struct __pyx_obj_4dawg_DAWG *__pyx_ return __pyx_r; } -/* "dawg.pyx":164 +/* "dawg.pyx":168 * * # pickling support * def __reduce__(self): # <<<<<<<<<<<<<< @@ -5013,7 +5018,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_24__reduce__(struct __pyx_obj_4dawg_DAWG * PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "dawg.pyx":165 + /* "dawg.pyx":169 * # pickling support * def __reduce__(self): * return self.__class__, tuple(), self.tobytes() # <<<<<<<<<<<<<< @@ -5021,19 +5026,19 @@ static PyObject *__pyx_pf_4dawg_4DAWG_24__reduce__(struct __pyx_obj_4dawg_DAWG * * def __setstate__(self, state): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); try { __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->tobytes(__pyx_v_self, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 165, __pyx_L1_error) + __PYX_ERR(0, 169, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -5048,7 +5053,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_24__reduce__(struct __pyx_obj_4dawg_DAWG * __pyx_t_4 = 0; goto __pyx_L0; - /* "dawg.pyx":164 + /* "dawg.pyx":168 * * # pickling support * def __reduce__(self): # <<<<<<<<<<<<<< @@ -5070,7 +5075,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_24__reduce__(struct __pyx_obj_4dawg_DAWG * return __pyx_r; } -/* "dawg.pyx":167 +/* "dawg.pyx":171 * return self.__class__, tuple(), self.tobytes() * * def __setstate__(self, state): # <<<<<<<<<<<<<< @@ -5098,19 +5103,19 @@ static PyObject *__pyx_pf_4dawg_4DAWG_26__setstate__(struct __pyx_obj_4dawg_DAWG PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate__", 0); - /* "dawg.pyx":168 + /* "dawg.pyx":172 * * def __setstate__(self, state): * self.frombytes(state) # <<<<<<<<<<<<<< * * # half-internal methods */ - if (!(likely(PyBytes_CheckExact(__pyx_v_state))||((__pyx_v_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_state)->tp_name), 0))) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->frombytes(__pyx_v_self, ((PyObject*)__pyx_v_state), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_state))||((__pyx_v_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_state)->tp_name), 0))) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->frombytes(__pyx_v_self, ((PyObject*)__pyx_v_state), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":167 + /* "dawg.pyx":171 * return self.__class__, tuple(), self.tobytes() * * def __setstate__(self, state): # <<<<<<<<<<<<<< @@ -5131,7 +5136,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_26__setstate__(struct __pyx_obj_4dawg_DAWG return __pyx_r; } -/* "dawg.pyx":171 +/* "dawg.pyx":175 * * # half-internal methods * def _size(self): # <<<<<<<<<<<<<< @@ -5159,7 +5164,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_28_size(struct __pyx_obj_4dawg_DAWG *__pyx PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_size", 0); - /* "dawg.pyx":172 + /* "dawg.pyx":176 * # half-internal methods * def _size(self): * return self.dct.size() # <<<<<<<<<<<<<< @@ -5167,13 +5172,13 @@ static PyObject *__pyx_pf_4dawg_4DAWG_28_size(struct __pyx_obj_4dawg_DAWG *__pyx * def _total_size(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":171 + /* "dawg.pyx":175 * * # half-internal methods * def _size(self): # <<<<<<<<<<<<<< @@ -5192,7 +5197,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_28_size(struct __pyx_obj_4dawg_DAWG *__pyx return __pyx_r; } -/* "dawg.pyx":174 +/* "dawg.pyx":178 * return self.dct.size() * * def _total_size(self): # <<<<<<<<<<<<<< @@ -5220,7 +5225,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_30_total_size(struct __pyx_obj_4dawg_DAWG PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_total_size", 0); - /* "dawg.pyx":175 + /* "dawg.pyx":179 * * def _total_size(self): * return self.dct.total_size() # <<<<<<<<<<<<<< @@ -5228,13 +5233,13 @@ static PyObject *__pyx_pf_4dawg_4DAWG_30_total_size(struct __pyx_obj_4dawg_DAWG * def _file_size(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.total_size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.total_size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":174 + /* "dawg.pyx":178 * return self.dct.size() * * def _total_size(self): # <<<<<<<<<<<<<< @@ -5253,7 +5258,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_30_total_size(struct __pyx_obj_4dawg_DAWG return __pyx_r; } -/* "dawg.pyx":177 +/* "dawg.pyx":181 * return self.dct.total_size() * * def _file_size(self): # <<<<<<<<<<<<<< @@ -5281,7 +5286,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_32_file_size(struct __pyx_obj_4dawg_DAWG * PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_file_size", 0); - /* "dawg.pyx":178 + /* "dawg.pyx":182 * * def _file_size(self): * return self.dct.file_size() # <<<<<<<<<<<<<< @@ -5289,13 +5294,13 @@ static PyObject *__pyx_pf_4dawg_4DAWG_32_file_size(struct __pyx_obj_4dawg_DAWG * * cdef bint _has_value(self, BaseType index): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.file_size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_SizeType(__pyx_v_self->dct.file_size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":177 + /* "dawg.pyx":181 * return self.dct.total_size() * * def _file_size(self): # <<<<<<<<<<<<<< @@ -5314,7 +5319,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_32_file_size(struct __pyx_obj_4dawg_DAWG * return __pyx_r; } -/* "dawg.pyx":180 +/* "dawg.pyx":184 * return self.dct.file_size() * * cdef bint _has_value(self, BaseType index): # <<<<<<<<<<<<<< @@ -5327,7 +5332,7 @@ static int __pyx_f_4dawg_4DAWG__has_value(struct __pyx_obj_4dawg_DAWG *__pyx_v_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_has_value", 0); - /* "dawg.pyx":181 + /* "dawg.pyx":185 * * cdef bint _has_value(self, BaseType index): * return self.dct.has_value(index) # <<<<<<<<<<<<<< @@ -5337,7 +5342,7 @@ static int __pyx_f_4dawg_4DAWG__has_value(struct __pyx_obj_4dawg_DAWG *__pyx_v_s __pyx_r = __pyx_v_self->dct.has_value(__pyx_v_index); goto __pyx_L0; - /* "dawg.pyx":180 + /* "dawg.pyx":184 * return self.dct.file_size() * * cdef bint _has_value(self, BaseType index): # <<<<<<<<<<<<<< @@ -5351,7 +5356,7 @@ static int __pyx_f_4dawg_4DAWG__has_value(struct __pyx_obj_4dawg_DAWG *__pyx_v_s return __pyx_r; } -/* "dawg.pyx":183 +/* "dawg.pyx":187 * return self.dct.has_value(index) * * cdef list _similar_keys(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -5385,7 +5390,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * int __pyx_t_9; __Pyx_RefNannySetupContext("_similar_keys", 0); - /* "dawg.pyx":184 + /* "dawg.pyx":188 * * cdef list _similar_keys(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): * cdef BaseType next_index, index = cur_index # <<<<<<<<<<<<<< @@ -5394,19 +5399,19 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ __pyx_v_index = __pyx_v_cur_index; - /* "dawg.pyx":187 + /* "dawg.pyx":191 * cdef unicode prefix, u_replace_char, found_key * cdef bytes b_step, b_replace_char * cdef list res = [] # <<<<<<<<<<<<<< * cdef list extra_keys * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":190 + /* "dawg.pyx":194 * cdef list extra_keys * * cdef int start_pos = len(current_prefix) # <<<<<<<<<<<<<< @@ -5415,12 +5420,12 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_current_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 190, __pyx_L1_error) + __PYX_ERR(0, 194, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_current_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_current_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_start_pos = __pyx_t_2; - /* "dawg.pyx":191 + /* "dawg.pyx":195 * * cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) # <<<<<<<<<<<<<< @@ -5429,12 +5434,12 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 191, __pyx_L1_error) + __PYX_ERR(0, 195, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_v_end_pos = __pyx_t_2; - /* "dawg.pyx":192 + /* "dawg.pyx":196 * cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) * cdef int word_pos = start_pos # <<<<<<<<<<<<<< @@ -5443,7 +5448,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ __pyx_v_word_pos = __pyx_v_start_pos; - /* "dawg.pyx":194 + /* "dawg.pyx":198 * cdef int word_pos = start_pos * * while word_pos < end_pos: # <<<<<<<<<<<<<< @@ -5454,17 +5459,17 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __pyx_t_3 = ((__pyx_v_word_pos < __pyx_v_end_pos) != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":195 + /* "dawg.pyx":199 * * while word_pos < end_pos: * b_step = (key[word_pos].encode('utf8')) # <<<<<<<<<<<<<< * * if b_step in replace_chars: */ - __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 195, __pyx_L1_error) - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_5; @@ -5473,7 +5478,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __Pyx_XDECREF_SET(__pyx_v_b_step, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "dawg.pyx":197 + /* "dawg.pyx":201 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -5482,13 +5487,13 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 197, __pyx_L1_error) + __PYX_ERR(0, 201, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 != 0); if (__pyx_t_6) { - /* "dawg.pyx":198 + /* "dawg.pyx":202 * * if b_step in replace_chars: * next_index = index # <<<<<<<<<<<<<< @@ -5497,7 +5502,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ __pyx_v_next_index = __pyx_v_index; - /* "dawg.pyx":199 + /* "dawg.pyx":203 * if b_step in replace_chars: * next_index = index * b_replace_char, u_replace_char = replace_chars[b_step] # <<<<<<<<<<<<<< @@ -5506,9 +5511,9 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 199, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); @@ -5519,7 +5524,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 199, __pyx_L1_error) + __PYX_ERR(0, 203, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); @@ -5527,23 +5532,23 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 203, __pyx_L1_error) } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 199, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 199, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 203, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_b_replace_char, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_u_replace_char, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "dawg.pyx":201 + /* "dawg.pyx":205 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -5552,13 +5557,13 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_b_replace_char == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 201, __pyx_L1_error) + __PYX_ERR(0, 205, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error) __pyx_t_6 = (__pyx_v_self->dct.Follow(__pyx_t_8, (&__pyx_v_next_index)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":202 + /* "dawg.pyx":206 * * if self.dct.Follow(b_replace_char, &next_index): * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char # <<<<<<<<<<<<<< @@ -5567,41 +5572,41 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 202, __pyx_L1_error) + __PYX_ERR(0, 206, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, __pyx_v_word_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, __pyx_v_word_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_7, __pyx_v_u_replace_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_7, __pyx_v_u_replace_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_prefix, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dawg.pyx":203 + /* "dawg.pyx":207 * if self.dct.Follow(b_replace_char, &next_index): * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char * extra_keys = self._similar_keys(prefix, key, next_index, replace_chars) # <<<<<<<<<<<<<< * res.extend(extra_keys) * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_similar_keys(__pyx_v_self, __pyx_v_prefix, __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_similar_keys(__pyx_v_self, __pyx_v_prefix, __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_extra_keys, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dawg.pyx":204 + /* "dawg.pyx":208 * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char * extra_keys = self._similar_keys(prefix, key, next_index, replace_chars) * res.extend(extra_keys) # <<<<<<<<<<<<<< * * if not self.dct.Follow(b_step, &index): */ - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_keys); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_keys); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 208, __pyx_L1_error) - /* "dawg.pyx":201 + /* "dawg.pyx":205 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -5610,7 +5615,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ } - /* "dawg.pyx":197 + /* "dawg.pyx":201 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -5619,7 +5624,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ } - /* "dawg.pyx":206 + /* "dawg.pyx":210 * res.extend(extra_keys) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -5628,13 +5633,13 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_b_step == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 206, __pyx_L1_error) + __PYX_ERR(0, 210, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->dct.Follow(__pyx_t_8, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":207 + /* "dawg.pyx":211 * * if not self.dct.Follow(b_step, &index): * break # <<<<<<<<<<<<<< @@ -5643,7 +5648,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ goto __pyx_L4_break; - /* "dawg.pyx":206 + /* "dawg.pyx":210 * res.extend(extra_keys) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -5652,7 +5657,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ } - /* "dawg.pyx":208 + /* "dawg.pyx":212 * if not self.dct.Follow(b_step, &index): * break * word_pos += 1 # <<<<<<<<<<<<<< @@ -5662,7 +5667,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __pyx_v_word_pos = (__pyx_v_word_pos + 1); } - /* "dawg.pyx":211 + /* "dawg.pyx":215 * * else: * if self._has_value(index): # <<<<<<<<<<<<<< @@ -5673,7 +5678,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __pyx_t_6 = (((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_has_value(__pyx_v_self, __pyx_v_index) != 0); if (__pyx_t_6) { - /* "dawg.pyx":212 + /* "dawg.pyx":216 * else: * if self._has_value(index): * found_key = current_prefix + key[start_pos:] # <<<<<<<<<<<<<< @@ -5682,26 +5687,26 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 212, __pyx_L1_error) + __PYX_ERR(0, 216, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_found_key = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":213 + /* "dawg.pyx":217 * if self._has_value(index): * found_key = current_prefix + key[start_pos:] * res.insert(0, found_key) # <<<<<<<<<<<<<< * * return res */ - __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_v_found_key); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_v_found_key); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 217, __pyx_L1_error) - /* "dawg.pyx":211 + /* "dawg.pyx":215 * * else: * if self._has_value(index): # <<<<<<<<<<<<<< @@ -5712,7 +5717,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * } __pyx_L4_break:; - /* "dawg.pyx":215 + /* "dawg.pyx":219 * res.insert(0, found_key) * * return res # <<<<<<<<<<<<<< @@ -5724,7 +5729,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":183 + /* "dawg.pyx":187 * return self.dct.has_value(index) * * cdef list _similar_keys(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -5752,7 +5757,7 @@ static PyObject *__pyx_f_4dawg_4DAWG__similar_keys(struct __pyx_obj_4dawg_DAWG * return __pyx_r; } -/* "dawg.pyx":217 +/* "dawg.pyx":221 * return res * * cpdef list similar_keys(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -5780,7 +5785,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_35similar_keys)) { __Pyx_XDECREF(__pyx_r); @@ -5800,7 +5805,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -5808,13 +5813,13 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5825,12 +5830,12 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ __Pyx_INCREF(__pyx_v_replaces); __Pyx_GIVEREF(__pyx_v_replaces); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_replaces); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 217, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5849,7 +5854,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ #endif } - /* "dawg.pyx":229 + /* "dawg.pyx":233 * This may be useful e.g. for handling single-character umlauts. * """ * return self._similar_keys("", key, self.dct.root(), replaces) # <<<<<<<<<<<<<< @@ -5857,13 +5862,13 @@ static PyObject *__pyx_f_4dawg_4DAWG_similar_keys(struct __pyx_obj_4dawg_DAWG *_ * cpdef list prefixes(self, unicode key): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_similar_keys(__pyx_v_self, __pyx_kp_u__6, __pyx_v_key, __pyx_v_self->dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_similar_keys(__pyx_v_self, __pyx_kp_u__6, __pyx_v_key, __pyx_v_self->dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":217 + /* "dawg.pyx":221 * return res * * cpdef list similar_keys(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -5918,11 +5923,11 @@ static PyObject *__pyx_pw_4dawg_4DAWG_35similar_keys(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replaces)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("similar_keys", 1, 2, 2, 1); __PYX_ERR(0, 217, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_keys", 1, 2, 2, 1); __PYX_ERR(0, 221, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_keys") < 0)) __PYX_ERR(0, 217, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_keys") < 0)) __PYX_ERR(0, 221, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -5935,14 +5940,14 @@ static PyObject *__pyx_pw_4dawg_4DAWG_35similar_keys(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("similar_keys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_keys", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 221, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.DAWG.similar_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 217, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 221, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 221, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_34similar_keys(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), __pyx_v_key, __pyx_v_replaces); /* function exit code */ @@ -5960,7 +5965,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_34similar_keys(struct __pyx_obj_4dawg_DAWG PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("similar_keys", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_similar_keys(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_similar_keys(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5977,7 +5982,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_34similar_keys(struct __pyx_obj_4dawg_DAWG return __pyx_r; } -/* "dawg.pyx":231 +/* "dawg.pyx":235 * return self._similar_keys("", key, self.dct.root(), replaces) * * cpdef list prefixes(self, unicode key): # <<<<<<<<<<<<<< @@ -6006,7 +6011,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefixes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefixes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_37prefixes)) { __Pyx_XDECREF(__pyx_r); @@ -6023,10 +6028,10 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 231, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6045,7 +6050,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx #endif } - /* "dawg.pyx":235 + /* "dawg.pyx":239 * Return a list with keys of this DAWG that are prefixes of the ``key``. * ''' * return [p.decode('utf8') for p in self.b_prefixes(key.encode('utf8'))] # <<<<<<<<<<<<<< @@ -6053,34 +6058,34 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx * cpdef list b_prefixes(self, bytes b_key): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } - __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_prefixes(__pyx_v_self, ((PyObject*)__pyx_t_2), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->b_prefixes(__pyx_v_self, ((PyObject*)__pyx_t_2), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 235, __pyx_L1_error) + __PYX_ERR(0, 239, __pyx_L1_error) } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -6094,10 +6099,10 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_utf8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6105,7 +6110,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_prefixes(struct __pyx_obj_4dawg_DAWG *__pyx __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":231 + /* "dawg.pyx":235 * return self._similar_keys("", key, self.dct.root(), replaces) * * cpdef list prefixes(self, unicode key): # <<<<<<<<<<<<<< @@ -6136,7 +6141,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_37prefixes(PyObject *__pyx_v_self, PyObjec PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prefixes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_36prefixes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -6154,7 +6159,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_36prefixes(struct __pyx_obj_4dawg_DAWG *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("prefixes", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_prefixes(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_prefixes(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6171,7 +6176,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_36prefixes(struct __pyx_obj_4dawg_DAWG *__ return __pyx_r; } -/* "dawg.pyx":237 +/* "dawg.pyx":241 * return [p.decode('utf8') for p in self.b_prefixes(key.encode('utf8'))] * * cpdef list b_prefixes(self, bytes b_key): # <<<<<<<<<<<<<< @@ -6208,7 +6213,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_prefixes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_prefixes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_4DAWG_39b_prefixes)) { __Pyx_XDECREF(__pyx_r); @@ -6225,10 +6230,10 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_b_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_b_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 237, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6247,19 +6252,19 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p #endif } - /* "dawg.pyx":238 + /* "dawg.pyx":242 * * cpdef list b_prefixes(self, bytes b_key): * cdef list res = [] # <<<<<<<<<<<<<< * cdef BaseType index = self.dct.root() * cdef int pos = 1 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":239 + /* "dawg.pyx":243 * cpdef list b_prefixes(self, bytes b_key): * cdef list res = [] * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -6268,7 +6273,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ __pyx_v_index = __pyx_v_self->dct.root(); - /* "dawg.pyx":240 + /* "dawg.pyx":244 * cdef list res = [] * cdef BaseType index = self.dct.root() * cdef int pos = 1 # <<<<<<<<<<<<<< @@ -6277,7 +6282,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ __pyx_v_pos = 1; - /* "dawg.pyx":243 + /* "dawg.pyx":247 * cdef CharType ch * * for ch in b_key: # <<<<<<<<<<<<<< @@ -6286,7 +6291,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 247, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_b_key); __pyx_t_5 = __pyx_v_b_key; @@ -6296,7 +6301,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p __pyx_t_6 = __pyx_t_9; __pyx_v_ch = (__pyx_t_6[0]); - /* "dawg.pyx":244 + /* "dawg.pyx":248 * * for ch in b_key: * if not self.dct.Follow(ch, &index): # <<<<<<<<<<<<<< @@ -6306,7 +6311,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p __pyx_t_10 = ((!(__pyx_v_self->dct.Follow(__pyx_v_ch, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_10) { - /* "dawg.pyx":245 + /* "dawg.pyx":249 * for ch in b_key: * if not self.dct.Follow(ch, &index): * break # <<<<<<<<<<<<<< @@ -6315,7 +6320,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ goto __pyx_L4_break; - /* "dawg.pyx":244 + /* "dawg.pyx":248 * * for ch in b_key: * if not self.dct.Follow(ch, &index): # <<<<<<<<<<<<<< @@ -6324,7 +6329,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ } - /* "dawg.pyx":246 + /* "dawg.pyx":250 * if not self.dct.Follow(ch, &index): * break * if self._has_value(index): # <<<<<<<<<<<<<< @@ -6334,7 +6339,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p __pyx_t_10 = (((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_has_value(__pyx_v_self, __pyx_v_index) != 0); if (__pyx_t_10) { - /* "dawg.pyx":247 + /* "dawg.pyx":251 * break * if self._has_value(index): * res.append(b_key[:pos]) # <<<<<<<<<<<<<< @@ -6343,14 +6348,14 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 247, __pyx_L1_error) + __PYX_ERR(0, 251, __pyx_L1_error) } - __pyx_t_1 = PySequence_GetSlice(__pyx_v_b_key, 0, __pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_1 = PySequence_GetSlice(__pyx_v_b_key, 0, __pyx_v_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":246 + /* "dawg.pyx":250 * if not self.dct.Follow(ch, &index): * break * if self._has_value(index): # <<<<<<<<<<<<<< @@ -6359,7 +6364,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p */ } - /* "dawg.pyx":248 + /* "dawg.pyx":252 * if self._has_value(index): * res.append(b_key[:pos]) * pos += 1 # <<<<<<<<<<<<<< @@ -6371,7 +6376,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p __pyx_L4_break:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dawg.pyx":250 + /* "dawg.pyx":254 * pos += 1 * * return res # <<<<<<<<<<<<<< @@ -6383,7 +6388,7 @@ static PyObject *__pyx_f_4dawg_4DAWG_b_prefixes(struct __pyx_obj_4dawg_DAWG *__p __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":237 + /* "dawg.pyx":241 * return [p.decode('utf8') for p in self.b_prefixes(key.encode('utf8'))] * * cpdef list b_prefixes(self, bytes b_key): # <<<<<<<<<<<<<< @@ -6414,7 +6419,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_39b_prefixes(PyObject *__pyx_v_self, PyObj PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_prefixes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b_key), (&PyBytes_Type), 1, "b_key", 1))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b_key), (&PyBytes_Type), 1, "b_key", 1))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_38b_prefixes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_b_key)); /* function exit code */ @@ -6432,7 +6437,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_38b_prefixes(struct __pyx_obj_4dawg_DAWG * PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("b_prefixes", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_4DAWG_b_prefixes(__pyx_v_self, __pyx_v_b_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_4DAWG_b_prefixes(__pyx_v_self, __pyx_v_b_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6450,7 +6455,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_38b_prefixes(struct __pyx_obj_4dawg_DAWG * } static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":252 +/* "dawg.pyx":256 * return res * * def iterprefixes(self, unicode key): # <<<<<<<<<<<<<< @@ -6465,7 +6470,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_41iterprefixes(PyObject *__pyx_v_self, PyO PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("iterprefixes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_4DAWG_40iterprefixes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -6486,7 +6491,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_40iterprefixes(struct __pyx_obj_4dawg_DAWG if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct__iterprefixes *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 252, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -6497,7 +6502,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_40iterprefixes(struct __pyx_obj_4dawg_DAWG __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_4DAWG_42generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterprefixes, __pyx_n_s_DAWG_iterprefixes, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_4DAWG_42generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterprefixes, __pyx_n_s_DAWG_iterprefixes, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6535,9 +6540,9 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 256, __pyx_L1_error) - /* "dawg.pyx":256 + /* "dawg.pyx":260 * Return a generator with keys of this DAWG that are prefixes of the ``key``. * ''' * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -6546,7 +6551,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->dct.root(); - /* "dawg.pyx":257 + /* "dawg.pyx":261 * ''' * cdef BaseType index = self.dct.root() * cdef bytes b_key = key.encode('utf8') # <<<<<<<<<<<<<< @@ -6555,9 +6560,9 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ if (unlikely(__pyx_cur_scope->__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 257, __pyx_L1_error) + __PYX_ERR(0, 261, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -6566,7 +6571,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __pyx_cur_scope->__pyx_v_b_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":258 + /* "dawg.pyx":262 * cdef BaseType index = self.dct.root() * cdef bytes b_key = key.encode('utf8') * cdef int pos = 1 # <<<<<<<<<<<<<< @@ -6575,7 +6580,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ __pyx_cur_scope->__pyx_v_pos = 1; - /* "dawg.pyx":261 + /* "dawg.pyx":265 * cdef CharType ch * * for ch in b_key: # <<<<<<<<<<<<<< @@ -6584,7 +6589,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ if (unlikely(__pyx_cur_scope->__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - __PYX_ERR(0, 261, __pyx_L1_error) + __PYX_ERR(0, 265, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_b_key); __pyx_t_3 = __pyx_cur_scope->__pyx_v_b_key; @@ -6594,7 +6599,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __pyx_t_4 = __pyx_t_7; __pyx_cur_scope->__pyx_v_ch = (__pyx_t_4[0]); - /* "dawg.pyx":262 + /* "dawg.pyx":266 * * for ch in b_key: * if not self.dct.Follow(ch, &index): # <<<<<<<<<<<<<< @@ -6604,7 +6609,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __pyx_t_8 = ((!(__pyx_cur_scope->__pyx_v_self->dct.Follow(__pyx_cur_scope->__pyx_v_ch, (&__pyx_cur_scope->__pyx_v_index)) != 0)) != 0); if (__pyx_t_8) { - /* "dawg.pyx":263 + /* "dawg.pyx":267 * for ch in b_key: * if not self.dct.Follow(ch, &index): * return # <<<<<<<<<<<<<< @@ -6616,7 +6621,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "dawg.pyx":262 + /* "dawg.pyx":266 * * for ch in b_key: * if not self.dct.Follow(ch, &index): # <<<<<<<<<<<<<< @@ -6625,7 +6630,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ } - /* "dawg.pyx":264 + /* "dawg.pyx":268 * if not self.dct.Follow(ch, &index): * return * if self._has_value(index): # <<<<<<<<<<<<<< @@ -6635,7 +6640,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __pyx_t_8 = (((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_has_value(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_index) != 0); if (__pyx_t_8) { - /* "dawg.pyx":265 + /* "dawg.pyx":269 * return * if self._has_value(index): * yield b_key[:pos].decode('utf8') # <<<<<<<<<<<<<< @@ -6644,9 +6649,9 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ if (unlikely(__pyx_cur_scope->__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 265, __pyx_L1_error) + __PYX_ERR(0, 269, __pyx_L1_error) } - __pyx_t_2 = __Pyx_decode_bytes(__pyx_cur_scope->__pyx_v_b_key, 0, __pyx_cur_scope->__pyx_v_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_2 = __Pyx_decode_bytes(__pyx_cur_scope->__pyx_v_b_key, 0, __pyx_cur_scope->__pyx_v_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6670,9 +6675,9 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; __pyx_t_7 = __pyx_cur_scope->__pyx_t_4; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 265, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 269, __pyx_L1_error) - /* "dawg.pyx":264 + /* "dawg.pyx":268 * if not self.dct.Follow(ch, &index): * return * if self._has_value(index): # <<<<<<<<<<<<<< @@ -6681,7 +6686,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g */ } - /* "dawg.pyx":266 + /* "dawg.pyx":270 * if self._has_value(index): * yield b_key[:pos].decode('utf8') * pos += 1 # <<<<<<<<<<<<<< @@ -6693,7 +6698,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":252 + /* "dawg.pyx":256 * return res * * def iterprefixes(self, unicode key): # <<<<<<<<<<<<<< @@ -6720,7 +6725,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_42generator(__pyx_CoroutineObject *__pyx_g return __pyx_r; } -/* "dawg.pyx":269 +/* "dawg.pyx":273 * * @classmethod * def compile_replaces(cls, replaces): # <<<<<<<<<<<<<< @@ -6743,7 +6748,7 @@ static PyObject *__pyx_pw_4dawg_4DAWG_44compile_replaces(PyObject *__pyx_v_cls, } static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":277 +/* "dawg.pyx":281 * return dict( * ( * k.encode('utf8'), # <<<<<<<<<<<<<< @@ -6760,7 +6765,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_16compile_replaces_genexpr(PyObject *__pyx if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 277, __pyx_L1_error) + __PYX_ERR(0, 281, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -6768,7 +6773,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_16compile_replaces_genexpr(PyObject *__pyx __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_compile_replaces_locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_compile_replaces_locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6805,19 +6810,19 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 277, __pyx_L1_error) - __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - /* "dawg.pyx":280 + /* "dawg.pyx":284 * (v.encode('utf8'), unicode(v)) * ) * for k, v in replaces.items() # <<<<<<<<<<<<<< * ) * */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_replaces)) { __Pyx_RaiseClosureNameError("replaces"); __PYX_ERR(0, 280, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_replaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_replaces)) { __Pyx_RaiseClosureNameError("replaces"); __PYX_ERR(0, 284, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_replaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6831,16 +6836,16 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -6848,17 +6853,17 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 284, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -6868,7 +6873,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 280, __pyx_L1_error) + else __PYX_ERR(0, 284, __pyx_L1_error) } break; } @@ -6880,7 +6885,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 280, __pyx_L1_error) + __PYX_ERR(0, 284, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6893,15 +6898,15 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -6909,7 +6914,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -6917,7 +6922,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 280, __pyx_L1_error) + __PYX_ERR(0, 284, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); @@ -6929,14 +6934,14 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dawg.pyx":277 + /* "dawg.pyx":281 * return dict( * ( * k.encode('utf8'), # <<<<<<<<<<<<<< * (v.encode('utf8'), unicode(v)) * ) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_k, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6950,18 +6955,18 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_utf8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dawg.pyx":278 + /* "dawg.pyx":282 * ( * k.encode('utf8'), * (v.encode('utf8'), unicode(v)) # <<<<<<<<<<<<<< * ) * for k, v in replaces.items() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -6975,12 +6980,12 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_n_u_utf8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_utf8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); @@ -6988,11 +6993,11 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); __pyx_t_6 = 0; __pyx_t_3 = 0; - if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":280 + /* "dawg.pyx":284 * (v.encode('utf8'), unicode(v)) * ) * for k, v in replaces.items() # <<<<<<<<<<<<<< @@ -7003,7 +7008,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":277 + /* "dawg.pyx":281 * return dict( * ( * k.encode('utf8'), # <<<<<<<<<<<<<< @@ -7032,7 +7037,7 @@ static PyObject *__pyx_gb_4dawg_4DAWG_16compile_replaces_2generator6(__pyx_Corou return __pyx_r; } -/* "dawg.pyx":269 +/* "dawg.pyx":273 * * @classmethod * def compile_replaces(cls, replaces): # <<<<<<<<<<<<<< @@ -7062,7 +7067,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_1_compile_replaces *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 269, __pyx_L1_error) + __PYX_ERR(0, 273, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -7070,14 +7075,14 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj __Pyx_INCREF(__pyx_cur_scope->__pyx_v_replaces); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_replaces); - /* "dawg.pyx":271 + /* "dawg.pyx":275 * def compile_replaces(cls, replaces): * * for k,v in replaces.items(): # <<<<<<<<<<<<<< * if len(k) != 1 or len(v) != 1: * raise ValueError("Keys and values must be single-char unicode strings.") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_replaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_replaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -7091,16 +7096,16 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7108,17 +7113,17 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -7128,7 +7133,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 271, __pyx_L1_error) + else __PYX_ERR(0, 275, __pyx_L1_error) } break; } @@ -7140,7 +7145,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 271, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7153,15 +7158,15 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -7169,7 +7174,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -7177,7 +7182,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 271, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); @@ -7185,40 +7190,40 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - /* "dawg.pyx":272 + /* "dawg.pyx":276 * * for k,v in replaces.items(): * if len(k) != 1 or len(v) != 1: # <<<<<<<<<<<<<< * raise ValueError("Keys and values must be single-char unicode strings.") * */ - __pyx_t_10 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_10 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_t_11 = ((__pyx_t_10 != 1) != 0); if (!__pyx_t_11) { } else { __pyx_t_9 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } - __pyx_t_10 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_10 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_t_11 = ((__pyx_t_10 != 1) != 0); __pyx_t_9 = __pyx_t_11; __pyx_L8_bool_binop_done:; if (unlikely(__pyx_t_9)) { - /* "dawg.pyx":273 + /* "dawg.pyx":277 * for k,v in replaces.items(): * if len(k) != 1 or len(v) != 1: * raise ValueError("Keys and values must be single-char unicode strings.") # <<<<<<<<<<<<<< * * return dict( */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 273, __pyx_L1_error) + __PYX_ERR(0, 277, __pyx_L1_error) - /* "dawg.pyx":272 + /* "dawg.pyx":276 * * for k,v in replaces.items(): * if len(k) != 1 or len(v) != 1: # <<<<<<<<<<<<<< @@ -7227,7 +7232,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj */ } - /* "dawg.pyx":271 + /* "dawg.pyx":275 * def compile_replaces(cls, replaces): * * for k,v in replaces.items(): # <<<<<<<<<<<<<< @@ -7237,7 +7242,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":275 + /* "dawg.pyx":279 * raise ValueError("Keys and values must be single-char unicode strings.") * * return dict( # <<<<<<<<<<<<<< @@ -7246,31 +7251,31 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj */ __Pyx_XDECREF(__pyx_r); - /* "dawg.pyx":277 + /* "dawg.pyx":281 * return dict( * ( * k.encode('utf8'), # <<<<<<<<<<<<<< * (v.encode('utf8'), unicode(v)) * ) */ - __pyx_t_2 = __pyx_pf_4dawg_4DAWG_16compile_replaces_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_4dawg_4DAWG_16compile_replaces_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "dawg.pyx":275 + /* "dawg.pyx":279 * raise ValueError("Keys and values must be single-char unicode strings.") * * return dict( # <<<<<<<<<<<<<< * ( * k.encode('utf8'), */ - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":269 + /* "dawg.pyx":273 * * @classmethod * def compile_replaces(cls, replaces): # <<<<<<<<<<<<<< @@ -7296,7 +7301,7 @@ static PyObject *__pyx_pf_4dawg_4DAWG_43compile_replaces(CYTHON_UNUSED PyTypeObj return __pyx_r; } -/* "dawg.pyx":284 +/* "dawg.pyx":288 * * * cdef void init_completer(Completer& completer, Dictionary& dic, Guide& guide): # <<<<<<<<<<<<<< @@ -7308,7 +7313,7 @@ static void __pyx_f_4dawg_init_completer(dawgdic::Completer &__pyx_v_completer, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init_completer", 0); - /* "dawg.pyx":285 + /* "dawg.pyx":289 * * cdef void init_completer(Completer& completer, Dictionary& dic, Guide& guide): * completer.set_dic(dic) # <<<<<<<<<<<<<< @@ -7317,7 +7322,7 @@ static void __pyx_f_4dawg_init_completer(dawgdic::Completer &__pyx_v_completer, */ __pyx_v_completer.set_dic(__pyx_v_dic); - /* "dawg.pyx":286 + /* "dawg.pyx":290 * cdef void init_completer(Completer& completer, Dictionary& dic, Guide& guide): * completer.set_dic(dic) * completer.set_guide(guide) # <<<<<<<<<<<<<< @@ -7326,7 +7331,7 @@ static void __pyx_f_4dawg_init_completer(dawgdic::Completer &__pyx_v_completer, */ __pyx_v_completer.set_guide(__pyx_v_guide); - /* "dawg.pyx":284 + /* "dawg.pyx":288 * * * cdef void init_completer(Completer& completer, Dictionary& dic, Guide& guide): # <<<<<<<<<<<<<< @@ -7338,7 +7343,7 @@ static void __pyx_f_4dawg_init_completer(dawgdic::Completer &__pyx_v_completer, __Pyx_RefNannyFinishContext(); } -/* "dawg.pyx":295 +/* "dawg.pyx":299 * cdef Guide guide * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -7385,7 +7390,7 @@ static int __pyx_pw_4dawg_14CompletionDAWG_1__init__(PyObject *__pyx_v_self, PyO } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 295, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 299, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7402,7 +7407,7 @@ static int __pyx_pw_4dawg_14CompletionDAWG_1__init__(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 295, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.CompletionDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7426,14 +7431,14 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl int __pyx_t_6; __Pyx_RefNannySetupContext("__init__", 0); - /* "dawg.pyx":296 + /* "dawg.pyx":300 * * def __init__(self, arg=None, input_is_sorted=False): * super(CompletionDAWG, self).__init__(arg, input_is_sorted) # <<<<<<<<<<<<<< * if not _guide_builder.Build(self.dawg, self.dct, &self.guide): * raise Error("Error building completion information") */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_CompletionDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_CompletionDAWG)); @@ -7441,10 +7446,10 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -7462,7 +7467,7 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_arg, __pyx_v_input_is_sorted}; - __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, 296, __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, 300, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -7470,13 +7475,13 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_arg, __pyx_v_input_is_sorted}; - __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, 296, __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, 300, __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, 296, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __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; @@ -7487,14 +7492,14 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl __Pyx_INCREF(__pyx_v_input_is_sorted); __Pyx_GIVEREF(__pyx_v_input_is_sorted); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_input_is_sorted); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":297 + /* "dawg.pyx":301 * def __init__(self, arg=None, input_is_sorted=False): * super(CompletionDAWG, self).__init__(arg, input_is_sorted) * if not _guide_builder.Build(self.dawg, self.dct, &self.guide): # <<<<<<<<<<<<<< @@ -7504,14 +7509,14 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl __pyx_t_6 = ((!(dawgdic::GuideBuilder::Build(__pyx_v_self->__pyx_base.dawg, __pyx_v_self->__pyx_base.dct, (&__pyx_v_self->guide)) != 0)) != 0); if (unlikely(__pyx_t_6)) { - /* "dawg.pyx":298 + /* "dawg.pyx":302 * super(CompletionDAWG, self).__init__(arg, input_is_sorted) * if not _guide_builder.Build(self.dawg, self.dct, &self.guide): * raise Error("Error building completion information") # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -7525,14 +7530,14 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_u_Error_building_completion_inform) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Error_building_completion_inform); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 298, __pyx_L1_error) + __PYX_ERR(0, 302, __pyx_L1_error) - /* "dawg.pyx":297 + /* "dawg.pyx":301 * def __init__(self, arg=None, input_is_sorted=False): * super(CompletionDAWG, self).__init__(arg, input_is_sorted) * if not _guide_builder.Build(self.dawg, self.dct, &self.guide): # <<<<<<<<<<<<<< @@ -7541,7 +7546,7 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl */ } - /* "dawg.pyx":295 + /* "dawg.pyx":299 * cdef Guide guide * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -7564,7 +7569,7 @@ static int __pyx_pf_4dawg_14CompletionDAWG___init__(struct __pyx_obj_4dawg_Compl return __pyx_r; } -/* "dawg.pyx":300 +/* "dawg.pyx":304 * raise Error("Error building completion information") * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7587,7 +7592,7 @@ static void __pyx_pf_4dawg_14CompletionDAWG_2__dealloc__(struct __pyx_obj_4dawg_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "dawg.pyx":301 + /* "dawg.pyx":305 * * def __dealloc__(self): * self.guide.Clear() # <<<<<<<<<<<<<< @@ -7596,7 +7601,7 @@ static void __pyx_pf_4dawg_14CompletionDAWG_2__dealloc__(struct __pyx_obj_4dawg_ */ __pyx_v_self->guide.Clear(); - /* "dawg.pyx":300 + /* "dawg.pyx":304 * raise Error("Error building completion information") * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7608,7 +7613,7 @@ static void __pyx_pf_4dawg_14CompletionDAWG_2__dealloc__(struct __pyx_obj_4dawg_ __Pyx_RefNannyFinishContext(); } -/* "dawg.pyx":303 +/* "dawg.pyx":307 * self.guide.Clear() * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -7649,7 +7654,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_14CompletionDAWG_5keys)) { __Pyx_XDECREF(__pyx_r); @@ -7666,10 +7671,10 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 303, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7688,7 +7693,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp #endif } - /* "dawg.pyx":304 + /* "dawg.pyx":308 * * cpdef list keys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -7697,14 +7702,14 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ if (unlikely(__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 304, __pyx_L1_error) + __PYX_ERR(0, 308, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":305 + /* "dawg.pyx":309 * cpdef list keys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -7713,19 +7718,19 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ __pyx_v_index = __pyx_v_self->__pyx_base.dct.root(); - /* "dawg.pyx":306 + /* "dawg.pyx":310 * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() * cdef list res = [] # <<<<<<<<<<<<<< * * if not self.dct.Follow(b_prefix, &index): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":308 + /* "dawg.pyx":312 * cdef list res = [] * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -7734,13 +7739,13 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 308, __pyx_L1_error) + __PYX_ERR(0, 312, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.dct.Follow(__pyx_t_5, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":309 + /* "dawg.pyx":313 * * if not self.dct.Follow(b_prefix, &index): * return res # <<<<<<<<<<<<<< @@ -7752,7 +7757,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":308 + /* "dawg.pyx":312 * cdef list res = [] * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -7761,7 +7766,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ } - /* "dawg.pyx":312 + /* "dawg.pyx":316 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -7770,7 +7775,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.dct, __pyx_v_self->guide); - /* "dawg.pyx":313 + /* "dawg.pyx":317 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -7779,12 +7784,12 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 313, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_v_completer.Start(__pyx_v_index, __pyx_t_7); - /* "dawg.pyx":315 + /* "dawg.pyx":319 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -7795,7 +7800,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp __pyx_t_6 = (__pyx_v_completer.Next() != 0); if (!__pyx_t_6) break; - /* "dawg.pyx":316 + /* "dawg.pyx":320 * * while completer.Next(): * key = (completer.key()).decode('utf8') # <<<<<<<<<<<<<< @@ -7803,23 +7808,23 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp * */ __pyx_t_7 = ((char *)__pyx_v_completer.key()); - __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":317 + /* "dawg.pyx":321 * while completer.Next(): * key = (completer.key()).decode('utf8') * res.append(key) # <<<<<<<<<<<<<< * * return res */ - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_key); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_key); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 321, __pyx_L1_error) } - /* "dawg.pyx":319 + /* "dawg.pyx":323 * res.append(key) * * return res # <<<<<<<<<<<<<< @@ -7831,7 +7836,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_Comp __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":303 + /* "dawg.pyx":307 * self.guide.Clear() * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -7886,7 +7891,7 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_5keys(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keys") < 0)) __PYX_ERR(0, 303, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keys") < 0)) __PYX_ERR(0, 307, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7900,13 +7905,13 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_5keys(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("keys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 303, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.CompletionDAWG.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 303, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_4keys(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -7927,7 +7932,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_4keys(struct __pyx_obj_4dawg_Co __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_CompletionDAWG->keys(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_CompletionDAWG->keys(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7945,7 +7950,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_4keys(struct __pyx_obj_4dawg_Co } static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":321 +/* "dawg.pyx":325 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -7983,7 +7988,7 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_7iterkeys(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) __PYX_ERR(0, 321, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) __PYX_ERR(0, 325, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7997,13 +8002,13 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_7iterkeys(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 325, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.CompletionDAWG.iterkeys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 325, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_6iterkeys(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -8024,7 +8029,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_6iterkeys(struct __pyx_obj_4daw if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_3_iterkeys *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 321, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -8035,7 +8040,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_6iterkeys(struct __pyx_obj_4daw __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_14CompletionDAWG_8generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterkeys, __pyx_n_s_CompletionDAWG_iterkeys, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_14CompletionDAWG_8generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterkeys, __pyx_n_s_CompletionDAWG_iterkeys, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8069,9 +8074,9 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 325, __pyx_L1_error) - /* "dawg.pyx":322 + /* "dawg.pyx":326 * * def iterkeys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -8080,15 +8085,15 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ if (unlikely(__pyx_cur_scope->__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 326, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":323 + /* "dawg.pyx":327 * def iterkeys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -8097,7 +8102,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->__pyx_base.dct.root(); - /* "dawg.pyx":325 + /* "dawg.pyx":329 * cdef BaseType index = self.dct.root() * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -8106,13 +8111,13 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 325, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_self->__pyx_base.dct.Follow(__pyx_t_2, (&__pyx_cur_scope->__pyx_v_index)) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":326 + /* "dawg.pyx":330 * * if not self.dct.Follow(b_prefix, &index): * return # <<<<<<<<<<<<<< @@ -8123,7 +8128,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje __pyx_r = NULL; goto __pyx_L0; - /* "dawg.pyx":325 + /* "dawg.pyx":329 * cdef BaseType index = self.dct.root() * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -8132,7 +8137,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ } - /* "dawg.pyx":329 + /* "dawg.pyx":333 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -8141,7 +8146,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ __pyx_f_4dawg_init_completer(__pyx_cur_scope->__pyx_v_completer, __pyx_cur_scope->__pyx_v_self->__pyx_base.dct, __pyx_cur_scope->__pyx_v_self->guide); - /* "dawg.pyx":330 + /* "dawg.pyx":334 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -8150,12 +8155,12 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 330, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L1_error) __pyx_cur_scope->__pyx_v_completer.Start(__pyx_cur_scope->__pyx_v_index, __pyx_t_4); - /* "dawg.pyx":332 + /* "dawg.pyx":336 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -8166,7 +8171,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje __pyx_t_3 = (__pyx_cur_scope->__pyx_v_completer.Next() != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":333 + /* "dawg.pyx":337 * * while completer.Next(): * key = (completer.key()).decode('utf8') # <<<<<<<<<<<<<< @@ -8174,7 +8179,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje * */ __pyx_t_4 = ((char *)__pyx_cur_scope->__pyx_v_completer.key()); - __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); @@ -8182,7 +8187,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje __Pyx_GIVEREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":334 + /* "dawg.pyx":338 * while completer.Next(): * key = (completer.key()).decode('utf8') * yield key # <<<<<<<<<<<<<< @@ -8198,11 +8203,11 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 338, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":321 + /* "dawg.pyx":325 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -8227,7 +8232,7 @@ static PyObject *__pyx_gb_4dawg_14CompletionDAWG_8generator1(__pyx_CoroutineObje return __pyx_r; } -/* "dawg.pyx":336 +/* "dawg.pyx":340 * yield key * * def has_keys_with_prefix(self, unicode prefix): # <<<<<<<<<<<<<< @@ -8242,7 +8247,7 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_10has_keys_with_prefix(PyObject PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_keys_with_prefix (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_prefix)); /* function exit code */ @@ -8266,7 +8271,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ char *__pyx_t_4; __Pyx_RefNannySetupContext("has_keys_with_prefix", 0); - /* "dawg.pyx":337 + /* "dawg.pyx":341 * * def has_keys_with_prefix(self, unicode prefix): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -8275,14 +8280,14 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ if (unlikely(__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 337, __pyx_L1_error) + __PYX_ERR(0, 341, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":338 + /* "dawg.pyx":342 * def has_keys_with_prefix(self, unicode prefix): * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -8291,7 +8296,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ __pyx_v_index = __pyx_v_self->__pyx_base.dct.root(); - /* "dawg.pyx":340 + /* "dawg.pyx":344 * cdef BaseType index = self.dct.root() * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -8300,13 +8305,13 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 340, __pyx_L1_error) + __PYX_ERR(0, 344, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_v_self->__pyx_base.dct.Follow(__pyx_t_2, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":341 + /* "dawg.pyx":345 * * if not self.dct.Follow(b_prefix, &index): * return False # <<<<<<<<<<<<<< @@ -8318,7 +8323,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ __pyx_r = Py_False; goto __pyx_L0; - /* "dawg.pyx":340 + /* "dawg.pyx":344 * cdef BaseType index = self.dct.root() * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -8327,7 +8332,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ } - /* "dawg.pyx":344 + /* "dawg.pyx":348 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -8336,7 +8341,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.dct, __pyx_v_self->guide); - /* "dawg.pyx":345 + /* "dawg.pyx":349 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -8345,12 +8350,12 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 345, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error) __pyx_v_completer.Start(__pyx_v_index, __pyx_t_4); - /* "dawg.pyx":347 + /* "dawg.pyx":351 * completer.Start(index, b_prefix) * * return completer.Next() # <<<<<<<<<<<<<< @@ -8358,13 +8363,13 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ * cpdef bytes tobytes(self) except +: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_completer.Next()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_completer.Next()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":336 + /* "dawg.pyx":340 * yield key * * def has_keys_with_prefix(self, unicode prefix): # <<<<<<<<<<<<<< @@ -8384,7 +8389,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_9has_keys_with_prefix(struct __ return __pyx_r; } -/* "dawg.pyx":349 +/* "dawg.pyx":353 * return completer.Next() * * cpdef bytes tobytes(self) except +: # <<<<<<<<<<<<<< @@ -8412,7 +8417,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tobytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_14CompletionDAWG_12tobytes)) { __Pyx_XDECREF(__pyx_r); @@ -8429,10 +8434,10 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 349, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 353, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8451,7 +8456,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C #endif } - /* "dawg.pyx":354 + /* "dawg.pyx":358 * """ * cdef stringstream stream * self.dct.Write( &stream) # <<<<<<<<<<<<<< @@ -8462,10 +8467,10 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C __pyx_v_self->__pyx_base.dct.Write(((std::ostream *)(&__pyx_v_stream))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 354, __pyx_L1_error) + __PYX_ERR(0, 358, __pyx_L1_error) } - /* "dawg.pyx":355 + /* "dawg.pyx":359 * cdef stringstream stream * self.dct.Write( &stream) * self.guide.Write( &stream) # <<<<<<<<<<<<<< @@ -8474,19 +8479,19 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C */ (void)(__pyx_v_self->guide.Write(((std::ostream *)(&__pyx_v_stream)))); - /* "dawg.pyx":356 + /* "dawg.pyx":360 * self.dct.Write( &stream) * self.guide.Write( &stream) * cdef bytes res = stream.str() # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":357 + /* "dawg.pyx":361 * self.guide.Write( &stream) * cdef bytes res = stream.str() * return res # <<<<<<<<<<<<<< @@ -8498,7 +8503,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_tobytes(struct __pyx_obj_4dawg_C __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":349 + /* "dawg.pyx":353 * return completer.Next() * * cpdef bytes tobytes(self) except +: # <<<<<<<<<<<<<< @@ -8543,10 +8548,10 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_11tobytes(struct __pyx_obj_4daw __Pyx_XDECREF(__pyx_r); try { __pyx_t_1 = __pyx_f_4dawg_14CompletionDAWG_tobytes(__pyx_v_self, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 353, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -8564,7 +8569,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_11tobytes(struct __pyx_obj_4daw return __pyx_r; } -/* "dawg.pyx":359 +/* "dawg.pyx":363 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -8596,7 +8601,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_14CompletionDAWG_14frombytes)) { __Pyx_XDECREF(__pyx_r); @@ -8613,7 +8618,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -8634,7 +8639,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg #endif } - /* "dawg.pyx":366 + /* "dawg.pyx":370 * loaded using frombytes vs load). * """ * cdef char* c_data = data # <<<<<<<<<<<<<< @@ -8643,12 +8648,12 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 366, __pyx_L1_error) + __PYX_ERR(0, 370, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) __pyx_v_c_data = __pyx_t_5; - /* "dawg.pyx":368 + /* "dawg.pyx":372 * cdef char* c_data = data * cdef stringstream stream * stream.write(c_data, len(data)) # <<<<<<<<<<<<<< @@ -8657,12 +8662,12 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 368, __pyx_L1_error) + __PYX_ERR(0, 372, __pyx_L1_error) } - __pyx_t_6 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error) (void)(__pyx_v_stream.write(__pyx_v_c_data, __pyx_t_6)); - /* "dawg.pyx":369 + /* "dawg.pyx":373 * cdef stringstream stream * stream.write(c_data, len(data)) * stream.seekg(0) # <<<<<<<<<<<<<< @@ -8671,7 +8676,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ (void)(__pyx_v_stream.seekg(0)); - /* "dawg.pyx":371 + /* "dawg.pyx":375 * stream.seekg(0) * * res = self.dct.Read( &stream) # <<<<<<<<<<<<<< @@ -8682,11 +8687,11 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg __pyx_t_7 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 371, __pyx_L1_error) + __PYX_ERR(0, 375, __pyx_L1_error) } __pyx_v_res = __pyx_t_7; - /* "dawg.pyx":372 + /* "dawg.pyx":376 * * res = self.dct.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -8696,7 +8701,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg __pyx_t_7 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_7)) { - /* "dawg.pyx":373 + /* "dawg.pyx":377 * res = self.dct.Read( &stream) * if not res: * self.dct.Clear() # <<<<<<<<<<<<<< @@ -8705,20 +8710,20 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ __pyx_v_self->__pyx_base.dct.Clear(); - /* "dawg.pyx":374 + /* "dawg.pyx":378 * if not res: * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Dictionary") # <<<<<<<<<<<<<< * * res = self.guide.Read( &stream) */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 374, __pyx_L1_error) + __PYX_ERR(0, 378, __pyx_L1_error) - /* "dawg.pyx":372 + /* "dawg.pyx":376 * * res = self.dct.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -8727,7 +8732,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ } - /* "dawg.pyx":376 + /* "dawg.pyx":380 * raise IOError("Invalid data format: can't load _dawg.Dictionary") * * res = self.guide.Read( &stream) # <<<<<<<<<<<<<< @@ -8736,7 +8741,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ __pyx_v_res = __pyx_v_self->guide.Read(((std::istream *)(&__pyx_v_stream))); - /* "dawg.pyx":377 + /* "dawg.pyx":381 * * res = self.guide.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -8746,7 +8751,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg __pyx_t_7 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_7)) { - /* "dawg.pyx":378 + /* "dawg.pyx":382 * res = self.guide.Read( &stream) * if not res: * self.guide.Clear() # <<<<<<<<<<<<<< @@ -8755,7 +8760,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ __pyx_v_self->guide.Clear(); - /* "dawg.pyx":379 + /* "dawg.pyx":383 * if not res: * self.guide.Clear() * self.dct.Clear() # <<<<<<<<<<<<<< @@ -8764,20 +8769,20 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ __pyx_v_self->__pyx_base.dct.Clear(); - /* "dawg.pyx":380 + /* "dawg.pyx":384 * self.guide.Clear() * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Guide") # <<<<<<<<<<<<<< * * return self */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 380, __pyx_L1_error) + __PYX_ERR(0, 384, __pyx_L1_error) - /* "dawg.pyx":377 + /* "dawg.pyx":381 * * res = self.guide.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -8786,7 +8791,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg */ } - /* "dawg.pyx":382 + /* "dawg.pyx":386 * raise IOError("Invalid data format: can't load _dawg.Guide") * * return self # <<<<<<<<<<<<<< @@ -8798,7 +8803,7 @@ static PyObject *__pyx_f_4dawg_14CompletionDAWG_frombytes(struct __pyx_obj_4dawg __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dawg.pyx":359 + /* "dawg.pyx":363 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -8827,7 +8832,7 @@ static PyObject *__pyx_pw_4dawg_14CompletionDAWG_14frombytes(PyObject *__pyx_v_s PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("frombytes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 359, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 363, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_13frombytes(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_data)); /* function exit code */ @@ -8845,7 +8850,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_13frombytes(struct __pyx_obj_4d PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("frombytes", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_14CompletionDAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_14CompletionDAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8862,7 +8867,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_13frombytes(struct __pyx_obj_4d return __pyx_r; } -/* "dawg.pyx":384 +/* "dawg.pyx":388 * return self * * def load(self, path): # <<<<<<<<<<<<<< @@ -8910,7 +8915,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __Pyx_RefNannySetupContext("load", 0); __Pyx_INCREF(__pyx_v_path); - /* "dawg.pyx":388 + /* "dawg.pyx":392 * Load DAWG from a file. * """ * if isinstance(path, unicode): # <<<<<<<<<<<<<< @@ -8921,18 +8926,18 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":389 + /* "dawg.pyx":393 * """ * if isinstance(path, unicode): * path = path.encode(sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * * cdef ifstream stream */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -8947,7 +8952,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -8963,13 +8968,13 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":388 + /* "dawg.pyx":392 * Load DAWG from a file. * """ * if isinstance(path, unicode): # <<<<<<<<<<<<<< @@ -8978,22 +8983,22 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ } - /* "dawg.pyx":392 + /* "dawg.pyx":396 * * cdef ifstream stream * stream.open(path, iostream.binary) # <<<<<<<<<<<<<< * if stream.fail(): * raise IOError("It's not possible to read file stream") */ - __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) try { __pyx_v_stream.open(__pyx_t_8, std::stringstream::binary); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 392, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) } - /* "dawg.pyx":393 + /* "dawg.pyx":397 * cdef ifstream stream * stream.open(path, iostream.binary) * if stream.fail(): # <<<<<<<<<<<<<< @@ -9004,25 +9009,25 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_9 = __pyx_v_stream.fail(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 393, __pyx_L1_error) + __PYX_ERR(0, 397, __pyx_L1_error) } __pyx_t_2 = (__pyx_t_9 != 0); if (unlikely(__pyx_t_2)) { - /* "dawg.pyx":394 + /* "dawg.pyx":398 * stream.open(path, iostream.binary) * if stream.fail(): * raise IOError("It's not possible to read file stream") # <<<<<<<<<<<<<< * * try: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 394, __pyx_L1_error) + __PYX_ERR(0, 398, __pyx_L1_error) - /* "dawg.pyx":393 + /* "dawg.pyx":397 * cdef ifstream stream * stream.open(path, iostream.binary) * if stream.fail(): # <<<<<<<<<<<<<< @@ -9031,7 +9036,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ } - /* "dawg.pyx":396 + /* "dawg.pyx":400 * raise IOError("It's not possible to read file stream") * * try: # <<<<<<<<<<<<<< @@ -9040,7 +9045,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ /*try:*/ { - /* "dawg.pyx":397 + /* "dawg.pyx":401 * * try: * res = self.dct.Read( &stream) # <<<<<<<<<<<<<< @@ -9051,11 +9056,11 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_2 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream))); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 397, __pyx_L6_error) + __PYX_ERR(0, 401, __pyx_L6_error) } __pyx_v_res = __pyx_t_2; - /* "dawg.pyx":398 + /* "dawg.pyx":402 * try: * res = self.dct.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -9065,7 +9070,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_2 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "dawg.pyx":399 + /* "dawg.pyx":403 * res = self.dct.Read( &stream) * if not res: * self.dct.Clear() # <<<<<<<<<<<<<< @@ -9074,20 +9079,20 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ __pyx_v_self->__pyx_base.dct.Clear(); - /* "dawg.pyx":400 + /* "dawg.pyx":404 * if not res: * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Dictionary") # <<<<<<<<<<<<<< * * res = self.guide.Read( &stream) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L6_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, 400, __pyx_L6_error) + __PYX_ERR(0, 404, __pyx_L6_error) - /* "dawg.pyx":398 + /* "dawg.pyx":402 * try: * res = self.dct.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -9096,7 +9101,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ } - /* "dawg.pyx":402 + /* "dawg.pyx":406 * raise IOError("Invalid data format: can't load _dawg.Dictionary") * * res = self.guide.Read( &stream) # <<<<<<<<<<<<<< @@ -9105,7 +9110,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ __pyx_v_res = __pyx_v_self->guide.Read(((std::istream *)(&__pyx_v_stream))); - /* "dawg.pyx":403 + /* "dawg.pyx":407 * * res = self.guide.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -9115,7 +9120,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_t_2 = ((!(__pyx_v_res != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "dawg.pyx":404 + /* "dawg.pyx":408 * res = self.guide.Read( &stream) * if not res: * self.guide.Clear() # <<<<<<<<<<<<<< @@ -9124,7 +9129,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ __pyx_v_self->guide.Clear(); - /* "dawg.pyx":405 + /* "dawg.pyx":409 * if not res: * self.guide.Clear() * self.dct.Clear() # <<<<<<<<<<<<<< @@ -9133,20 +9138,20 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C */ __pyx_v_self->__pyx_base.dct.Clear(); - /* "dawg.pyx":406 + /* "dawg.pyx":410 * self.guide.Clear() * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Guide") # <<<<<<<<<<<<<< * * finally: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L6_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, 406, __pyx_L6_error) + __PYX_ERR(0, 410, __pyx_L6_error) - /* "dawg.pyx":403 + /* "dawg.pyx":407 * * res = self.guide.Read( &stream) * if not res: # <<<<<<<<<<<<<< @@ -9156,7 +9161,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C } } - /* "dawg.pyx":409 + /* "dawg.pyx":413 * * finally: * stream.close() # <<<<<<<<<<<<<< @@ -9169,7 +9174,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_v_stream.close(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 413, __pyx_L1_error) } goto __pyx_L7; } @@ -9197,7 +9202,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_v_stream.close(); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 409, __pyx_L11_error) + __PYX_ERR(0, 413, __pyx_L11_error) } } if (PY_MAJOR_VERSION >= 3) { @@ -9229,7 +9234,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_L7:; } - /* "dawg.pyx":411 + /* "dawg.pyx":415 * stream.close() * * return self # <<<<<<<<<<<<<< @@ -9241,7 +9246,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "dawg.pyx":384 + /* "dawg.pyx":388 * return self * * def load(self, path): # <<<<<<<<<<<<<< @@ -9265,7 +9270,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_15load(struct __pyx_obj_4dawg_C return __pyx_r; } -/* "dawg.pyx":413 +/* "dawg.pyx":417 * return self * * def _transitions(self): # <<<<<<<<<<<<<< @@ -9307,19 +9312,19 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj int __pyx_t_9; __Pyx_RefNannySetupContext("_transitions", 0); - /* "dawg.pyx":414 + /* "dawg.pyx":418 * * def _transitions(self): * transitions = set() # <<<<<<<<<<<<<< * cdef BaseType index, prev_index, completer_index * cdef char* key */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_transitions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":419 + /* "dawg.pyx":423 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -9328,7 +9333,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.dct, __pyx_v_self->guide); - /* "dawg.pyx":420 + /* "dawg.pyx":424 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(self.dct.root()) # <<<<<<<<<<<<<< @@ -9337,7 +9342,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ __pyx_v_completer.Start(__pyx_v_self->__pyx_base.dct.root()); - /* "dawg.pyx":422 + /* "dawg.pyx":426 * completer.Start(self.dct.root()) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -9348,7 +9353,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj __pyx_t_2 = (__pyx_v_completer.Next() != 0); if (!__pyx_t_2) break; - /* "dawg.pyx":423 + /* "dawg.pyx":427 * * while completer.Next(): * key = completer.key() # <<<<<<<<<<<<<< @@ -9357,7 +9362,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ __pyx_v_key = ((char *)__pyx_v_completer.key()); - /* "dawg.pyx":425 + /* "dawg.pyx":429 * key = completer.key() * * index = self.dct.root() # <<<<<<<<<<<<<< @@ -9366,7 +9371,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ __pyx_v_index = __pyx_v_self->__pyx_base.dct.root(); - /* "dawg.pyx":427 + /* "dawg.pyx":431 * index = self.dct.root() * * for i in range(completer.length()): # <<<<<<<<<<<<<< @@ -9378,7 +9383,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "dawg.pyx":428 + /* "dawg.pyx":432 * * for i in range(completer.length()): * prev_index = index # <<<<<<<<<<<<<< @@ -9387,7 +9392,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ __pyx_v_prev_index = __pyx_v_index; - /* "dawg.pyx":429 + /* "dawg.pyx":433 * for i in range(completer.length()): * prev_index = index * self.dct.Follow(&(key[i]), 1, &index) # <<<<<<<<<<<<<< @@ -9396,20 +9401,20 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj */ (void)(__pyx_v_self->__pyx_base.dct.Follow((&(__pyx_v_key[__pyx_v_i])), 1, (&__pyx_v_index))); - /* "dawg.pyx":431 + /* "dawg.pyx":435 * self.dct.Follow(&(key[i]), 1, &index) * transitions.add( * (prev_index, key[i], index) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_BaseType(__pyx_v_prev_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_dawgdic_3a__3a_BaseType(__pyx_v_prev_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_From_unsigned_char(((unsigned char)(__pyx_v_key[__pyx_v_i]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_unsigned_char(((unsigned char)(__pyx_v_key[__pyx_v_i]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_From_dawgdic_3a__3a_BaseType(__pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_dawgdic_3a__3a_BaseType(__pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); @@ -9421,19 +9426,19 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj __pyx_t_6 = 0; __pyx_t_7 = 0; - /* "dawg.pyx":430 + /* "dawg.pyx":434 * prev_index = index * self.dct.Follow(&(key[i]), 1, &index) * transitions.add( # <<<<<<<<<<<<<< * (prev_index, key[i], index) * ) */ - __pyx_t_9 = PySet_Add(__pyx_v_transitions, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_9 = PySet_Add(__pyx_v_transitions, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } - /* "dawg.pyx":434 + /* "dawg.pyx":438 * ) * * return sorted(list(transitions)) # <<<<<<<<<<<<<< @@ -9441,19 +9446,19 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PySequence_List(__pyx_v_transitions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_7 = PySequence_List(__pyx_v_transitions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_6 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_9 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; - /* "dawg.pyx":413 + /* "dawg.pyx":417 * return self * * def _transitions(self): # <<<<<<<<<<<<<< @@ -9476,7 +9481,7 @@ static PyObject *__pyx_pf_4dawg_14CompletionDAWG_17_transitions(struct __pyx_obj return __pyx_r; } -/* "dawg.pyx":469 +/* "dawg.pyx":473 * cdef Completer* _completer * * def __init__(self, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -9537,7 +9542,7 @@ static int __pyx_pw_4dawg_9BytesDAWG_1__init__(PyObject *__pyx_v_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 469, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 473, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -9557,13 +9562,13 @@ static int __pyx_pw_4dawg_9BytesDAWG_1__init__(PyObject *__pyx_v_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 469, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 473, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload_separator), (&PyBytes_Type), 1, "payload_separator", 1))) __PYX_ERR(0, 469, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload_separator), (&PyBytes_Type), 1, "payload_separator", 1))) __PYX_ERR(0, 473, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG___init__(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_arg, __pyx_v_input_is_sorted, __pyx_v_payload_separator); /* function exit code */ @@ -9576,7 +9581,7 @@ static int __pyx_pw_4dawg_9BytesDAWG_1__init__(PyObject *__pyx_v_self, PyObject } static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":479 +/* "dawg.pyx":483 * self._c_payload_separator = ord(payload_separator) * * keys = (self._raw_key(d[0], d[1]) for d in arg) # <<<<<<<<<<<<<< @@ -9593,7 +9598,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_8__init___genexpr(PyObject *__pyx_sel if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 479, __pyx_L1_error) + __PYX_ERR(0, 483, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -9601,7 +9606,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_8__init___genexpr(PyObject *__pyx_sel __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_8__init___2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_8__init___2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9637,32 +9642,32 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 479, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 479, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 483, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 483, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 483, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 483, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -9672,7 +9677,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_Coroutine PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 479, __pyx_L1_error) + else __PYX_ERR(0, 483, __pyx_L1_error) } break; } @@ -9682,14 +9687,14 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_Coroutine __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 479, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 483, __pyx_L1_error) } + __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 479, __pyx_L1_error) - __pyx_t_6 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_raw_key(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_5), 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_raw_key(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_5), 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -9711,7 +9716,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_Coroutine __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 483, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -9736,7 +9741,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator7(__pyx_Coroutine return __pyx_r; } -/* "dawg.pyx":469 +/* "dawg.pyx":473 * cdef Completer* _completer * * def __init__(self, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -9762,7 +9767,7 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_4___init__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 469, __pyx_L1_error) + __PYX_ERR(0, 473, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -9773,7 +9778,7 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arg); - /* "dawg.pyx":473 + /* "dawg.pyx":477 * ``arg`` must be an iterable of tuples (unicode_key, bytes_payload). * """ * if arg is None: # <<<<<<<<<<<<<< @@ -9784,21 +9789,21 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":474 + /* "dawg.pyx":478 * """ * if arg is None: * arg = [] # <<<<<<<<<<<<<< * * self._b_payload_separator = payload_separator */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_arg, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":473 + /* "dawg.pyx":477 * ``arg`` must be an iterable of tuples (unicode_key, bytes_payload). * """ * if arg is None: # <<<<<<<<<<<<<< @@ -9807,7 +9812,7 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * */ } - /* "dawg.pyx":476 + /* "dawg.pyx":480 * arg = [] * * self._b_payload_separator = payload_separator # <<<<<<<<<<<<<< @@ -9820,36 +9825,36 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->_b_payload_separator); __pyx_cur_scope->__pyx_v_self->_b_payload_separator = __pyx_v_payload_separator; - /* "dawg.pyx":477 + /* "dawg.pyx":481 * * self._b_payload_separator = payload_separator * self._c_payload_separator = ord(payload_separator) # <<<<<<<<<<<<<< * * keys = (self._raw_key(d[0], d[1]) for d in arg) */ - __pyx_t_4 = __Pyx_PyObject_Ord(__pyx_v_payload_separator); if (unlikely(__pyx_t_4 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Ord(__pyx_v_payload_separator); if (unlikely(__pyx_t_4 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 481, __pyx_L1_error) __pyx_cur_scope->__pyx_v_self->_c_payload_separator = ((unsigned int)__pyx_t_4); - /* "dawg.pyx":479 + /* "dawg.pyx":483 * self._c_payload_separator = ord(payload_separator) * * keys = (self._raw_key(d[0], d[1]) for d in arg) # <<<<<<<<<<<<<< * super(BytesDAWG, self).__init__(keys, input_is_sorted) * */ - __pyx_t_3 = __pyx_pf_4dawg_9BytesDAWG_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_4dawg_9BytesDAWG_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_keys = __pyx_t_3; __pyx_t_3 = 0; - /* "dawg.pyx":480 + /* "dawg.pyx":484 * * keys = (self._raw_key(d[0], d[1]) for d in arg) * super(BytesDAWG, self).__init__(keys, input_is_sorted) # <<<<<<<<<<<<<< * * self._update_completer() */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); @@ -9857,10 +9862,10 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_self)); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -9878,7 +9883,7 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_keys, __pyx_v_input_is_sorted}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else @@ -9886,13 +9891,13 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_keys, __pyx_v_input_is_sorted}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9903,25 +9908,25 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * __Pyx_INCREF(__pyx_v_input_is_sorted); __Pyx_GIVEREF(__pyx_v_input_is_sorted); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_input_is_sorted); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":482 + /* "dawg.pyx":486 * super(BytesDAWG, self).__init__(keys, input_is_sorted) * * self._update_completer() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":469 + /* "dawg.pyx":473 * cdef Completer* _completer * * def __init__(self, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -9946,7 +9951,7 @@ static int __pyx_pf_4dawg_9BytesDAWG___init__(struct __pyx_obj_4dawg_BytesDAWG * return __pyx_r; } -/* "dawg.pyx":484 +/* "dawg.pyx":488 * self._update_completer() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -9970,7 +9975,7 @@ static void __pyx_pf_4dawg_9BytesDAWG_2__dealloc__(struct __pyx_obj_4dawg_BytesD int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "dawg.pyx":485 + /* "dawg.pyx":489 * * def __dealloc__(self): * if self._completer: # <<<<<<<<<<<<<< @@ -9980,7 +9985,7 @@ static void __pyx_pf_4dawg_9BytesDAWG_2__dealloc__(struct __pyx_obj_4dawg_BytesD __pyx_t_1 = (__pyx_v_self->_completer != 0); if (__pyx_t_1) { - /* "dawg.pyx":486 + /* "dawg.pyx":490 * def __dealloc__(self): * if self._completer: * del self._completer # <<<<<<<<<<<<<< @@ -9989,7 +9994,7 @@ static void __pyx_pf_4dawg_9BytesDAWG_2__dealloc__(struct __pyx_obj_4dawg_BytesD */ delete __pyx_v_self->_completer; - /* "dawg.pyx":485 + /* "dawg.pyx":489 * * def __dealloc__(self): * if self._completer: # <<<<<<<<<<<<<< @@ -9998,7 +10003,7 @@ static void __pyx_pf_4dawg_9BytesDAWG_2__dealloc__(struct __pyx_obj_4dawg_BytesD */ } - /* "dawg.pyx":484 + /* "dawg.pyx":488 * self._update_completer() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -10010,7 +10015,7 @@ static void __pyx_pf_4dawg_9BytesDAWG_2__dealloc__(struct __pyx_obj_4dawg_BytesD __Pyx_RefNannyFinishContext(); } -/* "dawg.pyx":488 +/* "dawg.pyx":492 * del self._completer * * cpdef bytes _raw_key(self, unicode key, bytes payload): # <<<<<<<<<<<<<< @@ -10044,7 +10049,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raw_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raw_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_5_raw_key)) { __Pyx_XDECREF(__pyx_r); @@ -10064,7 +10069,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_payload}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -10072,13 +10077,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_payload}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -10089,12 +10094,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __Pyx_INCREF(__pyx_v_payload); __Pyx_GIVEREF(__pyx_v_payload); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_payload); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 488, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 492, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10113,7 +10118,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD #endif } - /* "dawg.pyx":489 + /* "dawg.pyx":493 * * cpdef bytes _raw_key(self, unicode key, bytes payload): * cdef bytes b_key = key.encode('utf8') # <<<<<<<<<<<<<< @@ -10122,9 +10127,9 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 489, __pyx_L1_error) + __PYX_ERR(0, 493, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -10132,27 +10137,27 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __pyx_v_b_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":491 + /* "dawg.pyx":495 * cdef bytes b_key = key.encode('utf8') * * if self._b_payload_separator in b_key: # <<<<<<<<<<<<<< * raise Error("Payload separator (%r) is found within utf8-encoded key ('%s')" % (self._b_payload_separator, key)) * */ - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_self->_b_payload_separator, __pyx_v_b_key, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_self->_b_payload_separator, __pyx_v_b_key, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 != 0); if (unlikely(__pyx_t_8)) { - /* "dawg.pyx":492 + /* "dawg.pyx":496 * * if self._b_payload_separator in b_key: * raise Error("Payload separator (%r) is found within utf8-encoded key ('%s')" % (self._b_payload_separator, key)) # <<<<<<<<<<<<<< * * cdef bytes encoded_payload = b2a_base64(payload) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_10 = 127; @@ -10160,7 +10165,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __pyx_t_9 += 19; __Pyx_GIVEREF(__pyx_kp_u_Payload_separator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Payload_separator); - __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->_b_payload_separator), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->_b_payload_separator), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_10; __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -10171,7 +10176,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __pyx_t_9 += 37; __Pyx_GIVEREF(__pyx_kp_u_is_found_within_utf8_encoded_ke); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_is_found_within_utf8_encoded_ke); - __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_10; __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); @@ -10182,7 +10187,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __pyx_t_9 += 2; __Pyx_GIVEREF(__pyx_kp_u__11); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__11); - __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -10198,14 +10203,14 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 492, __pyx_L1_error) + __PYX_ERR(0, 496, __pyx_L1_error) - /* "dawg.pyx":491 + /* "dawg.pyx":495 * cdef bytes b_key = key.encode('utf8') * * if self._b_payload_separator in b_key: # <<<<<<<<<<<<<< @@ -10214,14 +10219,14 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD */ } - /* "dawg.pyx":494 + /* "dawg.pyx":498 * raise Error("Payload separator (%r) is found within utf8-encoded key ('%s')" % (self._b_payload_separator, key)) * * cdef bytes encoded_payload = b2a_base64(payload) # <<<<<<<<<<<<<< * return b_key + self._b_payload_separator + encoded_payload * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_b2a_base64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_b2a_base64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -10235,14 +10240,14 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_payload) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_payload); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 494, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 498, __pyx_L1_error) __pyx_v_encoded_payload = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":495 + /* "dawg.pyx":499 * * cdef bytes encoded_payload = b2a_base64(payload) * return b_key + self._b_payload_separator + encoded_payload # <<<<<<<<<<<<<< @@ -10250,16 +10255,16 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__raw_key(struct __pyx_obj_4dawg_BytesD * cdef _update_completer(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyNumber_Add(__pyx_v_b_key, __pyx_v_self->_b_payload_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_b_key, __pyx_v_self->_b_payload_separator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_encoded_payload); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_encoded_payload); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":488 + /* "dawg.pyx":492 * del self._completer * * cpdef bytes _raw_key(self, unicode key, bytes payload): # <<<<<<<<<<<<<< @@ -10316,11 +10321,11 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_5_raw_key(PyObject *__pyx_v_self, PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_payload)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_raw_key", 1, 2, 2, 1); __PYX_ERR(0, 488, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_raw_key", 1, 2, 2, 1); __PYX_ERR(0, 492, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_raw_key") < 0)) __PYX_ERR(0, 488, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_raw_key") < 0)) __PYX_ERR(0, 492, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -10333,14 +10338,14 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_5_raw_key(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_raw_key", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 488, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_raw_key", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG._raw_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 488, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload), (&PyBytes_Type), 1, "payload", 1))) __PYX_ERR(0, 488, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 492, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload), (&PyBytes_Type), 1, "payload", 1))) __PYX_ERR(0, 492, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_4_raw_key(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_key, __pyx_v_payload); /* function exit code */ @@ -10358,7 +10363,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_4_raw_key(struct __pyx_obj_4dawg_Byte PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_raw_key", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG__raw_key(__pyx_v_self, __pyx_v_key, __pyx_v_payload, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG__raw_key(__pyx_v_self, __pyx_v_key, __pyx_v_payload, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -10375,7 +10380,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_4_raw_key(struct __pyx_obj_4dawg_Byte return __pyx_r; } -/* "dawg.pyx":497 +/* "dawg.pyx":501 * return b_key + self._b_payload_separator + encoded_payload * * cdef _update_completer(self): # <<<<<<<<<<<<<< @@ -10389,7 +10394,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da int __pyx_t_1; __Pyx_RefNannySetupContext("_update_completer", 0); - /* "dawg.pyx":498 + /* "dawg.pyx":502 * * cdef _update_completer(self): * if self._completer: # <<<<<<<<<<<<<< @@ -10399,7 +10404,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da __pyx_t_1 = (__pyx_v_self->_completer != 0); if (__pyx_t_1) { - /* "dawg.pyx":499 + /* "dawg.pyx":503 * cdef _update_completer(self): * if self._completer: * del self._completer # <<<<<<<<<<<<<< @@ -10408,7 +10413,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da */ delete __pyx_v_self->_completer; - /* "dawg.pyx":498 + /* "dawg.pyx":502 * * cdef _update_completer(self): * if self._completer: # <<<<<<<<<<<<<< @@ -10417,7 +10422,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da */ } - /* "dawg.pyx":500 + /* "dawg.pyx":504 * if self._completer: * del self._completer * self._completer = new Completer(self.dct, self.guide) # <<<<<<<<<<<<<< @@ -10426,7 +10431,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da */ __pyx_v_self->_completer = new dawgdic::Completer(__pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":497 + /* "dawg.pyx":501 * return b_key + self._b_payload_separator + encoded_payload * * cdef _update_completer(self): # <<<<<<<<<<<<<< @@ -10441,7 +10446,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__update_completer(struct __pyx_obj_4da return __pyx_r; } -/* "dawg.pyx":502 +/* "dawg.pyx":506 * self._completer = new Completer(self.dct, self.guide) * * def load(self, path): # <<<<<<<<<<<<<< @@ -10472,14 +10477,14 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_6load(struct __pyx_obj_4dawg_BytesDAW PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("load", 0); - /* "dawg.pyx":503 + /* "dawg.pyx":507 * * def load(self, path): * res = super(BytesDAWG, self).load(path) # <<<<<<<<<<<<<< * self._update_completer() * return res */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); @@ -10487,10 +10492,10 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_6load(struct __pyx_obj_4dawg_BytesDAW __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -10505,24 +10510,24 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_6load(struct __pyx_obj_4dawg_BytesDAW } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_res = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":504 + /* "dawg.pyx":508 * def load(self, path): * res = super(BytesDAWG, self).load(path) * self._update_completer() # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":505 + /* "dawg.pyx":509 * res = super(BytesDAWG, self).load(path) * self._update_completer() * return res # <<<<<<<<<<<<<< @@ -10534,7 +10539,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_6load(struct __pyx_obj_4dawg_BytesDAW __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":502 + /* "dawg.pyx":506 * self._completer = new Completer(self.dct, self.guide) * * def load(self, path): # <<<<<<<<<<<<<< @@ -10556,7 +10561,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_6load(struct __pyx_obj_4dawg_BytesDAW return __pyx_r; } -/* "dawg.pyx":507 +/* "dawg.pyx":511 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -10583,7 +10588,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frombytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_9frombytes)) { __Pyx_XDECREF(__pyx_r); @@ -10600,7 +10605,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -10621,14 +10626,14 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes #endif } - /* "dawg.pyx":508 + /* "dawg.pyx":512 * * cpdef frombytes(self, bytes data): * res = super(BytesDAWG, self).frombytes(data) # <<<<<<<<<<<<<< * self._update_completer() * return res */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_BytesDAWG)); @@ -10636,10 +10641,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -10654,24 +10659,24 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_res = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":509 + /* "dawg.pyx":513 * cpdef frombytes(self, bytes data): * res = super(BytesDAWG, self).frombytes(data) * self._update_completer() # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_update_completer(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":510 + /* "dawg.pyx":514 * res = super(BytesDAWG, self).frombytes(data) * self._update_completer() * return res # <<<<<<<<<<<<<< @@ -10683,7 +10688,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_frombytes(struct __pyx_obj_4dawg_Bytes __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":507 + /* "dawg.pyx":511 * return res * * cpdef frombytes(self, bytes data): # <<<<<<<<<<<<<< @@ -10713,7 +10718,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_9frombytes(PyObject *__pyx_v_self, Py PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("frombytes (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 511, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_8frombytes(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_data)); /* function exit code */ @@ -10731,7 +10736,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_8frombytes(struct __pyx_obj_4dawg_Byt PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("frombytes", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_frombytes(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -10748,7 +10753,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_8frombytes(struct __pyx_obj_4dawg_Byt return __pyx_r; } -/* "dawg.pyx":512 +/* "dawg.pyx":516 * return res * * cpdef bint b_has_key(self, bytes key) except -1: # <<<<<<<<<<<<<< @@ -10776,7 +10781,7 @@ static int __pyx_f_4dawg_9BytesDAWG_b_has_key(struct __pyx_obj_4dawg_BytesDAWG * if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_has_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_11b_has_key)) { __Pyx_INCREF(__pyx_t_1); @@ -10792,10 +10797,10 @@ static int __pyx_f_4dawg_9BytesDAWG_b_has_key(struct __pyx_obj_4dawg_BytesDAWG * } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10814,7 +10819,7 @@ static int __pyx_f_4dawg_9BytesDAWG_b_has_key(struct __pyx_obj_4dawg_BytesDAWG * #endif } - /* "dawg.pyx":514 + /* "dawg.pyx":518 * cpdef bint b_has_key(self, bytes key) except -1: * cdef BaseType index * return self._follow_key(key, &index) # <<<<<<<<<<<<<< @@ -10824,7 +10829,7 @@ static int __pyx_f_4dawg_9BytesDAWG_b_has_key(struct __pyx_obj_4dawg_BytesDAWG * __pyx_r = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_follow_key(__pyx_v_self, __pyx_v_key, (&__pyx_v_index)); goto __pyx_L0; - /* "dawg.pyx":512 + /* "dawg.pyx":516 * return res * * cpdef bint b_has_key(self, bytes key) except -1: # <<<<<<<<<<<<<< @@ -10852,7 +10857,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_11b_has_key(PyObject *__pyx_v_self, P PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_has_key (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 512, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 516, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_10b_has_key(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -10871,8 +10876,8 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_10b_has_key(struct __pyx_obj_4dawg_By PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("b_has_key", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_b_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_b_has_key(__pyx_v_self, __pyx_v_key, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -10889,7 +10894,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_10b_has_key(struct __pyx_obj_4dawg_By return __pyx_r; } -/* "dawg.pyx":516 +/* "dawg.pyx":520 * return self._follow_key(key, &index) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -10919,19 +10924,19 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_12__getitem__(struct __pyx_obj_4dawg_ int __pyx_t_3; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "dawg.pyx":517 + /* "dawg.pyx":521 * * def __getitem__(self, key): * res = self.get(key) # <<<<<<<<<<<<<< * if res is None: * raise KeyError(key) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":518 + /* "dawg.pyx":522 * def __getitem__(self, key): * res = self.get(key) * if res is None: # <<<<<<<<<<<<<< @@ -10942,20 +10947,20 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_12__getitem__(struct __pyx_obj_4dawg_ __pyx_t_3 = (__pyx_t_2 != 0); if (unlikely(__pyx_t_3)) { - /* "dawg.pyx":519 + /* "dawg.pyx":523 * res = self.get(key) * if res is None: * raise KeyError(key) # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 519, __pyx_L1_error) + __PYX_ERR(0, 523, __pyx_L1_error) - /* "dawg.pyx":518 + /* "dawg.pyx":522 * def __getitem__(self, key): * res = self.get(key) * if res is None: # <<<<<<<<<<<<<< @@ -10964,7 +10969,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_12__getitem__(struct __pyx_obj_4dawg_ */ } - /* "dawg.pyx":520 + /* "dawg.pyx":524 * if res is None: * raise KeyError(key) * return res # <<<<<<<<<<<<<< @@ -10976,7 +10981,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_12__getitem__(struct __pyx_obj_4dawg_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":516 + /* "dawg.pyx":520 * return self._follow_key(key, &index) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -10996,7 +11001,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_12__getitem__(struct __pyx_obj_4dawg_ return __pyx_r; } -/* "dawg.pyx":522 +/* "dawg.pyx":526 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -11033,7 +11038,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_15get)) { __Pyx_XDECREF(__pyx_r); @@ -11053,7 +11058,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -11061,13 +11066,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -11078,7 +11083,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_default); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -11101,7 +11106,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * #endif } - /* "dawg.pyx":527 + /* "dawg.pyx":531 * or ``default`` if the key is not found. * """ * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -11112,19 +11117,19 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { - /* "dawg.pyx":528 + /* "dawg.pyx":532 * """ * if isinstance(key, unicode): * res = self.get_value(key) # <<<<<<<<<<<<<< * else: * res = self.b_get_value(key) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":527 + /* "dawg.pyx":531 * or ``default`` if the key is not found. * """ * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -11134,7 +11139,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * goto __pyx_L3; } - /* "dawg.pyx":530 + /* "dawg.pyx":534 * res = self.get_value(key) * else: * res = self.b_get_value(key) # <<<<<<<<<<<<<< @@ -11142,15 +11147,15 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * * if not res: */ /*else*/ { - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 530, __pyx_L1_error) - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; - /* "dawg.pyx":532 + /* "dawg.pyx":536 * res = self.b_get_value(key) * * if not res: # <<<<<<<<<<<<<< @@ -11161,7 +11166,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { - /* "dawg.pyx":533 + /* "dawg.pyx":537 * * if not res: * return default # <<<<<<<<<<<<<< @@ -11173,7 +11178,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * __pyx_r = __pyx_v_default; goto __pyx_L0; - /* "dawg.pyx":532 + /* "dawg.pyx":536 * res = self.b_get_value(key) * * if not res: # <<<<<<<<<<<<<< @@ -11182,7 +11187,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * */ } - /* "dawg.pyx":534 + /* "dawg.pyx":538 * if not res: * return default * return res # <<<<<<<<<<<<<< @@ -11194,7 +11199,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get(struct __pyx_obj_4dawg_BytesDAWG * __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":522 + /* "dawg.pyx":526 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -11255,7 +11260,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_15get(PyObject *__pyx_v_self, PyObjec } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 522, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 526, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -11271,7 +11276,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_15get(PyObject *__pyx_v_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 522, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 526, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11293,7 +11298,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_14get(struct __pyx_obj_4dawg_BytesDAW __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; - __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11310,7 +11315,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_14get(struct __pyx_obj_4dawg_BytesDAW return __pyx_r; } -/* "dawg.pyx":536 +/* "dawg.pyx":540 * return res * * cdef bint _follow_key(self, bytes key, BaseType* index): # <<<<<<<<<<<<<< @@ -11326,7 +11331,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG int __pyx_t_3; __Pyx_RefNannySetupContext("_follow_key", 0); - /* "dawg.pyx":537 + /* "dawg.pyx":541 * * cdef bint _follow_key(self, bytes key, BaseType* index): * index[0] = self.dct.root() # <<<<<<<<<<<<<< @@ -11335,7 +11340,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG */ (__pyx_v_index[0]) = __pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":538 + /* "dawg.pyx":542 * cdef bint _follow_key(self, bytes key, BaseType* index): * index[0] = self.dct.root() * if not self.dct.Follow(key, len(key), index): # <<<<<<<<<<<<<< @@ -11344,18 +11349,18 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 538, __pyx_L1_error) + __PYX_ERR(0, 542, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 538, __pyx_L1_error) + __PYX_ERR(0, 542, __pyx_L1_error) } - __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 542, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_1, __pyx_t_2, __pyx_v_index) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":539 + /* "dawg.pyx":543 * index[0] = self.dct.root() * if not self.dct.Follow(key, len(key), index): * return False # <<<<<<<<<<<<<< @@ -11365,7 +11370,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = 0; goto __pyx_L0; - /* "dawg.pyx":538 + /* "dawg.pyx":542 * cdef bint _follow_key(self, bytes key, BaseType* index): * index[0] = self.dct.root() * if not self.dct.Follow(key, len(key), index): # <<<<<<<<<<<<<< @@ -11374,7 +11379,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG */ } - /* "dawg.pyx":540 + /* "dawg.pyx":544 * if not self.dct.Follow(key, len(key), index): * return False * return self.dct.Follow(self._c_payload_separator, index) # <<<<<<<<<<<<<< @@ -11384,7 +11389,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_v_self->_c_payload_separator, __pyx_v_index); goto __pyx_L0; - /* "dawg.pyx":536 + /* "dawg.pyx":540 * return res * * cdef bint _follow_key(self, bytes key, BaseType* index): # <<<<<<<<<<<<<< @@ -11401,7 +11406,7 @@ static int __pyx_f_4dawg_9BytesDAWG__follow_key(struct __pyx_obj_4dawg_BytesDAWG return __pyx_r; } -/* "dawg.pyx":542 +/* "dawg.pyx":546 * return self.dct.Follow(self._c_payload_separator, index) * * cpdef list get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -11427,7 +11432,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get_value(struct __pyx_obj_4dawg_Bytes if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_17get_value)) { __Pyx_XDECREF(__pyx_r); @@ -11444,10 +11449,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get_value(struct __pyx_obj_4dawg_Bytes } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 542, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 546, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11466,7 +11471,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get_value(struct __pyx_obj_4dawg_Bytes #endif } - /* "dawg.pyx":543 + /* "dawg.pyx":547 * * cpdef list get_value(self, unicode key): * return self.b_get_value(key.encode('utf8')) # <<<<<<<<<<<<<< @@ -11476,18 +11481,18 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_get_value(struct __pyx_obj_4dawg_Bytes __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 543, __pyx_L1_error) + __PYX_ERR(0, 547, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "dawg.pyx":542 + /* "dawg.pyx":546 * return self.dct.Follow(self._c_payload_separator, index) * * cpdef list get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -11516,7 +11521,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_17get_value(PyObject *__pyx_v_self, P PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 542, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 546, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_16get_value(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -11534,7 +11539,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_16get_value(struct __pyx_obj_4dawg_By PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_get_value(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_get_value(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11551,7 +11556,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_16get_value(struct __pyx_obj_4dawg_By return __pyx_r; } -/* "dawg.pyx":545 +/* "dawg.pyx":549 * return self.b_get_value(key.encode('utf8')) * * cdef list _value_for_index(self, BaseType index): # <<<<<<<<<<<<<< @@ -11571,7 +11576,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_value_for_index", 0); - /* "dawg.pyx":559 + /* "dawg.pyx":563 * cdef vector[string] results * * self._completer.Start(index) # <<<<<<<<<<<<<< @@ -11580,7 +11585,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw */ __pyx_v_self->_completer->Start(__pyx_v_index); - /* "dawg.pyx":561 + /* "dawg.pyx":565 * self._completer.Start(index) * * while self._completer.Next(): # <<<<<<<<<<<<<< @@ -11591,7 +11596,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw __pyx_t_1 = (__pyx_v_self->_completer->Next() != 0); if (!__pyx_t_1) break; - /* "dawg.pyx":562 + /* "dawg.pyx":566 * * while self._completer.Next(): * b64_decoder.init() # <<<<<<<<<<<<<< @@ -11600,7 +11605,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw */ __pyx_v_b64_decoder.init(); - /* "dawg.pyx":563 + /* "dawg.pyx":567 * while self._completer.Next(): * b64_decoder.init() * key_len = b64_decoder.decode( # <<<<<<<<<<<<<< @@ -11609,7 +11614,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw */ __pyx_v_key_len = __pyx_v_b64_decoder.decode(__pyx_v_self->_completer->key(), __pyx_v_self->_completer->length(), __pyx_v_b64_decoder_storage); - /* "dawg.pyx":568 + /* "dawg.pyx":572 * b64_decoder_storage * ) * results.push_back(string(b64_decoder_storage, key_len)) # <<<<<<<<<<<<<< @@ -11620,17 +11625,17 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw __pyx_t_2 = std::string(__pyx_v_b64_decoder_storage, __pyx_v_key_len); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 568, __pyx_L1_error) + __PYX_ERR(0, 572, __pyx_L1_error) } try { __pyx_v_results.push_back(__pyx_t_2); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 568, __pyx_L1_error) + __PYX_ERR(0, 572, __pyx_L1_error) } } - /* "dawg.pyx":570 + /* "dawg.pyx":574 * results.push_back(string(b64_decoder_storage, key_len)) * * return results # <<<<<<<<<<<<<< @@ -11638,14 +11643,14 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw * cpdef list b_get_value(self, bytes key): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_results); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_results); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyList_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 570, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "dawg.pyx":545 + /* "dawg.pyx":549 * return self.b_get_value(key.encode('utf8')) * * cdef list _value_for_index(self, BaseType index): # <<<<<<<<<<<<<< @@ -11664,7 +11669,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__value_for_index(struct __pyx_obj_4daw return __pyx_r; } -/* "dawg.pyx":572 +/* "dawg.pyx":576 * return results * * cpdef list b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -11692,7 +11697,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_19b_get_value)) { __Pyx_XDECREF(__pyx_r); @@ -11709,10 +11714,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 572, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 576, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11731,7 +11736,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt #endif } - /* "dawg.pyx":574 + /* "dawg.pyx":578 * cpdef list b_get_value(self, bytes key): * cdef BaseType index * if not self._follow_key(key, &index): # <<<<<<<<<<<<<< @@ -11741,7 +11746,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt __pyx_t_5 = ((!(((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_follow_key(__pyx_v_self, __pyx_v_key, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_5) { - /* "dawg.pyx":575 + /* "dawg.pyx":579 * cdef BaseType index * if not self._follow_key(key, &index): * return [] # <<<<<<<<<<<<<< @@ -11749,13 +11754,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":574 + /* "dawg.pyx":578 * cpdef list b_get_value(self, bytes key): * cdef BaseType index * if not self._follow_key(key, &index): # <<<<<<<<<<<<<< @@ -11764,7 +11769,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt */ } - /* "dawg.pyx":576 + /* "dawg.pyx":580 * if not self._follow_key(key, &index): * return [] * return self._value_for_index(index) # <<<<<<<<<<<<<< @@ -11772,13 +11777,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_b_get_value(struct __pyx_obj_4dawg_Byt * cpdef list items(self, unicode prefix=""): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":572 + /* "dawg.pyx":576 * return results * * cpdef list b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -11807,7 +11812,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_19b_get_value(PyObject *__pyx_v_self, PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 576, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_18b_get_value(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -11825,7 +11830,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_18b_get_value(struct __pyx_obj_4dawg_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("b_get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11842,7 +11847,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_18b_get_value(struct __pyx_obj_4dawg_ return __pyx_r; } -/* "dawg.pyx":578 +/* "dawg.pyx":582 * return self._value_for_index(index) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -11894,7 +11899,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_21items)) { __Pyx_XDECREF(__pyx_r); @@ -11911,10 +11916,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 578, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11933,7 +11938,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG #endif } - /* "dawg.pyx":579 + /* "dawg.pyx":583 * * cpdef list items(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -11942,26 +11947,26 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 579, __pyx_L1_error) + __PYX_ERR(0, 583, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":582 + /* "dawg.pyx":586 * cdef bytes value * cdef int i * cdef list res = [] # <<<<<<<<<<<<<< * cdef char* raw_key * cdef char* raw_value */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":587 + /* "dawg.pyx":591 * cdef int raw_value_len * * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -11970,7 +11975,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_index = __pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":588 + /* "dawg.pyx":592 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -11979,13 +11984,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 588, __pyx_L1_error) + __PYX_ERR(0, 592, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 592, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_5, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":589 + /* "dawg.pyx":593 * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): * return res # <<<<<<<<<<<<<< @@ -11997,7 +12002,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":588 + /* "dawg.pyx":592 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -12006,7 +12011,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ } - /* "dawg.pyx":596 + /* "dawg.pyx":600 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -12015,7 +12020,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":597 + /* "dawg.pyx":601 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -12024,12 +12029,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 597, __pyx_L1_error) + __PYX_ERR(0, 601, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 601, __pyx_L1_error) __pyx_v_completer.Start(__pyx_v_index, __pyx_t_7); - /* "dawg.pyx":599 + /* "dawg.pyx":603 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -12040,7 +12045,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG __pyx_t_6 = (__pyx_v_completer.Next() != 0); if (!__pyx_t_6) break; - /* "dawg.pyx":600 + /* "dawg.pyx":604 * * while completer.Next(): * raw_key = completer.key() # <<<<<<<<<<<<<< @@ -12049,7 +12054,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_raw_key = ((char *)__pyx_v_completer.key()); - /* "dawg.pyx":602 + /* "dawg.pyx":606 * raw_key = completer.key() * * for i in range(0, completer.length()): # <<<<<<<<<<<<<< @@ -12061,7 +12066,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "dawg.pyx":603 + /* "dawg.pyx":607 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12071,7 +12076,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG __pyx_t_6 = (((__pyx_v_raw_key[__pyx_v_i]) == __pyx_v_self->_c_payload_separator) != 0); if (__pyx_t_6) { - /* "dawg.pyx":604 + /* "dawg.pyx":608 * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: * break # <<<<<<<<<<<<<< @@ -12080,7 +12085,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ goto __pyx_L7_break; - /* "dawg.pyx":603 + /* "dawg.pyx":607 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12091,7 +12096,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG } __pyx_L7_break:; - /* "dawg.pyx":606 + /* "dawg.pyx":610 * break * * raw_value = &(raw_key[i]) # <<<<<<<<<<<<<< @@ -12100,7 +12105,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_raw_value = (&(__pyx_v_raw_key[__pyx_v_i])); - /* "dawg.pyx":607 + /* "dawg.pyx":611 * * raw_value = &(raw_key[i]) * raw_value_len = completer.length() - i # <<<<<<<<<<<<<< @@ -12109,7 +12114,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_raw_value_len = (__pyx_v_completer.length() - __pyx_v_i); - /* "dawg.pyx":609 + /* "dawg.pyx":613 * raw_value_len = completer.length() - i * * _b64_decoder.init() # <<<<<<<<<<<<<< @@ -12118,7 +12123,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v__b64_decoder.init(); - /* "dawg.pyx":610 + /* "dawg.pyx":614 * * _b64_decoder.init() * _len = _b64_decoder.decode(raw_value, raw_value_len, _b64_decoder_storage) # <<<<<<<<<<<<<< @@ -12127,38 +12132,38 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v__len = __pyx_v__b64_decoder.decode(__pyx_v_raw_value, __pyx_v_raw_value_len, __pyx_v__b64_decoder_storage); - /* "dawg.pyx":611 + /* "dawg.pyx":615 * _b64_decoder.init() * _len = _b64_decoder.decode(raw_value, raw_value_len, _b64_decoder_storage) * value = _b64_decoder_storage[:_len] # <<<<<<<<<<<<<< * * u_key = raw_key[:i].decode('utf8') */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v__b64_decoder_storage) + 0, __pyx_v__len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v__b64_decoder_storage) + 0, __pyx_v__len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_value, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "dawg.pyx":613 + /* "dawg.pyx":617 * value = _b64_decoder_storage[:_len] * * u_key = raw_key[:i].decode('utf8') # <<<<<<<<<<<<<< * res.append( * (u_key, value) */ - __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_raw_key, 0, __pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_raw_key, 0, __pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_u_key, __pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":615 + /* "dawg.pyx":619 * u_key = raw_key[:i].decode('utf8') * res.append( * (u_key, value) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_u_key); __Pyx_GIVEREF(__pyx_v_u_key); @@ -12167,18 +12172,18 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); - /* "dawg.pyx":614 + /* "dawg.pyx":618 * * u_key = raw_key[:i].decode('utf8') * res.append( # <<<<<<<<<<<<<< * (u_key, value) * ) */ - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "dawg.pyx":618 + /* "dawg.pyx":622 * ) * * return res # <<<<<<<<<<<<<< @@ -12190,7 +12195,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_items(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":578 + /* "dawg.pyx":582 * return self._value_for_index(index) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -12246,7 +12251,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_21items(PyObject *__pyx_v_self, PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 578, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 582, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -12260,13 +12265,13 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_21items(PyObject *__pyx_v_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 578, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.items", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 578, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_20items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -12287,7 +12292,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_20items(struct __pyx_obj_4dawg_BytesD __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->items(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->items(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12305,7 +12310,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_20items(struct __pyx_obj_4dawg_BytesD } static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":620 +/* "dawg.pyx":624 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -12343,7 +12348,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_23iteritems(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 620, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 624, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -12357,13 +12362,13 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_23iteritems(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 620, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 624, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 620, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 624, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_22iteritems(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -12384,7 +12389,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_22iteritems(struct __pyx_obj_4dawg_By if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_6_iteritems *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 620, __pyx_L1_error) + __PYX_ERR(0, 624, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -12395,7 +12400,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_22iteritems(struct __pyx_obj_4dawg_By __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_24generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_BytesDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 620, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_24generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_BytesDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -12432,9 +12437,9 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 620, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 624, __pyx_L1_error) - /* "dawg.pyx":621 + /* "dawg.pyx":625 * * def iteritems(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -12443,15 +12448,15 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 621, __pyx_L1_error) + __PYX_ERR(0, 625, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":628 + /* "dawg.pyx":632 * cdef int raw_value_len * * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -12460,7 +12465,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":629 + /* "dawg.pyx":633 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -12469,13 +12474,13 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 629, __pyx_L1_error) + __PYX_ERR(0, 633, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_2, (&__pyx_cur_scope->__pyx_v_index)) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":630 + /* "dawg.pyx":634 * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): * return # <<<<<<<<<<<<<< @@ -12486,7 +12491,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ __pyx_r = NULL; goto __pyx_L0; - /* "dawg.pyx":629 + /* "dawg.pyx":633 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -12495,7 +12500,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ } - /* "dawg.pyx":637 + /* "dawg.pyx":641 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -12504,7 +12509,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_f_4dawg_init_completer(__pyx_cur_scope->__pyx_v_completer, __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_cur_scope->__pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":638 + /* "dawg.pyx":642 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -12513,12 +12518,12 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 642, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L1_error) __pyx_cur_scope->__pyx_v_completer.Start(__pyx_cur_scope->__pyx_v_index, __pyx_t_4); - /* "dawg.pyx":640 + /* "dawg.pyx":644 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -12529,7 +12534,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ __pyx_t_3 = (__pyx_cur_scope->__pyx_v_completer.Next() != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":641 + /* "dawg.pyx":645 * * while completer.Next(): * raw_key = completer.key() # <<<<<<<<<<<<<< @@ -12538,7 +12543,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_raw_key = ((char *)__pyx_cur_scope->__pyx_v_completer.key()); - /* "dawg.pyx":643 + /* "dawg.pyx":647 * raw_key = completer.key() * * for i in range(0, completer.length()): # <<<<<<<<<<<<<< @@ -12550,7 +12555,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_7; - /* "dawg.pyx":644 + /* "dawg.pyx":648 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12560,7 +12565,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ __pyx_t_3 = (((__pyx_cur_scope->__pyx_v_raw_key[__pyx_cur_scope->__pyx_v_i]) == __pyx_cur_scope->__pyx_v_self->_c_payload_separator) != 0); if (__pyx_t_3) { - /* "dawg.pyx":645 + /* "dawg.pyx":649 * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: * break # <<<<<<<<<<<<<< @@ -12569,7 +12574,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ goto __pyx_L8_break; - /* "dawg.pyx":644 + /* "dawg.pyx":648 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12580,7 +12585,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ } __pyx_L8_break:; - /* "dawg.pyx":647 + /* "dawg.pyx":651 * break * * raw_value = &(raw_key[i]) # <<<<<<<<<<<<<< @@ -12589,7 +12594,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_raw_value = (&(__pyx_cur_scope->__pyx_v_raw_key[__pyx_cur_scope->__pyx_v_i])); - /* "dawg.pyx":648 + /* "dawg.pyx":652 * * raw_value = &(raw_key[i]) * raw_value_len = completer.length() - i # <<<<<<<<<<<<<< @@ -12598,7 +12603,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_raw_value_len = (__pyx_cur_scope->__pyx_v_completer.length() - __pyx_cur_scope->__pyx_v_i); - /* "dawg.pyx":650 + /* "dawg.pyx":654 * raw_value_len = completer.length() - i * * _b64_decoder.init() # <<<<<<<<<<<<<< @@ -12607,7 +12612,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v__b64_decoder.init(); - /* "dawg.pyx":651 + /* "dawg.pyx":655 * * _b64_decoder.init() * _len = _b64_decoder.decode(raw_value, raw_value_len, _b64_decoder_storage) # <<<<<<<<<<<<<< @@ -12616,42 +12621,42 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v__len = __pyx_cur_scope->__pyx_v__b64_decoder.decode(__pyx_cur_scope->__pyx_v_raw_value, __pyx_cur_scope->__pyx_v_raw_value_len, __pyx_cur_scope->__pyx_v__b64_decoder_storage); - /* "dawg.pyx":652 + /* "dawg.pyx":656 * _b64_decoder.init() * _len = _b64_decoder.decode(raw_value, raw_value_len, _b64_decoder_storage) * value = _b64_decoder_storage[:_len] # <<<<<<<<<<<<<< * * u_key = raw_key[:i].decode('utf8') */ - __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_cur_scope->__pyx_v__b64_decoder_storage) + 0, __pyx_cur_scope->__pyx_v__len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_cur_scope->__pyx_v__b64_decoder_storage) + 0, __pyx_cur_scope->__pyx_v__len - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":654 + /* "dawg.pyx":658 * value = _b64_decoder_storage[:_len] * * u_key = raw_key[:i].decode('utf8') # <<<<<<<<<<<<<< * yield (u_key, value) * */ - __pyx_t_1 = __Pyx_decode_c_string(__pyx_cur_scope->__pyx_v_raw_key, 0, __pyx_cur_scope->__pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_cur_scope->__pyx_v_raw_key, 0, __pyx_cur_scope->__pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_u_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_u_key, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":655 + /* "dawg.pyx":659 * * u_key = raw_key[:i].decode('utf8') * yield (u_key, value) # <<<<<<<<<<<<<< * * cpdef list keys(self, unicode prefix=""): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_u_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_u_key); @@ -12668,11 +12673,11 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L10_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 659, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":620 + /* "dawg.pyx":624 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -12697,7 +12702,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_24generator2(__pyx_CoroutineObject *_ return __pyx_r; } -/* "dawg.pyx":657 +/* "dawg.pyx":661 * yield (u_key, value) * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -12743,7 +12748,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_26keys)) { __Pyx_XDECREF(__pyx_r); @@ -12760,10 +12765,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 657, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12782,7 +12787,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG #endif } - /* "dawg.pyx":658 + /* "dawg.pyx":662 * * cpdef list keys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -12791,26 +12796,26 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 658, __pyx_L1_error) + __PYX_ERR(0, 662, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":660 + /* "dawg.pyx":664 * cdef bytes b_prefix = prefix.encode('utf8') * cdef int i * cdef list res = [] # <<<<<<<<<<<<<< * cdef char* raw_key * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":663 + /* "dawg.pyx":667 * cdef char* raw_key * * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -12819,7 +12824,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_index = __pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":664 + /* "dawg.pyx":668 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -12828,13 +12833,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 664, __pyx_L1_error) + __PYX_ERR(0, 668, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_5, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":665 + /* "dawg.pyx":669 * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): * return res # <<<<<<<<<<<<<< @@ -12846,7 +12851,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":664 + /* "dawg.pyx":668 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -12855,7 +12860,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ } - /* "dawg.pyx":668 + /* "dawg.pyx":672 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -12864,7 +12869,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":669 + /* "dawg.pyx":673 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -12873,12 +12878,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 669, __pyx_L1_error) + __PYX_ERR(0, 673, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L1_error) __pyx_v_completer.Start(__pyx_v_index, __pyx_t_7); - /* "dawg.pyx":671 + /* "dawg.pyx":675 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -12889,7 +12894,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG __pyx_t_6 = (__pyx_v_completer.Next() != 0); if (!__pyx_t_6) break; - /* "dawg.pyx":672 + /* "dawg.pyx":676 * * while completer.Next(): * raw_key = completer.key() # <<<<<<<<<<<<<< @@ -12898,7 +12903,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v_raw_key = ((char *)__pyx_v_completer.key()); - /* "dawg.pyx":674 + /* "dawg.pyx":678 * raw_key = completer.key() * * for i in range(0, completer.length()): # <<<<<<<<<<<<<< @@ -12910,7 +12915,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "dawg.pyx":675 + /* "dawg.pyx":679 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12920,7 +12925,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG __pyx_t_6 = (((__pyx_v_raw_key[__pyx_v_i]) == __pyx_v_self->_c_payload_separator) != 0); if (__pyx_t_6) { - /* "dawg.pyx":676 + /* "dawg.pyx":680 * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: * break # <<<<<<<<<<<<<< @@ -12929,7 +12934,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG */ goto __pyx_L7_break; - /* "dawg.pyx":675 + /* "dawg.pyx":679 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -12940,29 +12945,29 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG } __pyx_L7_break:; - /* "dawg.pyx":678 + /* "dawg.pyx":682 * break * * u_key = raw_key[:i].decode('utf8') # <<<<<<<<<<<<<< * res.append(u_key) * return res */ - __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_raw_key, 0, __pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_raw_key, 0, __pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_u_key, __pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":679 + /* "dawg.pyx":683 * * u_key = raw_key[:i].decode('utf8') * res.append(u_key) # <<<<<<<<<<<<<< * return res * */ - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_u_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_u_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 683, __pyx_L1_error) } - /* "dawg.pyx":680 + /* "dawg.pyx":684 * u_key = raw_key[:i].decode('utf8') * res.append(u_key) * return res # <<<<<<<<<<<<<< @@ -12974,7 +12979,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_keys(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":657 + /* "dawg.pyx":661 * yield (u_key, value) * * cpdef list keys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -13029,7 +13034,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_26keys(PyObject *__pyx_v_self, PyObje } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keys") < 0)) __PYX_ERR(0, 657, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keys") < 0)) __PYX_ERR(0, 661, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -13043,13 +13048,13 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_26keys(PyObject *__pyx_v_self, PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("keys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.keys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 657, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_25keys(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -13070,7 +13075,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_25keys(struct __pyx_obj_4dawg_BytesDA __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->__pyx_base.keys(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->__pyx_base.keys(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13088,7 +13093,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_25keys(struct __pyx_obj_4dawg_BytesDA } static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":682 +/* "dawg.pyx":686 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -13126,7 +13131,7 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_28iterkeys(PyObject *__pyx_v_self, Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) __PYX_ERR(0, 682, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) __PYX_ERR(0, 686, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -13140,13 +13145,13 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_28iterkeys(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 682, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 686, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.iterkeys", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 686, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_27iterkeys(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -13167,7 +13172,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_27iterkeys(struct __pyx_obj_4dawg_Byt if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_7_iterkeys *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 682, __pyx_L1_error) + __PYX_ERR(0, 686, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -13178,7 +13183,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_27iterkeys(struct __pyx_obj_4dawg_Byt __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_29generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterkeys, __pyx_n_s_BytesDAWG_iterkeys, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_9BytesDAWG_29generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterkeys, __pyx_n_s_BytesDAWG_iterkeys, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -13215,9 +13220,9 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 686, __pyx_L1_error) - /* "dawg.pyx":683 + /* "dawg.pyx":687 * * def iterkeys(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -13226,15 +13231,15 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 683, __pyx_L1_error) + __PYX_ERR(0, 687, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":687 + /* "dawg.pyx":691 * cdef char* raw_key * * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -13243,7 +13248,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":688 + /* "dawg.pyx":692 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -13252,13 +13257,13 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 688, __pyx_L1_error) + __PYX_ERR(0, 692, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_2, (&__pyx_cur_scope->__pyx_v_index)) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":689 + /* "dawg.pyx":693 * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): * return # <<<<<<<<<<<<<< @@ -13269,7 +13274,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ __pyx_r = NULL; goto __pyx_L0; - /* "dawg.pyx":688 + /* "dawg.pyx":692 * * cdef BaseType index = self.dct.root() * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -13278,7 +13283,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ } - /* "dawg.pyx":692 + /* "dawg.pyx":696 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -13287,7 +13292,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ __pyx_f_4dawg_init_completer(__pyx_cur_scope->__pyx_v_completer, __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_cur_scope->__pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":693 + /* "dawg.pyx":697 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -13296,12 +13301,12 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 693, __pyx_L1_error) + __PYX_ERR(0, 697, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L1_error) __pyx_cur_scope->__pyx_v_completer.Start(__pyx_cur_scope->__pyx_v_index, __pyx_t_4); - /* "dawg.pyx":695 + /* "dawg.pyx":699 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -13312,7 +13317,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ __pyx_t_3 = (__pyx_cur_scope->__pyx_v_completer.Next() != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":696 + /* "dawg.pyx":700 * * while completer.Next(): * raw_key = completer.key() # <<<<<<<<<<<<<< @@ -13321,7 +13326,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ __pyx_cur_scope->__pyx_v_raw_key = ((char *)__pyx_cur_scope->__pyx_v_completer.key()); - /* "dawg.pyx":698 + /* "dawg.pyx":702 * raw_key = completer.key() * * for i in range(0, completer.length()): # <<<<<<<<<<<<<< @@ -13333,7 +13338,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_7; - /* "dawg.pyx":699 + /* "dawg.pyx":703 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -13343,7 +13348,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ __pyx_t_3 = (((__pyx_cur_scope->__pyx_v_raw_key[__pyx_cur_scope->__pyx_v_i]) == __pyx_cur_scope->__pyx_v_self->_c_payload_separator) != 0); if (__pyx_t_3) { - /* "dawg.pyx":700 + /* "dawg.pyx":704 * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: * break # <<<<<<<<<<<<<< @@ -13352,7 +13357,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ */ goto __pyx_L8_break; - /* "dawg.pyx":699 + /* "dawg.pyx":703 * * for i in range(0, completer.length()): * if raw_key[i] == self._c_payload_separator: # <<<<<<<<<<<<<< @@ -13363,21 +13368,21 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ } __pyx_L8_break:; - /* "dawg.pyx":702 + /* "dawg.pyx":706 * break * * u_key = raw_key[:i].decode('utf8') # <<<<<<<<<<<<<< * yield u_key * */ - __pyx_t_1 = __Pyx_decode_c_string(__pyx_cur_scope->__pyx_v_raw_key, 0, __pyx_cur_scope->__pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_cur_scope->__pyx_v_raw_key, 0, __pyx_cur_scope->__pyx_v_i, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_u_key); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_u_key, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":703 + /* "dawg.pyx":707 * * u_key = raw_key[:i].decode('utf8') * yield u_key # <<<<<<<<<<<<<< @@ -13393,11 +13398,11 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L10_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 703, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 707, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":682 + /* "dawg.pyx":686 * return res * * def iterkeys(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -13422,7 +13427,7 @@ static PyObject *__pyx_gb_4dawg_9BytesDAWG_29generator3(__pyx_CoroutineObject *_ return __pyx_r; } -/* "dawg.pyx":705 +/* "dawg.pyx":709 * yield u_key * * cdef bint _has_value(self, BaseType index): # <<<<<<<<<<<<<< @@ -13436,7 +13441,7 @@ static int __pyx_f_4dawg_9BytesDAWG__has_value(struct __pyx_obj_4dawg_BytesDAWG __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_has_value", 0); - /* "dawg.pyx":706 + /* "dawg.pyx":710 * * cdef bint _has_value(self, BaseType index): * cdef BaseType _index = index # <<<<<<<<<<<<<< @@ -13445,7 +13450,7 @@ static int __pyx_f_4dawg_9BytesDAWG__has_value(struct __pyx_obj_4dawg_BytesDAWG */ __pyx_v__index = __pyx_v_index; - /* "dawg.pyx":707 + /* "dawg.pyx":711 * cdef bint _has_value(self, BaseType index): * cdef BaseType _index = index * return self.dct.Follow(self._c_payload_separator, &_index) # <<<<<<<<<<<<<< @@ -13455,7 +13460,7 @@ static int __pyx_f_4dawg_9BytesDAWG__has_value(struct __pyx_obj_4dawg_BytesDAWG __pyx_r = __pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_v_self->_c_payload_separator, (&__pyx_v__index)); goto __pyx_L0; - /* "dawg.pyx":705 + /* "dawg.pyx":709 * yield u_key * * cdef bint _has_value(self, BaseType index): # <<<<<<<<<<<<<< @@ -13469,7 +13474,7 @@ static int __pyx_f_4dawg_9BytesDAWG__has_value(struct __pyx_obj_4dawg_BytesDAWG return __pyx_r; } -/* "dawg.pyx":709 +/* "dawg.pyx":713 * return self.dct.Follow(self._c_payload_separator, &_index) * * cdef list _similar_items(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -13504,7 +13509,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ int __pyx_t_9; __Pyx_RefNannySetupContext("_similar_items", 0); - /* "dawg.pyx":710 + /* "dawg.pyx":714 * * cdef list _similar_items(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): * cdef BaseType next_index, index = cur_index # <<<<<<<<<<<<<< @@ -13513,19 +13518,19 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ __pyx_v_index = __pyx_v_cur_index; - /* "dawg.pyx":713 + /* "dawg.pyx":717 * cdef unicode prefix, u_replace_char, found_key * cdef bytes b_step, b_replace_char * cdef list res = [] # <<<<<<<<<<<<<< * cdef list extra_items, value * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":716 + /* "dawg.pyx":720 * cdef list extra_items, value * * cdef int start_pos = len(current_prefix) # <<<<<<<<<<<<<< @@ -13534,12 +13539,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_current_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 716, __pyx_L1_error) + __PYX_ERR(0, 720, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_current_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_current_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 720, __pyx_L1_error) __pyx_v_start_pos = __pyx_t_2; - /* "dawg.pyx":717 + /* "dawg.pyx":721 * * cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) # <<<<<<<<<<<<<< @@ -13548,12 +13553,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 717, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 721, __pyx_L1_error) __pyx_v_end_pos = __pyx_t_2; - /* "dawg.pyx":718 + /* "dawg.pyx":722 * cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) * cdef int word_pos = start_pos # <<<<<<<<<<<<<< @@ -13562,7 +13567,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ __pyx_v_word_pos = __pyx_v_start_pos; - /* "dawg.pyx":720 + /* "dawg.pyx":724 * cdef int word_pos = start_pos * * while word_pos < end_pos: # <<<<<<<<<<<<<< @@ -13573,17 +13578,17 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __pyx_t_3 = ((__pyx_v_word_pos < __pyx_v_end_pos) != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":721 + /* "dawg.pyx":725 * * while word_pos < end_pos: * b_step = (key[word_pos].encode('utf8')) # <<<<<<<<<<<<<< * * if b_step in replace_chars: */ - __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 721, __pyx_L1_error) - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_5; @@ -13592,7 +13597,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __Pyx_XDECREF_SET(__pyx_v_b_step, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "dawg.pyx":723 + /* "dawg.pyx":727 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -13601,13 +13606,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 723, __pyx_L1_error) + __PYX_ERR(0, 727, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 727, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 != 0); if (__pyx_t_6) { - /* "dawg.pyx":724 + /* "dawg.pyx":728 * * if b_step in replace_chars: * next_index = index # <<<<<<<<<<<<<< @@ -13616,7 +13621,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ __pyx_v_next_index = __pyx_v_index; - /* "dawg.pyx":725 + /* "dawg.pyx":729 * if b_step in replace_chars: * next_index = index * b_replace_char, u_replace_char = replace_chars[b_step] # <<<<<<<<<<<<<< @@ -13625,9 +13630,9 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 725, __pyx_L1_error) + __PYX_ERR(0, 729, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); @@ -13638,7 +13643,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 725, __pyx_L1_error) + __PYX_ERR(0, 729, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); @@ -13646,23 +13651,23 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 729, __pyx_L1_error) } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 725, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 725, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 729, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_b_replace_char, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_u_replace_char, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "dawg.pyx":727 + /* "dawg.pyx":731 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -13671,13 +13676,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_b_replace_char == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 727, __pyx_L1_error) + __PYX_ERR(0, 731, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 731, __pyx_L1_error) __pyx_t_6 = (__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_8, (&__pyx_v_next_index)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":728 + /* "dawg.pyx":732 * * if self.dct.Follow(b_replace_char, &next_index): * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char # <<<<<<<<<<<<<< @@ -13686,41 +13691,41 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 728, __pyx_L1_error) + __PYX_ERR(0, 732, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, __pyx_v_word_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, __pyx_v_word_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_7, __pyx_v_u_replace_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_t_7, __pyx_v_u_replace_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_prefix, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dawg.pyx":729 + /* "dawg.pyx":733 * if self.dct.Follow(b_replace_char, &next_index): * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char * extra_items = self._similar_items(prefix, key, next_index, replace_chars) # <<<<<<<<<<<<<< * res.extend(extra_items) * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_items(__pyx_v_self, __pyx_v_prefix, __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_items(__pyx_v_self, __pyx_v_prefix, __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_extra_items, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dawg.pyx":730 + /* "dawg.pyx":734 * prefix = current_prefix + key[start_pos:word_pos] + u_replace_char * extra_items = self._similar_items(prefix, key, next_index, replace_chars) * res.extend(extra_items) # <<<<<<<<<<<<<< * * if not self.dct.Follow(b_step, &index): */ - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_items); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_items); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 734, __pyx_L1_error) - /* "dawg.pyx":727 + /* "dawg.pyx":731 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -13729,7 +13734,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ } - /* "dawg.pyx":723 + /* "dawg.pyx":727 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -13738,7 +13743,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ } - /* "dawg.pyx":732 + /* "dawg.pyx":736 * res.extend(extra_items) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -13747,13 +13752,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_b_step == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_8, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":733 + /* "dawg.pyx":737 * * if not self.dct.Follow(b_step, &index): * break # <<<<<<<<<<<<<< @@ -13762,7 +13767,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ goto __pyx_L4_break; - /* "dawg.pyx":732 + /* "dawg.pyx":736 * res.extend(extra_items) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -13771,7 +13776,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ } - /* "dawg.pyx":734 + /* "dawg.pyx":738 * if not self.dct.Follow(b_step, &index): * break * word_pos += 1 # <<<<<<<<<<<<<< @@ -13781,7 +13786,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __pyx_v_word_pos = (__pyx_v_word_pos + 1); } - /* "dawg.pyx":737 + /* "dawg.pyx":741 * * else: * if self.dct.Follow(self._c_payload_separator, &index): # <<<<<<<<<<<<<< @@ -13792,7 +13797,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __pyx_t_6 = (__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_v_self->_c_payload_separator, (&__pyx_v_index)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":738 + /* "dawg.pyx":742 * else: * if self.dct.Follow(self._c_payload_separator, &index): * found_key = current_prefix + key[start_pos:] # <<<<<<<<<<<<<< @@ -13801,36 +13806,36 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 738, __pyx_L1_error) + __PYX_ERR(0, 742, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Substring(__pyx_v_key, __pyx_v_start_pos, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_current_prefix, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_found_key = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":739 + /* "dawg.pyx":743 * if self.dct.Follow(self._c_payload_separator, &index): * found_key = current_prefix + key[start_pos:] * value = self._value_for_index(index) # <<<<<<<<<<<<<< * res.insert(0, (found_key, value)) * */ - __pyx_t_7 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_value = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":740 + /* "dawg.pyx":744 * found_key = current_prefix + key[start_pos:] * value = self._value_for_index(index) * res.insert(0, (found_key, value)) # <<<<<<<<<<<<<< * * return res */ - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_found_key); __Pyx_GIVEREF(__pyx_v_found_key); @@ -13838,10 +13843,10 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_value); - __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":737 + /* "dawg.pyx":741 * * else: * if self.dct.Follow(self._c_payload_separator, &index): # <<<<<<<<<<<<<< @@ -13852,7 +13857,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ } __pyx_L4_break:; - /* "dawg.pyx":742 + /* "dawg.pyx":746 * res.insert(0, (found_key, value)) * * return res # <<<<<<<<<<<<<< @@ -13864,7 +13869,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":709 + /* "dawg.pyx":713 * return self.dct.Follow(self._c_payload_separator, &_index) * * cdef list _similar_items(self, unicode current_prefix, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -13893,7 +13898,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_items(struct __pyx_obj_4dawg_ return __pyx_r; } -/* "dawg.pyx":744 +/* "dawg.pyx":748 * return res * * cpdef list similar_items(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -13921,7 +13926,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_31similar_items)) { __Pyx_XDECREF(__pyx_r); @@ -13941,7 +13946,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -13949,13 +13954,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -13966,12 +13971,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B __Pyx_INCREF(__pyx_v_replaces); __Pyx_GIVEREF(__pyx_v_replaces); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_replaces); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 744, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 748, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13990,7 +13995,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B #endif } - /* "dawg.pyx":754 + /* "dawg.pyx":758 * unicode strings. * """ * return self._similar_items("", key, self.dct.root(), replaces) # <<<<<<<<<<<<<< @@ -13998,13 +14003,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_items(struct __pyx_obj_4dawg_B * cdef list _similar_item_values(self, int start_pos, unicode key, BaseType cur_index, dict replace_chars): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_items(__pyx_v_self, __pyx_kp_u__6, __pyx_v_key, __pyx_v_self->__pyx_base.__pyx_base.dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_items(__pyx_v_self, __pyx_kp_u__6, __pyx_v_key, __pyx_v_self->__pyx_base.__pyx_base.dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":744 + /* "dawg.pyx":748 * return res * * cpdef list similar_items(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -14059,11 +14064,11 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_31similar_items(PyObject *__pyx_v_sel case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replaces)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("similar_items", 1, 2, 2, 1); __PYX_ERR(0, 744, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_items", 1, 2, 2, 1); __PYX_ERR(0, 748, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_items") < 0)) __PYX_ERR(0, 744, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_items") < 0)) __PYX_ERR(0, 748, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14076,14 +14081,14 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_31similar_items(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("similar_items", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 744, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_items", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 748, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.similar_items", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 744, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 744, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 748, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 748, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_30similar_items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_key, __pyx_v_replaces); /* function exit code */ @@ -14101,7 +14106,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_30similar_items(struct __pyx_obj_4daw PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("similar_items", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_similar_items(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_similar_items(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14118,7 +14123,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_30similar_items(struct __pyx_obj_4daw return __pyx_r; } -/* "dawg.pyx":756 +/* "dawg.pyx":760 * return self._similar_items("", key, self.dct.root(), replaces) * * cdef list _similar_item_values(self, int start_pos, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -14150,7 +14155,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ int __pyx_t_9; __Pyx_RefNannySetupContext("_similar_item_values", 0); - /* "dawg.pyx":757 + /* "dawg.pyx":761 * * cdef list _similar_item_values(self, int start_pos, unicode key, BaseType cur_index, dict replace_chars): * cdef BaseType next_index, index = cur_index # <<<<<<<<<<<<<< @@ -14159,19 +14164,19 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ __pyx_v_index = __pyx_v_cur_index; - /* "dawg.pyx":760 + /* "dawg.pyx":764 * cdef unicode prefix, u_replace_char, found_key * cdef bytes b_step, b_replace_char * cdef list res = [] # <<<<<<<<<<<<<< * cdef list extra_items, value * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":764 + /* "dawg.pyx":768 * * #cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) # <<<<<<<<<<<<<< @@ -14180,12 +14185,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 764, __pyx_L1_error) + __PYX_ERR(0, 768, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 764, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_key); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 768, __pyx_L1_error) __pyx_v_end_pos = __pyx_t_2; - /* "dawg.pyx":765 + /* "dawg.pyx":769 * #cdef int start_pos = len(current_prefix) * cdef int end_pos = len(key) * cdef int word_pos = start_pos # <<<<<<<<<<<<<< @@ -14194,7 +14199,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ __pyx_v_word_pos = __pyx_v_start_pos; - /* "dawg.pyx":767 + /* "dawg.pyx":771 * cdef int word_pos = start_pos * * while word_pos < end_pos: # <<<<<<<<<<<<<< @@ -14205,17 +14210,17 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __pyx_t_3 = ((__pyx_v_word_pos < __pyx_v_end_pos) != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":768 + /* "dawg.pyx":772 * * while word_pos < end_pos: * b_step = (key[word_pos].encode('utf8')) # <<<<<<<<<<<<<< * * if b_step in replace_chars: */ - __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 768, __pyx_L1_error) - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Unicode(__pyx_v_key, __pyx_v_word_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_4 == (Py_UCS4)-1)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error) + __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_5; @@ -14224,7 +14229,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __Pyx_XDECREF_SET(__pyx_v_b_step, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "dawg.pyx":770 + /* "dawg.pyx":774 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -14233,13 +14238,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 770, __pyx_L1_error) + __PYX_ERR(0, 774, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_b_step, __pyx_v_replace_chars, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 774, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 != 0); if (__pyx_t_6) { - /* "dawg.pyx":771 + /* "dawg.pyx":775 * * if b_step in replace_chars: * next_index = index # <<<<<<<<<<<<<< @@ -14248,7 +14253,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ __pyx_v_next_index = __pyx_v_index; - /* "dawg.pyx":772 + /* "dawg.pyx":776 * if b_step in replace_chars: * next_index = index * b_replace_char, u_replace_char = replace_chars[b_step] # <<<<<<<<<<<<<< @@ -14257,9 +14262,9 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ if (unlikely(__pyx_v_replace_chars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 772, __pyx_L1_error) + __PYX_ERR(0, 776, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_replace_chars, __pyx_v_b_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); @@ -14270,7 +14275,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 772, __pyx_L1_error) + __PYX_ERR(0, 776, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); @@ -14278,23 +14283,23 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 776, __pyx_L1_error) } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 772, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 772, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 776, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_b_replace_char, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_u_replace_char, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "dawg.pyx":774 + /* "dawg.pyx":778 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -14303,34 +14308,34 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ if (unlikely(__pyx_v_b_replace_char == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 774, __pyx_L1_error) + __PYX_ERR(0, 778, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_replace_char); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error) __pyx_t_6 = (__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_8, (&__pyx_v_next_index)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":775 + /* "dawg.pyx":779 * * if self.dct.Follow(b_replace_char, &next_index): * extra_items = self._similar_item_values(word_pos+1, key, next_index, replace_chars) # <<<<<<<<<<<<<< * res.extend(extra_items) * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_item_values(__pyx_v_self, (__pyx_v_word_pos + 1), __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_item_values(__pyx_v_self, (__pyx_v_word_pos + 1), __pyx_v_key, __pyx_v_next_index, __pyx_v_replace_chars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_extra_items, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dawg.pyx":776 + /* "dawg.pyx":780 * if self.dct.Follow(b_replace_char, &next_index): * extra_items = self._similar_item_values(word_pos+1, key, next_index, replace_chars) * res.extend(extra_items) # <<<<<<<<<<<<<< * * if not self.dct.Follow(b_step, &index): */ - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_items); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_v_extra_items); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 780, __pyx_L1_error) - /* "dawg.pyx":774 + /* "dawg.pyx":778 * b_replace_char, u_replace_char = replace_chars[b_step] * * if self.dct.Follow(b_replace_char, &next_index): # <<<<<<<<<<<<<< @@ -14339,7 +14344,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ } - /* "dawg.pyx":770 + /* "dawg.pyx":774 * b_step = (key[word_pos].encode('utf8')) * * if b_step in replace_chars: # <<<<<<<<<<<<<< @@ -14348,7 +14353,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ } - /* "dawg.pyx":778 + /* "dawg.pyx":782 * res.extend(extra_items) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -14357,13 +14362,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ if (unlikely(__pyx_v_b_step == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 778, __pyx_L1_error) + __PYX_ERR(0, 782, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_step); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_8, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":779 + /* "dawg.pyx":783 * * if not self.dct.Follow(b_step, &index): * break # <<<<<<<<<<<<<< @@ -14372,7 +14377,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ goto __pyx_L4_break; - /* "dawg.pyx":778 + /* "dawg.pyx":782 * res.extend(extra_items) * * if not self.dct.Follow(b_step, &index): # <<<<<<<<<<<<<< @@ -14381,7 +14386,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ */ } - /* "dawg.pyx":780 + /* "dawg.pyx":784 * if not self.dct.Follow(b_step, &index): * break * word_pos += 1 # <<<<<<<<<<<<<< @@ -14391,7 +14396,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __pyx_v_word_pos = (__pyx_v_word_pos + 1); } - /* "dawg.pyx":783 + /* "dawg.pyx":787 * * else: * if self.dct.Follow(self._c_payload_separator, &index): # <<<<<<<<<<<<<< @@ -14402,28 +14407,28 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __pyx_t_6 = (__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_v_self->_c_payload_separator, (&__pyx_v_index)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":784 + /* "dawg.pyx":788 * else: * if self.dct.Follow(self._c_payload_separator, &index): * value = self._value_for_index(index) # <<<<<<<<<<<<<< * res.insert(0, value) * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_value_for_index(__pyx_v_self, __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_value = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "dawg.pyx":785 + /* "dawg.pyx":789 * if self.dct.Follow(self._c_payload_separator, &index): * value = self._value_for_index(index) * res.insert(0, value) # <<<<<<<<<<<<<< * * return res */ - __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_v_value); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_9 = PyList_Insert(__pyx_v_res, 0, __pyx_v_value); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 789, __pyx_L1_error) - /* "dawg.pyx":783 + /* "dawg.pyx":787 * * else: * if self.dct.Follow(self._c_payload_separator, &index): # <<<<<<<<<<<<<< @@ -14434,7 +14439,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ } __pyx_L4_break:; - /* "dawg.pyx":787 + /* "dawg.pyx":791 * res.insert(0, value) * * return res # <<<<<<<<<<<<<< @@ -14446,7 +14451,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":756 + /* "dawg.pyx":760 * return self._similar_items("", key, self.dct.root(), replaces) * * cdef list _similar_item_values(self, int start_pos, unicode key, BaseType cur_index, dict replace_chars): # <<<<<<<<<<<<<< @@ -14473,7 +14478,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG__similar_item_values(struct __pyx_obj_ return __pyx_r; } -/* "dawg.pyx":789 +/* "dawg.pyx":793 * return res * * cpdef list similar_item_values(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -14501,7 +14506,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_item_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_similar_item_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_9BytesDAWG_33similar_item_values)) { __Pyx_XDECREF(__pyx_r); @@ -14521,7 +14526,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -14529,13 +14534,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_replaces}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -14546,12 +14551,12 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 __Pyx_INCREF(__pyx_v_replaces); __Pyx_GIVEREF(__pyx_v_replaces); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_replaces); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 789, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 793, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14570,7 +14575,7 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 #endif } - /* "dawg.pyx":799 + /* "dawg.pyx":803 * unicode strings. * """ * return self._similar_item_values(0, key, self.dct.root(), replaces) # <<<<<<<<<<<<<< @@ -14578,13 +14583,13 @@ static PyObject *__pyx_f_4dawg_9BytesDAWG_similar_item_values(struct __pyx_obj_4 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_item_values(__pyx_v_self, 0, __pyx_v_key, __pyx_v_self->__pyx_base.__pyx_base.dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_BytesDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_similar_item_values(__pyx_v_self, 0, __pyx_v_key, __pyx_v_self->__pyx_base.__pyx_base.dct.root(), __pyx_v_replaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":789 + /* "dawg.pyx":793 * return res * * cpdef list similar_item_values(self, unicode key, dict replaces): # <<<<<<<<<<<<<< @@ -14639,11 +14644,11 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_33similar_item_values(PyObject *__pyx case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_replaces)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("similar_item_values", 1, 2, 2, 1); __PYX_ERR(0, 789, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_item_values", 1, 2, 2, 1); __PYX_ERR(0, 793, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_item_values") < 0)) __PYX_ERR(0, 789, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "similar_item_values") < 0)) __PYX_ERR(0, 793, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -14656,14 +14661,14 @@ static PyObject *__pyx_pw_4dawg_9BytesDAWG_33similar_item_values(PyObject *__pyx } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("similar_item_values", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 789, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("similar_item_values", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 793, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.BytesDAWG.similar_item_values", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 789, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 789, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 793, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_replaces), (&PyDict_Type), 1, "replaces", 1))) __PYX_ERR(0, 793, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_9BytesDAWG_32similar_item_values(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_key, __pyx_v_replaces); /* function exit code */ @@ -14681,7 +14686,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_32similar_item_values(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("similar_item_values", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_similar_item_values(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG_similar_item_values(__pyx_v_self, __pyx_v_key, __pyx_v_replaces, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14698,7 +14703,7 @@ static PyObject *__pyx_pf_4dawg_9BytesDAWG_32similar_item_values(struct __pyx_ob return __pyx_r; } -/* "dawg.pyx":820 +/* "dawg.pyx":824 * cdef _struct * * def __init__(self, fmt, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -14766,7 +14771,7 @@ static int __pyx_pw_4dawg_10RecordDAWG_1__init__(PyObject *__pyx_v_self, PyObjec } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 820, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 824, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14788,13 +14793,13 @@ static int __pyx_pw_4dawg_10RecordDAWG_1__init__(PyObject *__pyx_v_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 824, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.RecordDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload_separator), (&PyBytes_Type), 1, "payload_separator", 1))) __PYX_ERR(0, 820, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload_separator), (&PyBytes_Type), 1, "payload_separator", 1))) __PYX_ERR(0, 824, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_10RecordDAWG___init__(((struct __pyx_obj_4dawg_RecordDAWG *)__pyx_v_self), __pyx_v_fmt, __pyx_v_arg, __pyx_v_input_is_sorted, __pyx_v_payload_separator); /* function exit code */ @@ -14807,7 +14812,7 @@ static int __pyx_pw_4dawg_10RecordDAWG_1__init__(PyObject *__pyx_v_self, PyObjec } static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":835 +/* "dawg.pyx":839 * arg = [] * * keys = ((d[0], self._struct.pack(*d[1])) for d in arg) # <<<<<<<<<<<<<< @@ -14824,7 +14829,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_8__init___genexpr(PyObject *__pyx_s if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 835, __pyx_L1_error) + __PYX_ERR(0, 839, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -14832,7 +14837,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_8__init___genexpr(PyObject *__pyx_s __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_10RecordDAWG_8__init___2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_10RecordDAWG_8__init___2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_init___locals_genexpr, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14869,32 +14874,32 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 835, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 835, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 839, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 839, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -14904,7 +14909,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_Corouti PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 835, __pyx_L1_error) + else __PYX_ERR(0, 839, __pyx_L1_error) } break; } @@ -14914,21 +14919,21 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_Corouti __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 835, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 839, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); @@ -14954,7 +14959,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_Corouti __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 835, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 839, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -14980,7 +14985,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_8__init___2generator8(__pyx_Corouti return __pyx_r; } -/* "dawg.pyx":820 +/* "dawg.pyx":824 * cdef _struct * * def __init__(self, fmt, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -15005,7 +15010,7 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_8___init__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 820, __pyx_L1_error) + __PYX_ERR(0, 824, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -15016,19 +15021,19 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arg); - /* "dawg.pyx":830 + /* "dawg.pyx":834 * format string specification. * """ * self._struct = struct.Struct(str(fmt)) # <<<<<<<<<<<<<< * * if arg is None: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Struct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_fmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_fmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -15043,7 +15048,7 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); @@ -15052,7 +15057,7 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __pyx_cur_scope->__pyx_v_self->_struct = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":832 + /* "dawg.pyx":836 * self._struct = struct.Struct(str(fmt)) * * if arg is None: # <<<<<<<<<<<<<< @@ -15063,21 +15068,21 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "dawg.pyx":833 + /* "dawg.pyx":837 * * if arg is None: * arg = [] # <<<<<<<<<<<<<< * * keys = ((d[0], self._struct.pack(*d[1])) for d in arg) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_arg, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":832 + /* "dawg.pyx":836 * self._struct = struct.Struct(str(fmt)) * * if arg is None: # <<<<<<<<<<<<<< @@ -15086,26 +15091,26 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW */ } - /* "dawg.pyx":835 + /* "dawg.pyx":839 * arg = [] * * keys = ((d[0], self._struct.pack(*d[1])) for d in arg) # <<<<<<<<<<<<<< * super(RecordDAWG, self).__init__(keys, input_is_sorted, payload_separator) * */ - __pyx_t_1 = __pyx_pf_4dawg_10RecordDAWG_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_4dawg_10RecordDAWG_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keys = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":836 + /* "dawg.pyx":840 * * keys = ((d[0], self._struct.pack(*d[1])) for d in arg) * super(RecordDAWG, self).__init__(keys, input_is_sorted, payload_separator) # <<<<<<<<<<<<<< * * cdef list _value_for_index(self, BaseType index): */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_RecordDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_RecordDAWG)); @@ -15113,10 +15118,10 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_self)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -15134,7 +15139,7 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_keys, __pyx_v_input_is_sorted, __pyx_v_payload_separator}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -15142,13 +15147,13 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_keys, __pyx_v_input_is_sorted, __pyx_v_payload_separator}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -15162,14 +15167,14 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW __Pyx_INCREF(__pyx_v_payload_separator); __Pyx_GIVEREF(__pyx_v_payload_separator); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_payload_separator); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":820 + /* "dawg.pyx":824 * cdef _struct * * def __init__(self, fmt, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -15194,7 +15199,7 @@ static int __pyx_pf_4dawg_10RecordDAWG___init__(struct __pyx_obj_4dawg_RecordDAW return __pyx_r; } -/* "dawg.pyx":838 +/* "dawg.pyx":842 * super(RecordDAWG, self).__init__(keys, input_is_sorted, payload_separator) * * cdef list _value_for_index(self, BaseType index): # <<<<<<<<<<<<<< @@ -15215,19 +15220,19 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG__value_for_index(struct __pyx_obj_4d PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_value_for_index", 0); - /* "dawg.pyx":839 + /* "dawg.pyx":843 * * cdef list _value_for_index(self, BaseType index): * cdef list value = BytesDAWG._value_for_index(self, index) # <<<<<<<<<<<<<< * return [self._struct.unpack(val) for val in value] * */ - __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG__value_for_index(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4dawg_9BytesDAWG__value_for_index(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_value = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":840 + /* "dawg.pyx":844 * cdef list _value_for_index(self, BaseType index): * cdef list value = BytesDAWG._value_for_index(self, index) * return [self._struct.unpack(val) for val in value] # <<<<<<<<<<<<<< @@ -15235,24 +15240,24 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG__value_for_index(struct __pyx_obj_4d * cpdef list items(self, unicode prefix=""): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 840, __pyx_L1_error) + __PYX_ERR(0, 844, __pyx_L1_error) } __pyx_t_2 = __pyx_v_value; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 844, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -15266,10 +15271,10 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG__value_for_index(struct __pyx_obj_4d } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_val); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 840, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15277,7 +15282,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG__value_for_index(struct __pyx_obj_4d __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":838 + /* "dawg.pyx":842 * super(RecordDAWG, self).__init__(keys, input_is_sorted, payload_separator) * * cdef list _value_for_index(self, BaseType index): # <<<<<<<<<<<<<< @@ -15302,7 +15307,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG__value_for_index(struct __pyx_obj_4d return __pyx_r; } -/* "dawg.pyx":842 +/* "dawg.pyx":846 * return [self._struct.unpack(val) for val in value] * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -15342,7 +15347,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_10RecordDAWG_3items)) { __Pyx_XDECREF(__pyx_r); @@ -15359,10 +15364,10 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 842, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 846, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15381,7 +15386,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD #endif } - /* "dawg.pyx":843 + /* "dawg.pyx":847 * * cpdef list items(self, unicode prefix=""): * cdef list items = BytesDAWG.items(self, prefix) # <<<<<<<<<<<<<< @@ -15390,12 +15395,12 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD */ __pyx_t_5.__pyx_n = 1; __pyx_t_5.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), 1, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_BytesDAWG->items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), 1, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_items = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":844 + /* "dawg.pyx":848 * cpdef list items(self, unicode prefix=""): * cdef list items = BytesDAWG.items(self, prefix) * return [(key, self._struct.unpack(val)) for (key, val) in items] # <<<<<<<<<<<<<< @@ -15403,19 +15408,19 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD * def iteritems(self, unicode prefix=""): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_items == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 844, __pyx_L1_error) + __PYX_ERR(0, 848, __pyx_L1_error) } __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 848, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -15424,7 +15429,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 844, __pyx_L1_error) + __PYX_ERR(0, 848, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15437,15 +15442,15 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -15453,7 +15458,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 848, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -15461,14 +15466,14 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 844, __pyx_L1_error) + __PYX_ERR(0, 848, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -15482,10 +15487,10 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_val); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); @@ -15493,7 +15498,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 844, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15501,7 +15506,7 @@ static PyObject *__pyx_f_4dawg_10RecordDAWG_items(struct __pyx_obj_4dawg_RecordD __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":842 + /* "dawg.pyx":846 * return [self._struct.unpack(val) for val in value] * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -15558,7 +15563,7 @@ static PyObject *__pyx_pw_4dawg_10RecordDAWG_3items(PyObject *__pyx_v_self, PyOb } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 842, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -15572,13 +15577,13 @@ static PyObject *__pyx_pw_4dawg_10RecordDAWG_3items(PyObject *__pyx_v_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 842, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.RecordDAWG.items", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 846, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_10RecordDAWG_2items(((struct __pyx_obj_4dawg_RecordDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -15599,7 +15604,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_2items(struct __pyx_obj_4dawg_Recor __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_RecordDAWG->__pyx_base.items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_RecordDAWG->__pyx_base.items(((struct __pyx_obj_4dawg_BytesDAWG *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15617,7 +15622,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_2items(struct __pyx_obj_4dawg_Recor } static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":846 +/* "dawg.pyx":850 * return [(key, self._struct.unpack(val)) for (key, val) in items] * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -15655,7 +15660,7 @@ static PyObject *__pyx_pw_4dawg_10RecordDAWG_5iteritems(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 850, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -15669,13 +15674,13 @@ static PyObject *__pyx_pw_4dawg_10RecordDAWG_5iteritems(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 850, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.RecordDAWG.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 846, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 850, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_10RecordDAWG_4iteritems(((struct __pyx_obj_4dawg_RecordDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -15696,7 +15701,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_4iteritems(struct __pyx_obj_4dawg_R if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_10_iteritems *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 846, __pyx_L1_error) + __PYX_ERR(0, 850, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -15707,7 +15712,7 @@ static PyObject *__pyx_pf_4dawg_10RecordDAWG_4iteritems(struct __pyx_obj_4dawg_R __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_10RecordDAWG_6generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_RecordDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_10RecordDAWG_6generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_RecordDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -15746,16 +15751,16 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 846, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 850, __pyx_L1_error) - /* "dawg.pyx":847 + /* "dawg.pyx":851 * * def iteritems(self, unicode prefix=""): * for key, val in BytesDAWG.iteritems(self, prefix): # <<<<<<<<<<<<<< * yield (key, self._struct.unpack(val)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4dawg_BytesDAWG), __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4dawg_BytesDAWG), __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -15772,7 +15777,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_prefix}; - __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, 847, __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, 851, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -15780,13 +15785,13 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_prefix}; - __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, 847, __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, 851, __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, 847, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __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; @@ -15797,7 +15802,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_prefix); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -15806,9 +15811,9 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 851, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15816,17 +15821,17 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 851, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -15836,7 +15841,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 847, __pyx_L1_error) + else __PYX_ERR(0, 851, __pyx_L1_error) } break; } @@ -15848,7 +15853,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 847, __pyx_L1_error) + __PYX_ERR(0, 851, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -15861,15 +15866,15 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -15877,7 +15882,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 847, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 851, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; @@ -15885,7 +15890,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 847, __pyx_L1_error) + __PYX_ERR(0, 851, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); @@ -15897,14 +15902,14 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":848 + /* "dawg.pyx":852 * def iteritems(self, unicode prefix=""): * for key, val in BytesDAWG.iteritems(self, prefix): * yield (key, self._struct.unpack(val)) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -15918,10 +15923,10 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_cur_scope->__pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_val); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); @@ -15947,9 +15952,9 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_XGOTREF(__pyx_t_2); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 848, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 852, __pyx_L1_error) - /* "dawg.pyx":847 + /* "dawg.pyx":851 * * def iteritems(self, unicode prefix=""): * for key, val in BytesDAWG.iteritems(self, prefix): # <<<<<<<<<<<<<< @@ -15960,7 +15965,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":846 + /* "dawg.pyx":850 * return [(key, self._struct.unpack(val)) for (key, val) in items] * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -15989,7 +15994,7 @@ static PyObject *__pyx_gb_4dawg_10RecordDAWG_6generator4(__pyx_CoroutineObject * return __pyx_r; } -/* "dawg.pyx":851 +/* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< @@ -16013,9 +16018,9 @@ static PyObject *__pyx_pw_4dawg_1_iterable_from_argument(PyObject *__pyx_self, P } static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":856 +/* "dawg.pyx":860 * - * if isinstance(arg, collections.Mapping): + * if isinstance(arg, Mapping): * return ((key, arg[key]) for key in arg) # <<<<<<<<<<<<<< * else: * return arg @@ -16030,7 +16035,7 @@ static PyObject *__pyx_pf_4dawg_23_iterable_from_argument_genexpr(PyObject *__py if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_12_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 856, __pyx_L1_error) + __PYX_ERR(0, 860, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -16038,7 +16043,7 @@ static PyObject *__pyx_pf_4dawg_23_iterable_from_argument_genexpr(PyObject *__py __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_23_iterable_from_argument_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_iterable_from_argument_locals_g, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_23_iterable_from_argument_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_iterable_from_argument_locals_g, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16073,32 +16078,32 @@ static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_Coro return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 856, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 856, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 860, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 860, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -16108,7 +16113,7 @@ static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_Coro PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 856, __pyx_L1_error) + else __PYX_ERR(0, 860, __pyx_L1_error) } break; } @@ -16118,10 +16123,10 @@ static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_Coro __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_key, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 856, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg)) { __Pyx_RaiseClosureNameError("arg"); __PYX_ERR(0, 860, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_arg, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); @@ -16147,7 +16152,7 @@ static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_Coro __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 860, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -16171,7 +16176,7 @@ static PyObject *__pyx_gb_4dawg_23_iterable_from_argument_2generator9(__pyx_Coro return __pyx_r; } -/* "dawg.pyx":851 +/* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< @@ -16187,13 +16192,12 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_iterable_from_argument", 0); __pyx_cur_scope = (struct __pyx_obj_4dawg___pyx_scope_struct_11__iterable_from_argument *)__pyx_tp_new_4dawg___pyx_scope_struct_11__iterable_from_argument(__pyx_ptype_4dawg___pyx_scope_struct_11__iterable_from_argument, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_11__iterable_from_argument *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 851, __pyx_L1_error) + __PYX_ERR(0, 855, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -16201,7 +16205,7 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arg); - /* "dawg.pyx":852 + /* "dawg.pyx":856 * * def _iterable_from_argument(arg): * if arg is None: # <<<<<<<<<<<<<< @@ -16212,21 +16216,21 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dawg.pyx":853 + /* "dawg.pyx":857 * def _iterable_from_argument(arg): * if arg is None: * arg = [] # <<<<<<<<<<<<<< * - * if isinstance(arg, collections.Mapping): + * if isinstance(arg, Mapping): */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_arg); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_arg, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dawg.pyx":852 + /* "dawg.pyx":856 * * def _iterable_from_argument(arg): * if arg is None: # <<<<<<<<<<<<<< @@ -16235,50 +16239,47 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * */ } - /* "dawg.pyx":855 + /* "dawg.pyx":859 * arg = [] * - * if isinstance(arg, collections.Mapping): # <<<<<<<<<<<<<< + * if isinstance(arg, Mapping): # <<<<<<<<<<<<<< * return ((key, arg[key]) for key in arg) * else: */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_arg; __Pyx_INCREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = PyObject_IsInstance(__pyx_t_3, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "dawg.pyx":856 + /* "dawg.pyx":860 * - * if isinstance(arg, collections.Mapping): + * if isinstance(arg, Mapping): * return ((key, arg[key]) for key in arg) # <<<<<<<<<<<<<< * else: * return arg */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __pyx_pf_4dawg_23_iterable_from_argument_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_4 = __pyx_pf_4dawg_23_iterable_from_argument_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "dawg.pyx":855 + /* "dawg.pyx":859 * arg = [] * - * if isinstance(arg, collections.Mapping): # <<<<<<<<<<<<<< + * if isinstance(arg, Mapping): # <<<<<<<<<<<<<< * return ((key, arg[key]) for key in arg) * else: */ } - /* "dawg.pyx":858 + /* "dawg.pyx":862 * return ((key, arg[key]) for key in arg) * else: * return arg # <<<<<<<<<<<<<< @@ -16292,7 +16293,7 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * goto __pyx_L0; } - /* "dawg.pyx":851 + /* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< @@ -16304,7 +16305,6 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("dawg._iterable_from_argument", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -16314,7 +16314,7 @@ static PyObject *__pyx_pf_4dawg__iterable_from_argument(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "dawg.pyx":867 +/* "dawg.pyx":871 * It can store integer values for unicode keys. * """ * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -16365,7 +16365,7 @@ static int __pyx_pw_4dawg_7IntDAWG_1__init__(PyObject *__pyx_v_self, PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 867, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 871, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16382,7 +16382,7 @@ static int __pyx_pw_4dawg_7IntDAWG_1__init__(PyObject *__pyx_v_self, PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 867, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 871, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16406,14 +16406,14 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dawg.pyx":872 + /* "dawg.pyx":876 * or a dict {unicode_key: int_value}. * """ * iterable = _iterable_from_argument(arg) # <<<<<<<<<<<<<< * super(IntDAWG, self).__init__(iterable, input_is_sorted) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iterable_from_argument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iterable_from_argument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -16427,20 +16427,20 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_arg) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arg); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_iterable = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":873 + /* "dawg.pyx":877 * """ * iterable = _iterable_from_argument(arg) * super(IntDAWG, self).__init__(iterable, input_is_sorted) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_IntDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_IntDAWG)); @@ -16448,10 +16448,10 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -16469,7 +16469,7 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_iterable, __pyx_v_input_is_sorted}; - __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, 873, __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, 877, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -16477,13 +16477,13 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_iterable, __pyx_v_input_is_sorted}; - __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, 873, __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, 877, __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, 873, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __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; @@ -16494,14 +16494,14 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py __Pyx_INCREF(__pyx_v_input_is_sorted); __Pyx_GIVEREF(__pyx_v_input_is_sorted); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_input_is_sorted); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":867 + /* "dawg.pyx":871 * It can store integer values for unicode keys. * """ * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -16525,7 +16525,7 @@ static int __pyx_pf_4dawg_7IntDAWG___init__(struct __pyx_obj_4dawg_IntDAWG *__py return __pyx_r; } -/* "dawg.pyx":875 +/* "dawg.pyx":879 * super(IntDAWG, self).__init__(iterable, input_is_sorted) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -16556,7 +16556,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int int __pyx_t_4; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "dawg.pyx":876 + /* "dawg.pyx":880 * * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) # <<<<<<<<<<<<<< @@ -16565,13 +16565,13 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_int_neg_1; - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_IntDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_IntDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_res = __pyx_t_3; - /* "dawg.pyx":877 + /* "dawg.pyx":881 * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -16581,20 +16581,20 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int __pyx_t_4 = ((__pyx_v_res == -1L) != 0); if (unlikely(__pyx_t_4)) { - /* "dawg.pyx":878 + /* "dawg.pyx":882 * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: * raise KeyError(key) # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 878, __pyx_L1_error) + __PYX_ERR(0, 882, __pyx_L1_error) - /* "dawg.pyx":877 + /* "dawg.pyx":881 * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -16603,7 +16603,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int */ } - /* "dawg.pyx":879 + /* "dawg.pyx":883 * if res == LOOKUP_ERROR: * raise KeyError(key) * return res # <<<<<<<<<<<<<< @@ -16611,13 +16611,13 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int * cpdef get(self, key, default=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":875 + /* "dawg.pyx":879 * super(IntDAWG, self).__init__(iterable, input_is_sorted) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -16636,7 +16636,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_2__getitem__(struct __pyx_obj_4dawg_Int return __pyx_r; } -/* "dawg.pyx":881 +/* "dawg.pyx":885 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -16673,7 +16673,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_7IntDAWG_5get)) { __Pyx_XDECREF(__pyx_r); @@ -16693,7 +16693,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -16701,13 +16701,13 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -16718,7 +16718,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_default); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -16741,7 +16741,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py #endif } - /* "dawg.pyx":887 + /* "dawg.pyx":891 * cdef int res * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -16752,7 +16752,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { - /* "dawg.pyx":888 + /* "dawg.pyx":892 * * if isinstance(key, unicode): * res = self.get_value(key) # <<<<<<<<<<<<<< @@ -16761,7 +16761,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py */ __pyx_v_res = ((struct __pyx_vtabstruct_4dawg_IntDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); - /* "dawg.pyx":887 + /* "dawg.pyx":891 * cdef int res * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -16771,7 +16771,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py goto __pyx_L3; } - /* "dawg.pyx":890 + /* "dawg.pyx":894 * res = self.get_value(key) * else: * res = self.b_get_value(key) # <<<<<<<<<<<<<< @@ -16779,12 +16779,12 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py * if res == LOOKUP_ERROR: */ /*else*/ { - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 890, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 894, __pyx_L1_error) __pyx_v_res = ((struct __pyx_vtabstruct_4dawg_IntDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); } __pyx_L3:; - /* "dawg.pyx":892 + /* "dawg.pyx":896 * res = self.b_get_value(key) * * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -16794,7 +16794,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py __pyx_t_8 = ((__pyx_v_res == -1L) != 0); if (__pyx_t_8) { - /* "dawg.pyx":893 + /* "dawg.pyx":897 * * if res == LOOKUP_ERROR: * return default # <<<<<<<<<<<<<< @@ -16806,7 +16806,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py __pyx_r = __pyx_v_default; goto __pyx_L0; - /* "dawg.pyx":892 + /* "dawg.pyx":896 * res = self.b_get_value(key) * * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -16815,7 +16815,7 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py */ } - /* "dawg.pyx":894 + /* "dawg.pyx":898 * if res == LOOKUP_ERROR: * return default * return res # <<<<<<<<<<<<<< @@ -16823,13 +16823,13 @@ static PyObject *__pyx_f_4dawg_7IntDAWG_get(struct __pyx_obj_4dawg_IntDAWG *__py * cpdef int get_value(self, unicode key): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":881 + /* "dawg.pyx":885 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -16889,7 +16889,7 @@ static PyObject *__pyx_pw_4dawg_7IntDAWG_5get(PyObject *__pyx_v_self, PyObject * } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 881, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 885, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16905,7 +16905,7 @@ static PyObject *__pyx_pw_4dawg_7IntDAWG_5get(PyObject *__pyx_v_self, PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 881, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 885, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntDAWG.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -16927,7 +16927,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_4get(struct __pyx_obj_4dawg_IntDAWG *__ __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; - __pyx_t_1 = __pyx_vtabptr_4dawg_IntDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_IntDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16944,7 +16944,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_4get(struct __pyx_obj_4dawg_IntDAWG *__ return __pyx_r; } -/* "dawg.pyx":896 +/* "dawg.pyx":900 * return res * * cpdef int get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -16973,7 +16973,7 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_7IntDAWG_7get_value)) { __Pyx_INCREF(__pyx_t_1); @@ -16989,10 +16989,10 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17011,7 +17011,7 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py #endif } - /* "dawg.pyx":897 + /* "dawg.pyx":901 * * cpdef int get_value(self, unicode key): * cdef bytes b_key = key.encode('utf8') # <<<<<<<<<<<<<< @@ -17020,9 +17020,9 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 897, __pyx_L1_error) + __PYX_ERR(0, 901, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -17030,7 +17030,7 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py __pyx_v_b_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":898 + /* "dawg.pyx":902 * cpdef int get_value(self, unicode key): * cdef bytes b_key = key.encode('utf8') * return self.dct.Find(b_key) # <<<<<<<<<<<<<< @@ -17039,13 +17039,13 @@ static int __pyx_f_4dawg_7IntDAWG_get_value(struct __pyx_obj_4dawg_IntDAWG *__py */ if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 898, __pyx_L1_error) + __PYX_ERR(0, 902, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L1_error) __pyx_r = __pyx_v_self->__pyx_base.dct.Find(__pyx_t_6); goto __pyx_L0; - /* "dawg.pyx":896 + /* "dawg.pyx":900 * return res * * cpdef int get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -17074,7 +17074,7 @@ static PyObject *__pyx_pw_4dawg_7IntDAWG_7get_value(PyObject *__pyx_v_self, PyOb PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 896, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 900, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_7IntDAWG_6get_value(((struct __pyx_obj_4dawg_IntDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -17092,7 +17092,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_6get_value(struct __pyx_obj_4dawg_IntDA PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_7IntDAWG_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_7IntDAWG_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17109,7 +17109,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_6get_value(struct __pyx_obj_4dawg_IntDA return __pyx_r; } -/* "dawg.pyx":900 +/* "dawg.pyx":904 * return self.dct.Find(b_key) * * cpdef int b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -17137,7 +17137,7 @@ static int __pyx_f_4dawg_7IntDAWG_b_get_value(struct __pyx_obj_4dawg_IntDAWG *__ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_7IntDAWG_9b_get_value)) { __Pyx_INCREF(__pyx_t_1); @@ -17153,10 +17153,10 @@ static int __pyx_f_4dawg_7IntDAWG_b_get_value(struct __pyx_obj_4dawg_IntDAWG *__ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17175,7 +17175,7 @@ static int __pyx_f_4dawg_7IntDAWG_b_get_value(struct __pyx_obj_4dawg_IntDAWG *__ #endif } - /* "dawg.pyx":901 + /* "dawg.pyx":905 * * cpdef int b_get_value(self, bytes key): * return self.dct.Find(key) # <<<<<<<<<<<<<< @@ -17184,13 +17184,13 @@ static int __pyx_f_4dawg_7IntDAWG_b_get_value(struct __pyx_obj_4dawg_IntDAWG *__ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 901, __pyx_L1_error) + __PYX_ERR(0, 905, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 905, __pyx_L1_error) __pyx_r = __pyx_v_self->__pyx_base.dct.Find(__pyx_t_6); goto __pyx_L0; - /* "dawg.pyx":900 + /* "dawg.pyx":904 * return self.dct.Find(b_key) * * cpdef int b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -17218,7 +17218,7 @@ static PyObject *__pyx_pw_4dawg_7IntDAWG_9b_get_value(PyObject *__pyx_v_self, Py PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 900, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_7IntDAWG_8b_get_value(((struct __pyx_obj_4dawg_IntDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -17236,7 +17236,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_8b_get_value(struct __pyx_obj_4dawg_Int PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("b_get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_7IntDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_7IntDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17253,7 +17253,7 @@ static PyObject *__pyx_pf_4dawg_7IntDAWG_8b_get_value(struct __pyx_obj_4dawg_Int return __pyx_r; } -/* "dawg.pyx":911 +/* "dawg.pyx":915 * """ * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -17304,7 +17304,7 @@ static int __pyx_pw_4dawg_17IntCompletionDAWG_1__init__(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 911, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 915, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -17321,7 +17321,7 @@ static int __pyx_pw_4dawg_17IntCompletionDAWG_1__init__(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 915, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntCompletionDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17345,14 +17345,14 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__", 0); - /* "dawg.pyx":916 + /* "dawg.pyx":920 * or a dict {unicode_key: int_value}. * """ * iterable = _iterable_from_argument(arg) # <<<<<<<<<<<<<< * super(IntCompletionDAWG, self).__init__(iterable, input_is_sorted) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iterable_from_argument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iterable_from_argument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -17366,20 +17366,20 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_arg) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arg); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_iterable = __pyx_t_1; __pyx_t_1 = 0; - /* "dawg.pyx":917 + /* "dawg.pyx":921 * """ * iterable = _iterable_from_argument(arg) * super(IntCompletionDAWG, self).__init__(iterable, input_is_sorted) # <<<<<<<<<<<<<< * * def __getitem__(self, key): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_4dawg_IntCompletionDAWG)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4dawg_IntCompletionDAWG)); @@ -17387,10 +17387,10 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -17408,7 +17408,7 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_iterable, __pyx_v_input_is_sorted}; - __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, 917, __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, 921, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -17416,13 +17416,13 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_iterable, __pyx_v_input_is_sorted}; - __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, 917, __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, 921, __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, 917, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __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; @@ -17433,14 +17433,14 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In __Pyx_INCREF(__pyx_v_input_is_sorted); __Pyx_GIVEREF(__pyx_v_input_is_sorted); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_input_is_sorted); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":911 + /* "dawg.pyx":915 * """ * * def __init__(self, arg=None, input_is_sorted=False): # <<<<<<<<<<<<<< @@ -17464,7 +17464,7 @@ static int __pyx_pf_4dawg_17IntCompletionDAWG___init__(struct __pyx_obj_4dawg_In return __pyx_r; } -/* "dawg.pyx":919 +/* "dawg.pyx":923 * super(IntCompletionDAWG, self).__init__(iterable, input_is_sorted) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -17495,7 +17495,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob int __pyx_t_4; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "dawg.pyx":920 + /* "dawg.pyx":924 * * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) # <<<<<<<<<<<<<< @@ -17504,13 +17504,13 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_int_neg_1; - __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_IntCompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_IntCompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get(__pyx_v_self, __pyx_v_key, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_res = __pyx_t_3; - /* "dawg.pyx":921 + /* "dawg.pyx":925 * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -17520,20 +17520,20 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob __pyx_t_4 = ((__pyx_v_res == -1L) != 0); if (unlikely(__pyx_t_4)) { - /* "dawg.pyx":922 + /* "dawg.pyx":926 * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: * raise KeyError(key) # <<<<<<<<<<<<<< * return res * */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 922, __pyx_L1_error) + __PYX_ERR(0, 926, __pyx_L1_error) - /* "dawg.pyx":921 + /* "dawg.pyx":925 * def __getitem__(self, key): * cdef int res = self.get(key, LOOKUP_ERROR) * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -17542,7 +17542,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob */ } - /* "dawg.pyx":923 + /* "dawg.pyx":927 * if res == LOOKUP_ERROR: * raise KeyError(key) * return res # <<<<<<<<<<<<<< @@ -17550,13 +17550,13 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob * cpdef get(self, key, default=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":919 + /* "dawg.pyx":923 * super(IntCompletionDAWG, self).__init__(iterable, input_is_sorted) * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -17575,7 +17575,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_2__getitem__(struct __pyx_ob return __pyx_r; } -/* "dawg.pyx":925 +/* "dawg.pyx":929 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -17612,7 +17612,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_17IntCompletionDAWG_5get)) { __Pyx_XDECREF(__pyx_r); @@ -17632,7 +17632,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -17640,13 +17640,13 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_default}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -17657,7 +17657,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_default); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -17680,7 +17680,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In #endif } - /* "dawg.pyx":931 + /* "dawg.pyx":935 * cdef int res * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -17691,7 +17691,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { - /* "dawg.pyx":932 + /* "dawg.pyx":936 * * if isinstance(key, unicode): * res = self.get_value(key) # <<<<<<<<<<<<<< @@ -17700,7 +17700,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In */ __pyx_v_res = ((struct __pyx_vtabstruct_4dawg_IntCompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); - /* "dawg.pyx":931 + /* "dawg.pyx":935 * cdef int res * * if isinstance(key, unicode): # <<<<<<<<<<<<<< @@ -17710,7 +17710,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In goto __pyx_L3; } - /* "dawg.pyx":934 + /* "dawg.pyx":938 * res = self.get_value(key) * else: * res = self.b_get_value(key) # <<<<<<<<<<<<<< @@ -17718,12 +17718,12 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In * if res == LOOKUP_ERROR: */ /*else*/ { - if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 934, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 938, __pyx_L1_error) __pyx_v_res = ((struct __pyx_vtabstruct_4dawg_IntCompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->b_get_value(__pyx_v_self, ((PyObject*)__pyx_v_key), 0); } __pyx_L3:; - /* "dawg.pyx":936 + /* "dawg.pyx":940 * res = self.b_get_value(key) * * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -17733,7 +17733,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In __pyx_t_8 = ((__pyx_v_res == -1L) != 0); if (__pyx_t_8) { - /* "dawg.pyx":937 + /* "dawg.pyx":941 * * if res == LOOKUP_ERROR: * return default # <<<<<<<<<<<<<< @@ -17745,7 +17745,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In __pyx_r = __pyx_v_default; goto __pyx_L0; - /* "dawg.pyx":936 + /* "dawg.pyx":940 * res = self.b_get_value(key) * * if res == LOOKUP_ERROR: # <<<<<<<<<<<<<< @@ -17754,7 +17754,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In */ } - /* "dawg.pyx":938 + /* "dawg.pyx":942 * if res == LOOKUP_ERROR: * return default * return res # <<<<<<<<<<<<<< @@ -17762,13 +17762,13 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_get(struct __pyx_obj_4dawg_In * cpdef int get_value(self, unicode key): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dawg.pyx":925 + /* "dawg.pyx":929 * return res * * cpdef get(self, key, default=None): # <<<<<<<<<<<<<< @@ -17828,7 +17828,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_5get(PyObject *__pyx_v_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 925, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 929, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -17844,7 +17844,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_5get(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 929, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntCompletionDAWG.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17866,7 +17866,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_4get(struct __pyx_obj_4dawg_ __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; - __pyx_t_1 = __pyx_vtabptr_4dawg_IntCompletionDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_IntCompletionDAWG->get(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17883,7 +17883,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_4get(struct __pyx_obj_4dawg_ return __pyx_r; } -/* "dawg.pyx":940 +/* "dawg.pyx":944 * return res * * cpdef int get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -17912,7 +17912,7 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_17IntCompletionDAWG_7get_value)) { __Pyx_INCREF(__pyx_t_1); @@ -17928,10 +17928,10 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17950,7 +17950,7 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In #endif } - /* "dawg.pyx":941 + /* "dawg.pyx":945 * * cpdef int get_value(self, unicode key): * cdef bytes b_key = key.encode('utf8') # <<<<<<<<<<<<<< @@ -17959,9 +17959,9 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 941, __pyx_L1_error) + __PYX_ERR(0, 945, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -17969,7 +17969,7 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In __pyx_v_b_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":942 + /* "dawg.pyx":946 * cpdef int get_value(self, unicode key): * cdef bytes b_key = key.encode('utf8') * return self.dct.Find(b_key) # <<<<<<<<<<<<<< @@ -17978,13 +17978,13 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_get_value(struct __pyx_obj_4dawg_In */ if (unlikely(__pyx_v_b_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 942, __pyx_L1_error) + __PYX_ERR(0, 946, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error) __pyx_r = __pyx_v_self->__pyx_base.__pyx_base.dct.Find(__pyx_t_6); goto __pyx_L0; - /* "dawg.pyx":940 + /* "dawg.pyx":944 * return res * * cpdef int get_value(self, unicode key): # <<<<<<<<<<<<<< @@ -18013,7 +18013,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_7get_value(PyObject *__pyx_v PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 940, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyUnicode_Type), 1, "key", 1))) __PYX_ERR(0, 944, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_17IntCompletionDAWG_6get_value(((struct __pyx_obj_4dawg_IntCompletionDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -18031,7 +18031,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_6get_value(struct __pyx_obj_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_17IntCompletionDAWG_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_17IntCompletionDAWG_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18048,7 +18048,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_6get_value(struct __pyx_obj_ return __pyx_r; } -/* "dawg.pyx":944 +/* "dawg.pyx":948 * return self.dct.Find(b_key) * * cpdef int b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -18076,7 +18076,7 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_b_get_value(struct __pyx_obj_4dawg_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_b_get_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_17IntCompletionDAWG_9b_get_value)) { __Pyx_INCREF(__pyx_t_1); @@ -18092,10 +18092,10 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_b_get_value(struct __pyx_obj_4dawg_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18114,7 +18114,7 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_b_get_value(struct __pyx_obj_4dawg_ #endif } - /* "dawg.pyx":945 + /* "dawg.pyx":949 * * cpdef int b_get_value(self, bytes key): * return self.dct.Find(key) # <<<<<<<<<<<<<< @@ -18123,13 +18123,13 @@ static int __pyx_f_4dawg_17IntCompletionDAWG_b_get_value(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 945, __pyx_L1_error) + __PYX_ERR(0, 949, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_key); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L1_error) __pyx_r = __pyx_v_self->__pyx_base.__pyx_base.dct.Find(__pyx_t_6); goto __pyx_L0; - /* "dawg.pyx":944 + /* "dawg.pyx":948 * return self.dct.Find(b_key) * * cpdef int b_get_value(self, bytes key): # <<<<<<<<<<<<<< @@ -18157,7 +18157,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_9b_get_value(PyObject *__pyx PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("b_get_value (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 944, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key), (&PyBytes_Type), 1, "key", 1))) __PYX_ERR(0, 948, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_17IntCompletionDAWG_8b_get_value(((struct __pyx_obj_4dawg_IntCompletionDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_key)); /* function exit code */ @@ -18175,7 +18175,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_8b_get_value(struct __pyx_ob PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("b_get_value", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_17IntCompletionDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_4dawg_17IntCompletionDAWG_b_get_value(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18192,7 +18192,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_8b_get_value(struct __pyx_ob return __pyx_r; } -/* "dawg.pyx":947 +/* "dawg.pyx":951 * return self.dct.Find(key) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -18234,7 +18234,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4dawg_17IntCompletionDAWG_11items)) { __Pyx_XDECREF(__pyx_r); @@ -18251,10 +18251,10 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 947, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 951, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18273,7 +18273,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ #endif } - /* "dawg.pyx":948 + /* "dawg.pyx":952 * * cpdef list items(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -18282,14 +18282,14 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 948, __pyx_L1_error) + __PYX_ERR(0, 952, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":949 + /* "dawg.pyx":953 * cpdef list items(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -18298,19 +18298,19 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ __pyx_v_index = __pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":950 + /* "dawg.pyx":954 * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() * cdef list res = [] # <<<<<<<<<<<<<< * cdef int value * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_res = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":953 + /* "dawg.pyx":957 * cdef int value * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -18319,13 +18319,13 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 953, __pyx_L1_error) + __PYX_ERR(0, 957, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error) __pyx_t_6 = ((!(__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_5, (&__pyx_v_index)) != 0)) != 0); if (__pyx_t_6) { - /* "dawg.pyx":954 + /* "dawg.pyx":958 * * if not self.dct.Follow(b_prefix, &index): * return res # <<<<<<<<<<<<<< @@ -18337,7 +18337,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":953 + /* "dawg.pyx":957 * cdef int value * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -18346,7 +18346,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ } - /* "dawg.pyx":957 + /* "dawg.pyx":961 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -18355,7 +18355,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ __pyx_f_4dawg_init_completer(__pyx_v_completer, __pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":958 + /* "dawg.pyx":962 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -18364,12 +18364,12 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ if (unlikely(__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 958, __pyx_L1_error) + __PYX_ERR(0, 962, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_prefix); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L1_error) __pyx_v_completer.Start(__pyx_v_index, __pyx_t_7); - /* "dawg.pyx":960 + /* "dawg.pyx":964 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -18380,7 +18380,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ __pyx_t_6 = (__pyx_v_completer.Next() != 0); if (!__pyx_t_6) break; - /* "dawg.pyx":961 + /* "dawg.pyx":965 * * while completer.Next(): * key = (completer.key()).decode('utf8') # <<<<<<<<<<<<<< @@ -18388,13 +18388,13 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ * res.append((key, value)) */ __pyx_t_7 = ((char *)__pyx_v_completer.key()); - __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":962 + /* "dawg.pyx":966 * while completer.Next(): * key = (completer.key()).decode('utf8') * value = completer.value() # <<<<<<<<<<<<<< @@ -18403,16 +18403,16 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ */ __pyx_v_value = __pyx_v_completer.value(); - /* "dawg.pyx":963 + /* "dawg.pyx":967 * key = (completer.key()).decode('utf8') * value = completer.value() * res.append((key, value)) # <<<<<<<<<<<<<< * * return res */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); @@ -18420,11 +18420,11 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "dawg.pyx":965 + /* "dawg.pyx":969 * res.append((key, value)) * * return res # <<<<<<<<<<<<<< @@ -18436,7 +18436,7 @@ static PyObject *__pyx_f_4dawg_17IntCompletionDAWG_items(struct __pyx_obj_4dawg_ __pyx_r = __pyx_v_res; goto __pyx_L0; - /* "dawg.pyx":947 + /* "dawg.pyx":951 * return self.dct.Find(key) * * cpdef list items(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -18491,7 +18491,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_11items(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 947, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "items") < 0)) __PYX_ERR(0, 951, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -18505,13 +18505,13 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_11items(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("items", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 951, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntCompletionDAWG.items", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 947, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 951, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_17IntCompletionDAWG_10items(((struct __pyx_obj_4dawg_IntCompletionDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -18532,7 +18532,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_10items(struct __pyx_obj_4da __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.prefix = __pyx_v_prefix; - __pyx_t_1 = __pyx_vtabptr_4dawg_IntCompletionDAWG->items(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_4dawg_IntCompletionDAWG->items(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18550,7 +18550,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_10items(struct __pyx_obj_4da } static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "dawg.pyx":967 +/* "dawg.pyx":971 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -18588,7 +18588,7 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_13iteritems(PyObject *__pyx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 967, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iteritems") < 0)) __PYX_ERR(0, 971, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -18602,13 +18602,13 @@ static PyObject *__pyx_pw_4dawg_17IntCompletionDAWG_13iteritems(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 967, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("iteritems", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 971, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dawg.IntCompletionDAWG.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) __PYX_ERR(0, 971, __pyx_L1_error) __pyx_r = __pyx_pf_4dawg_17IntCompletionDAWG_12iteritems(((struct __pyx_obj_4dawg_IntCompletionDAWG *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ @@ -18629,7 +18629,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_12iteritems(struct __pyx_obj if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_4dawg___pyx_scope_struct_13_iteritems *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 967, __pyx_L1_error) + __PYX_ERR(0, 971, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -18640,7 +18640,7 @@ static PyObject *__pyx_pf_4dawg_17IntCompletionDAWG_12iteritems(struct __pyx_obj __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_17IntCompletionDAWG_14generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_IntCompletionDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4dawg_17IntCompletionDAWG_14generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_IntCompletionDAWG_iteritems, __pyx_n_s_dawg); if (unlikely(!gen)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18675,9 +18675,9 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 967, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 971, __pyx_L1_error) - /* "dawg.pyx":968 + /* "dawg.pyx":972 * * def iteritems(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') # <<<<<<<<<<<<<< @@ -18686,15 +18686,15 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ if (unlikely(__pyx_cur_scope->__pyx_v_prefix == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 968, __pyx_L1_error) + __PYX_ERR(0, 972, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_b_prefix = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":969 + /* "dawg.pyx":973 * def iteritems(self, unicode prefix=""): * cdef bytes b_prefix = prefix.encode('utf8') * cdef BaseType index = self.dct.root() # <<<<<<<<<<<<<< @@ -18703,7 +18703,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.root(); - /* "dawg.pyx":972 + /* "dawg.pyx":976 * cdef int value * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -18712,13 +18712,13 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 972, __pyx_L1_error) + __PYX_ERR(0, 976, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct.Follow(__pyx_t_2, (&__pyx_cur_scope->__pyx_v_index)) != 0)) != 0); if (__pyx_t_3) { - /* "dawg.pyx":973 + /* "dawg.pyx":977 * * if not self.dct.Follow(b_prefix, &index): * return # <<<<<<<<<<<<<< @@ -18729,7 +18729,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine __pyx_r = NULL; goto __pyx_L0; - /* "dawg.pyx":972 + /* "dawg.pyx":976 * cdef int value * * if not self.dct.Follow(b_prefix, &index): # <<<<<<<<<<<<<< @@ -18738,7 +18738,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ } - /* "dawg.pyx":976 + /* "dawg.pyx":980 * * cdef Completer completer * init_completer(completer, self.dct, self.guide) # <<<<<<<<<<<<<< @@ -18747,7 +18747,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ __pyx_f_4dawg_init_completer(__pyx_cur_scope->__pyx_v_completer, __pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_base.dct, __pyx_cur_scope->__pyx_v_self->__pyx_base.guide); - /* "dawg.pyx":977 + /* "dawg.pyx":981 * cdef Completer completer * init_completer(completer, self.dct, self.guide) * completer.Start(index, b_prefix) # <<<<<<<<<<<<<< @@ -18756,12 +18756,12 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ if (unlikely(__pyx_cur_scope->__pyx_v_b_prefix == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 977, __pyx_L1_error) + __PYX_ERR(0, 981, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_cur_scope->__pyx_v_b_prefix); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L1_error) __pyx_cur_scope->__pyx_v_completer.Start(__pyx_cur_scope->__pyx_v_index, __pyx_t_4); - /* "dawg.pyx":979 + /* "dawg.pyx":983 * completer.Start(index, b_prefix) * * while completer.Next(): # <<<<<<<<<<<<<< @@ -18772,7 +18772,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine __pyx_t_3 = (__pyx_cur_scope->__pyx_v_completer.Next() != 0); if (!__pyx_t_3) break; - /* "dawg.pyx":980 + /* "dawg.pyx":984 * * while completer.Next(): * key = (completer.key()).decode('utf8') # <<<<<<<<<<<<<< @@ -18780,7 +18780,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine * yield key, value */ __pyx_t_4 = ((char *)__pyx_cur_scope->__pyx_v_completer.key()); - __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_key); @@ -18788,7 +18788,7 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine __Pyx_GIVEREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dawg.pyx":981 + /* "dawg.pyx":985 * while completer.Next(): * key = (completer.key()).decode('utf8') * value = completer.value() # <<<<<<<<<<<<<< @@ -18796,14 +18796,14 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine */ __pyx_cur_scope->__pyx_v_value = __pyx_cur_scope->__pyx_v_completer.value(); - /* "dawg.pyx":982 + /* "dawg.pyx":986 * key = (completer.key()).decode('utf8') * value = completer.value() * yield key, value # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key); @@ -18820,11 +18820,11 @@ static PyObject *__pyx_gb_4dawg_17IntCompletionDAWG_14generator5(__pyx_Coroutine __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L7_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 982, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 986, __pyx_L1_error) } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "dawg.pyx":967 + /* "dawg.pyx":971 * return res * * def iteritems(self, unicode prefix=""): # <<<<<<<<<<<<<< @@ -19088,7 +19088,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st * * @cname("__pyx_convert_string_from_py_std__in_string") * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< - * cdef Py_ssize_t length + * cdef Py_ssize_t length = 0 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) */ @@ -19100,9 +19100,18 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v char const *__pyx_t_1; __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0); + /* "string.from_py":14 + * @cname("__pyx_convert_string_from_py_std__in_string") + * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: + * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<< + * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) + * return string(data, length) + */ + __pyx_v_length = 0; + /* "string.from_py":15 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: - * cdef Py_ssize_t length + * cdef Py_ssize_t length = 0 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<< * return string(data, length) * @@ -19111,7 +19120,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v __pyx_v_data = __pyx_t_1; /* "string.from_py":16 - * cdef Py_ssize_t length + * cdef Py_ssize_t length = 0 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) * return string(data, length) # <<<<<<<<<<<<<< * @@ -19124,7 +19133,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v * * @cname("__pyx_convert_string_from_py_std__in_string") * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<< - * cdef Py_ssize_t length + * cdef Py_ssize_t length = 0 * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) */ @@ -19278,7 +19287,12 @@ static PyTypeObject __pyx_type_4dawg_DAWG = { sizeof(struct __pyx_obj_4dawg_DAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_DAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19331,6 +19345,9 @@ static PyTypeObject __pyx_type_4dawg_DAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_4dawg_CompletionDAWG __pyx_vtable_4dawg_CompletionDAWG; @@ -19380,7 +19397,12 @@ static PyTypeObject __pyx_type_4dawg_CompletionDAWG = { sizeof(struct __pyx_obj_4dawg_CompletionDAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_CompletionDAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19433,6 +19455,9 @@ static PyTypeObject __pyx_type_4dawg_CompletionDAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_4dawg_BytesDAWG __pyx_vtable_4dawg_BytesDAWG; @@ -19518,7 +19543,12 @@ static PyTypeObject __pyx_type_4dawg_BytesDAWG = { sizeof(struct __pyx_obj_4dawg_BytesDAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_BytesDAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19571,6 +19601,9 @@ static PyTypeObject __pyx_type_4dawg_BytesDAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_4dawg_RecordDAWG __pyx_vtable_4dawg_RecordDAWG; @@ -19632,7 +19665,12 @@ static PyTypeObject __pyx_type_4dawg_RecordDAWG = { sizeof(struct __pyx_obj_4dawg_RecordDAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_RecordDAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19685,6 +19723,9 @@ static PyTypeObject __pyx_type_4dawg_RecordDAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_4dawg_IntDAWG __pyx_vtable_4dawg_IntDAWG; @@ -19740,7 +19781,12 @@ static PyTypeObject __pyx_type_4dawg_IntDAWG = { sizeof(struct __pyx_obj_4dawg_IntDAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_DAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19793,6 +19839,9 @@ static PyTypeObject __pyx_type_4dawg_IntDAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_4dawg_IntCompletionDAWG __pyx_vtable_4dawg_IntCompletionDAWG; @@ -19850,7 +19899,12 @@ static PyTypeObject __pyx_type_4dawg_IntCompletionDAWG = { sizeof(struct __pyx_obj_4dawg_IntCompletionDAWG), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg_CompletionDAWG, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19903,6 +19957,9 @@ static PyTypeObject __pyx_type_4dawg_IntCompletionDAWG = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct__iterprefixes *__pyx_freelist_4dawg___pyx_scope_struct__iterprefixes[8]; @@ -19951,7 +20008,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct__iterprefixes = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct__iterprefixes), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct__iterprefixes, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20004,6 +20066,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct__iterprefixes = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_1_compile_replaces *__pyx_freelist_4dawg___pyx_scope_struct_1_compile_replaces[8]; @@ -20058,7 +20123,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_1_compile_replaces = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_1_compile_replaces), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_1_compile_replaces, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20111,6 +20181,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_1_compile_replaces = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_2_genexpr *__pyx_freelist_4dawg___pyx_scope_struct_2_genexpr[8]; @@ -20164,7 +20237,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_2_genexpr = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20217,6 +20295,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_2_genexpr = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_3_iterkeys *__pyx_freelist_4dawg___pyx_scope_struct_3_iterkeys[8]; @@ -20272,7 +20353,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_3_iterkeys = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_3_iterkeys), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_3_iterkeys, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20325,6 +20411,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_3_iterkeys = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_4___init__ *__pyx_freelist_4dawg___pyx_scope_struct_4___init__[8]; @@ -20386,7 +20475,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_4___init__ = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_4___init__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_4___init__, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20439,6 +20533,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_4___init__ = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_5_genexpr *__pyx_freelist_4dawg___pyx_scope_struct_5_genexpr[8]; @@ -20492,7 +20589,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_5_genexpr = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20545,6 +20647,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_5_genexpr = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_6_iteritems *__pyx_freelist_4dawg___pyx_scope_struct_6_iteritems[8]; @@ -20603,7 +20708,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_6_iteritems = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_6_iteritems), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_6_iteritems, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20656,6 +20766,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_6_iteritems = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_7_iterkeys *__pyx_freelist_4dawg___pyx_scope_struct_7_iterkeys[8]; @@ -20711,7 +20824,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_7_iterkeys = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_7_iterkeys), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_7_iterkeys, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20764,6 +20882,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_7_iterkeys = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_8___init__ *__pyx_freelist_4dawg___pyx_scope_struct_8___init__[8]; @@ -20825,7 +20946,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_8___init__ = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_8___init__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_8___init__, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20878,6 +21004,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_8___init__ = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_9_genexpr *__pyx_freelist_4dawg___pyx_scope_struct_9_genexpr[8]; @@ -20931,7 +21060,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_9_genexpr = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -20984,6 +21118,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_9_genexpr = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_10_iteritems *__pyx_freelist_4dawg___pyx_scope_struct_10_iteritems[8]; @@ -21042,7 +21179,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_10_iteritems = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_10_iteritems), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_10_iteritems, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -21095,6 +21237,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_10_iteritems = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_11__iterable_from_argument *__pyx_freelist_4dawg___pyx_scope_struct_11__iterable_from_argument[8]; @@ -21149,7 +21294,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argume sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_11__iterable_from_argument), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_11__iterable_from_argument, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -21202,6 +21352,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argume #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_12_genexpr *__pyx_freelist_4dawg___pyx_scope_struct_12_genexpr[8]; @@ -21255,7 +21408,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_12_genexpr = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -21308,6 +21466,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_12_genexpr = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_obj_4dawg___pyx_scope_struct_13_iteritems *__pyx_freelist_4dawg___pyx_scope_struct_13_iteritems[8]; @@ -21363,7 +21524,12 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_13_iteritems = { sizeof(struct __pyx_obj_4dawg___pyx_scope_struct_13_iteritems), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dawg___pyx_scope_struct_13_iteritems, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -21416,6 +21582,9 @@ static PyTypeObject __pyx_type_4dawg___pyx_scope_struct_13_iteritems = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -21476,6 +21645,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, {&__pyx_kp_u_Error_building_completion_inform, __pyx_k_Error_building_completion_inform, sizeof(__pyx_k_Error_building_completion_inform), 0, 1, 0, 0}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_IntCompletionDAWG, __pyx_k_IntCompletionDAWG, sizeof(__pyx_k_IntCompletionDAWG), 0, 0, 1, 1}, {&__pyx_n_s_IntCompletionDAWG_iteritems, __pyx_k_IntCompletionDAWG_iteritems, sizeof(__pyx_k_IntCompletionDAWG_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_IntDAWG, __pyx_k_IntDAWG, sizeof(__pyx_k_IntDAWG), 0, 0, 1, 1}, @@ -21509,6 +21679,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, {&__pyx_n_s_compile_replaces, __pyx_k_compile_replaces, sizeof(__pyx_k_compile_replaces), 0, 0, 1, 1}, {&__pyx_n_s_compile_replaces_locals_genexpr, __pyx_k_compile_replaces_locals_genexpr, sizeof(__pyx_k_compile_replaces_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_dawg, __pyx_k_dawg, sizeof(__pyx_k_dawg), 0, 0, 1, 1}, @@ -21577,12 +21748,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 60, __pyx_L1_error) - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 114, __pyx_L1_error) - __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 160, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 296, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 427, __pyx_L1_error) - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 523, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -21592,94 +21764,94 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "dawg.pyx":60 + /* "dawg.pyx":64 * key, value = key * if value < 0: * raise ValueError("Negative values are not supported") # <<<<<<<<<<<<<< * else: * value = 0 */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Negative_values_are_not_supporte); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Negative_values_are_not_supporte); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "dawg.pyx":114 + /* "dawg.pyx":118 * if not res: * self.dct.Clear() * raise IOError("Invalid data format") # <<<<<<<<<<<<<< * * return self */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "dawg.pyx":144 + /* "dawg.pyx":148 * stream.open(path, iostream.binary) * if stream.fail(): * raise IOError("It's not possible to read file stream") # <<<<<<<<<<<<<< * * res = self.dct.Read( &stream) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_It_s_not_possible_to_read_file_s); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_It_s_not_possible_to_read_file_s); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "dawg.pyx":160 + /* "dawg.pyx":164 * Save DAWG to a file. * """ * with open(path, 'wb') as f: # <<<<<<<<<<<<<< * self.write(f) * */ - __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "dawg.pyx":273 + /* "dawg.pyx":277 * for k,v in replaces.items(): * if len(k) != 1 or len(v) != 1: * raise ValueError("Keys and values must be single-char unicode strings.") # <<<<<<<<<<<<<< * * return dict( */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Keys_and_values_must_be_single_c); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Keys_and_values_must_be_single_c); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "dawg.pyx":374 + /* "dawg.pyx":378 * if not res: * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Dictionary") # <<<<<<<<<<<<<< * * res = self.guide.Read( &stream) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format_can_t_load); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format_can_t_load); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "dawg.pyx":380 + /* "dawg.pyx":384 * self.guide.Clear() * self.dct.Clear() * raise IOError("Invalid data format: can't load _dawg.Guide") # <<<<<<<<<<<<<< * * return self */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format_can_t_load_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_format_can_t_load_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "dawg.pyx":851 + /* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< * if arg is None: * arg = [] */ - __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_arg, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_arg, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dawg_pyx, __pyx_n_s_iterable_from_argument, 851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_dawg_pyx, __pyx_n_s_iterable_from_argument, 855, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21742,15 +21914,15 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_4dawg_DAWG.similar_keys = (PyObject *(*)(struct __pyx_obj_4dawg_DAWG *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_4DAWG_similar_keys; __pyx_vtable_4dawg_DAWG.prefixes = (PyObject *(*)(struct __pyx_obj_4dawg_DAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_4DAWG_prefixes; __pyx_vtable_4dawg_DAWG.b_prefixes = (PyObject *(*)(struct __pyx_obj_4dawg_DAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_4DAWG_b_prefixes; - if (PyType_Ready(&__pyx_type_4dawg_DAWG) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_DAWG) < 0) __PYX_ERR(0, 33, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_DAWG.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4dawg_DAWG.tp_dictoffset && __pyx_type_4dawg_DAWG.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4dawg_DAWG.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_4dawg_DAWG.tp_dict, __pyx_vtabptr_4dawg_DAWG) < 0) __PYX_ERR(0, 29, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DAWG, (PyObject *)&__pyx_type_4dawg_DAWG) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_DAWG.tp_dict, __pyx_vtabptr_4dawg_DAWG) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DAWG, (PyObject *)&__pyx_type_4dawg_DAWG) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_ptype_4dawg_DAWG = &__pyx_type_4dawg_DAWG; __pyx_vtabptr_4dawg_CompletionDAWG = &__pyx_vtable_4dawg_CompletionDAWG; __pyx_vtable_4dawg_CompletionDAWG.__pyx_base = *__pyx_vtabptr_4dawg_DAWG; @@ -21758,15 +21930,15 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_4dawg_CompletionDAWG.__pyx_base.frombytes = (PyObject *(*)(struct __pyx_obj_4dawg_DAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_14CompletionDAWG_frombytes; __pyx_vtable_4dawg_CompletionDAWG.keys = (PyObject *(*)(struct __pyx_obj_4dawg_CompletionDAWG *, int __pyx_skip_dispatch, struct __pyx_opt_args_4dawg_14CompletionDAWG_keys *__pyx_optional_args))__pyx_f_4dawg_14CompletionDAWG_keys; __pyx_type_4dawg_CompletionDAWG.tp_base = __pyx_ptype_4dawg_DAWG; - if (PyType_Ready(&__pyx_type_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 289, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 293, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_CompletionDAWG.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4dawg_CompletionDAWG.tp_dictoffset && __pyx_type_4dawg_CompletionDAWG.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_4dawg_CompletionDAWG.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_4dawg_CompletionDAWG.tp_dict, __pyx_vtabptr_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompletionDAWG, (PyObject *)&__pyx_type_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 289, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_CompletionDAWG.tp_dict, __pyx_vtabptr_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 293, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CompletionDAWG, (PyObject *)&__pyx_type_4dawg_CompletionDAWG) < 0) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_ptype_4dawg_CompletionDAWG = &__pyx_type_4dawg_CompletionDAWG; __pyx_vtabptr_4dawg_BytesDAWG = &__pyx_vtable_4dawg_BytesDAWG; __pyx_vtable_4dawg_BytesDAWG.__pyx_base = *__pyx_vtabptr_4dawg_CompletionDAWG; @@ -21787,7 +21959,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_4dawg_BytesDAWG._similar_item_values = (PyObject *(*)(struct __pyx_obj_4dawg_BytesDAWG *, int, PyObject *, dawgdic::BaseType, PyObject *))__pyx_f_4dawg_9BytesDAWG__similar_item_values; __pyx_vtable_4dawg_BytesDAWG.similar_item_values = (PyObject *(*)(struct __pyx_obj_4dawg_BytesDAWG *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_9BytesDAWG_similar_item_values; __pyx_type_4dawg_BytesDAWG.tp_base = __pyx_ptype_4dawg_CompletionDAWG; - if (PyType_Ready(&__pyx_type_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 460, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_BytesDAWG.tp_print = 0; #endif @@ -21796,7 +21968,7 @@ static int __Pyx_modinit_type_init_code(void) { } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_BytesDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 456, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_BytesDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 460, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_4dawg_9BytesDAWG___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_4dawg_9BytesDAWG___init__.doc = __pyx_doc_4dawg_9BytesDAWG___init__; @@ -21804,15 +21976,15 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (__Pyx_SetVtable(__pyx_type_4dawg_BytesDAWG.tp_dict, __pyx_vtabptr_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 456, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BytesDAWG, (PyObject *)&__pyx_type_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_BytesDAWG.tp_dict, __pyx_vtabptr_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 460, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BytesDAWG, (PyObject *)&__pyx_type_4dawg_BytesDAWG) < 0) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_ptype_4dawg_BytesDAWG = &__pyx_type_4dawg_BytesDAWG; __pyx_vtabptr_4dawg_RecordDAWG = &__pyx_vtable_4dawg_RecordDAWG; __pyx_vtable_4dawg_RecordDAWG.__pyx_base = *__pyx_vtabptr_4dawg_BytesDAWG; __pyx_vtable_4dawg_RecordDAWG.__pyx_base._value_for_index = (PyObject *(*)(struct __pyx_obj_4dawg_BytesDAWG *, dawgdic::BaseType))__pyx_f_4dawg_10RecordDAWG__value_for_index; __pyx_vtable_4dawg_RecordDAWG.__pyx_base.items = (PyObject *(*)(struct __pyx_obj_4dawg_BytesDAWG *, int __pyx_skip_dispatch, struct __pyx_opt_args_4dawg_9BytesDAWG_items *__pyx_optional_args))__pyx_f_4dawg_10RecordDAWG_items; __pyx_type_4dawg_RecordDAWG.tp_base = __pyx_ptype_4dawg_BytesDAWG; - if (PyType_Ready(&__pyx_type_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 803, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 807, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_RecordDAWG.tp_print = 0; #endif @@ -21821,7 +21993,7 @@ static int __Pyx_modinit_type_init_code(void) { } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_RecordDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 803, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_RecordDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 807, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_4dawg_10RecordDAWG___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_4dawg_10RecordDAWG___init__.doc = __pyx_doc_4dawg_10RecordDAWG___init__; @@ -21829,8 +22001,8 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (__Pyx_SetVtable(__pyx_type_4dawg_RecordDAWG.tp_dict, __pyx_vtabptr_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 803, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordDAWG, (PyObject *)&__pyx_type_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 803, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_RecordDAWG.tp_dict, __pyx_vtabptr_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 807, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordDAWG, (PyObject *)&__pyx_type_4dawg_RecordDAWG) < 0) __PYX_ERR(0, 807, __pyx_L1_error) __pyx_ptype_4dawg_RecordDAWG = &__pyx_type_4dawg_RecordDAWG; __pyx_vtabptr_4dawg_IntDAWG = &__pyx_vtable_4dawg_IntDAWG; __pyx_vtable_4dawg_IntDAWG.__pyx_base = *__pyx_vtabptr_4dawg_DAWG; @@ -21838,7 +22010,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_4dawg_IntDAWG.get_value = (int (*)(struct __pyx_obj_4dawg_IntDAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_7IntDAWG_get_value; __pyx_vtable_4dawg_IntDAWG.b_get_value = (int (*)(struct __pyx_obj_4dawg_IntDAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_7IntDAWG_b_get_value; __pyx_type_4dawg_IntDAWG.tp_base = __pyx_ptype_4dawg_DAWG; - if (PyType_Ready(&__pyx_type_4dawg_IntDAWG) < 0) __PYX_ERR(0, 862, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_IntDAWG) < 0) __PYX_ERR(0, 866, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_IntDAWG.tp_print = 0; #endif @@ -21847,7 +22019,7 @@ static int __Pyx_modinit_type_init_code(void) { } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_IntDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 862, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_IntDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 866, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_4dawg_7IntDAWG___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_4dawg_7IntDAWG___init__.doc = __pyx_doc_4dawg_7IntDAWG___init__; @@ -21855,8 +22027,8 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (__Pyx_SetVtable(__pyx_type_4dawg_IntDAWG.tp_dict, __pyx_vtabptr_4dawg_IntDAWG) < 0) __PYX_ERR(0, 862, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntDAWG, (PyObject *)&__pyx_type_4dawg_IntDAWG) < 0) __PYX_ERR(0, 862, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_IntDAWG.tp_dict, __pyx_vtabptr_4dawg_IntDAWG) < 0) __PYX_ERR(0, 866, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntDAWG, (PyObject *)&__pyx_type_4dawg_IntDAWG) < 0) __PYX_ERR(0, 866, __pyx_L1_error) __pyx_ptype_4dawg_IntDAWG = &__pyx_type_4dawg_IntDAWG; __pyx_vtabptr_4dawg_IntCompletionDAWG = &__pyx_vtable_4dawg_IntCompletionDAWG; __pyx_vtable_4dawg_IntCompletionDAWG.__pyx_base = *__pyx_vtabptr_4dawg_CompletionDAWG; @@ -21865,7 +22037,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_4dawg_IntCompletionDAWG.b_get_value = (int (*)(struct __pyx_obj_4dawg_IntCompletionDAWG *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4dawg_17IntCompletionDAWG_b_get_value; __pyx_vtable_4dawg_IntCompletionDAWG.items = (PyObject *(*)(struct __pyx_obj_4dawg_IntCompletionDAWG *, int __pyx_skip_dispatch, struct __pyx_opt_args_4dawg_17IntCompletionDAWG_items *__pyx_optional_args))__pyx_f_4dawg_17IntCompletionDAWG_items; __pyx_type_4dawg_IntCompletionDAWG.tp_base = __pyx_ptype_4dawg_CompletionDAWG; - if (PyType_Ready(&__pyx_type_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 905, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 909, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg_IntCompletionDAWG.tp_print = 0; #endif @@ -21874,7 +22046,7 @@ static int __Pyx_modinit_type_init_code(void) { } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_IntCompletionDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 905, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4dawg_IntCompletionDAWG, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 909, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_4dawg_17IntCompletionDAWG___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_4dawg_17IntCompletionDAWG___init__.doc = __pyx_doc_4dawg_17IntCompletionDAWG___init__; @@ -21882,10 +22054,10 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (__Pyx_SetVtable(__pyx_type_4dawg_IntCompletionDAWG.tp_dict, __pyx_vtabptr_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 905, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntCompletionDAWG, (PyObject *)&__pyx_type_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 905, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_4dawg_IntCompletionDAWG.tp_dict, __pyx_vtabptr_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 909, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntCompletionDAWG, (PyObject *)&__pyx_type_4dawg_IntCompletionDAWG) < 0) __PYX_ERR(0, 909, __pyx_L1_error) __pyx_ptype_4dawg_IntCompletionDAWG = &__pyx_type_4dawg_IntCompletionDAWG; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct__iterprefixes) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct__iterprefixes) < 0) __PYX_ERR(0, 256, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct__iterprefixes.tp_print = 0; #endif @@ -21893,7 +22065,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct__iterprefixes.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct__iterprefixes = &__pyx_type_4dawg___pyx_scope_struct__iterprefixes; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_1_compile_replaces) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_1_compile_replaces) < 0) __PYX_ERR(0, 273, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_1_compile_replaces.tp_print = 0; #endif @@ -21901,7 +22073,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_1_compile_replaces.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_1_compile_replaces = &__pyx_type_4dawg___pyx_scope_struct_1_compile_replaces; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 281, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_2_genexpr.tp_print = 0; #endif @@ -21909,7 +22081,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_2_genexpr = &__pyx_type_4dawg___pyx_scope_struct_2_genexpr; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_3_iterkeys) < 0) __PYX_ERR(0, 321, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_3_iterkeys) < 0) __PYX_ERR(0, 325, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_3_iterkeys.tp_print = 0; #endif @@ -21917,7 +22089,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_3_iterkeys.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_3_iterkeys = &__pyx_type_4dawg___pyx_scope_struct_3_iterkeys; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_4___init__) < 0) __PYX_ERR(0, 469, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_4___init__) < 0) __PYX_ERR(0, 473, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_4___init__.tp_print = 0; #endif @@ -21925,7 +22097,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_4___init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_4___init__ = &__pyx_type_4dawg___pyx_scope_struct_4___init__; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 479, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 483, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_5_genexpr.tp_print = 0; #endif @@ -21933,7 +22105,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_5_genexpr = &__pyx_type_4dawg___pyx_scope_struct_5_genexpr; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_6_iteritems) < 0) __PYX_ERR(0, 620, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_6_iteritems) < 0) __PYX_ERR(0, 624, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_6_iteritems.tp_print = 0; #endif @@ -21941,7 +22113,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_6_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_6_iteritems = &__pyx_type_4dawg___pyx_scope_struct_6_iteritems; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_7_iterkeys) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_7_iterkeys) < 0) __PYX_ERR(0, 686, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_7_iterkeys.tp_print = 0; #endif @@ -21949,7 +22121,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_7_iterkeys.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_7_iterkeys = &__pyx_type_4dawg___pyx_scope_struct_7_iterkeys; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_8___init__) < 0) __PYX_ERR(0, 820, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_8___init__) < 0) __PYX_ERR(0, 824, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_8___init__.tp_print = 0; #endif @@ -21957,7 +22129,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_8___init__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_8___init__ = &__pyx_type_4dawg___pyx_scope_struct_8___init__; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 835, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 839, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_9_genexpr.tp_print = 0; #endif @@ -21965,7 +22137,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_9_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_9_genexpr = &__pyx_type_4dawg___pyx_scope_struct_9_genexpr; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_10_iteritems) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_10_iteritems) < 0) __PYX_ERR(0, 850, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_10_iteritems.tp_print = 0; #endif @@ -21973,7 +22145,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_10_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_10_iteritems = &__pyx_type_4dawg___pyx_scope_struct_10_iteritems; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argument) < 0) __PYX_ERR(0, 851, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argument) < 0) __PYX_ERR(0, 855, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argument.tp_print = 0; #endif @@ -21981,7 +22153,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argument.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_11__iterable_from_argument = &__pyx_type_4dawg___pyx_scope_struct_11__iterable_from_argument; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 860, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_12_genexpr.tp_print = 0; #endif @@ -21989,7 +22161,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_4dawg___pyx_scope_struct_12_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_4dawg___pyx_scope_struct_12_genexpr = &__pyx_type_4dawg___pyx_scope_struct_12_genexpr; - if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_13_iteritems) < 0) __PYX_ERR(0, 967, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_4dawg___pyx_scope_struct_13_iteritems) < 0) __PYX_ERR(0, 971, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_4dawg___pyx_scope_struct_13_iteritems.tp_print = 0; #endif @@ -22124,6 +22296,11 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_dawg(PyObject *__pyx_pyinit_module PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -22231,109 +22408,213 @@ if (!__Pyx_RefNanny) { /* "dawg.pyx":19 * cimport b64_decode * - * import collections # <<<<<<<<<<<<<< + * try: # <<<<<<<<<<<<<< + * from collections.abc import Mapping + * except ImportError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "dawg.pyx":20 + * + * try: + * from collections.abc import Mapping # <<<<<<<<<<<<<< + * except ImportError: + * # Python 2.7 + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_Mapping); + __Pyx_GIVEREF(__pyx_n_s_Mapping); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Mapping); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mapping, __pyx_t_4) < 0) __PYX_ERR(0, 20, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "dawg.pyx":19 + * cimport b64_decode + * + * try: # <<<<<<<<<<<<<< + * from collections.abc import Mapping + * except ImportError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "dawg.pyx":21 + * try: + * from collections.abc import Mapping + * except ImportError: # <<<<<<<<<<<<<< + * # Python 2.7 + * from collections import Mapping + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_6) { + __Pyx_AddTraceback("dawg", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 21, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + + /* "dawg.pyx":23 + * except ImportError: + * # Python 2.7 + * from collections import Mapping # <<<<<<<<<<<<<< * import struct * import sys */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 23, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_n_s_Mapping); + __Pyx_GIVEREF(__pyx_n_s_Mapping); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_Mapping); + __pyx_t_9 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_8, -1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 23, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 23, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mapping, __pyx_t_8) < 0) __PYX_ERR(0, 23, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; - /* "dawg.pyx":20 + /* "dawg.pyx":19 + * cimport b64_decode * - * import collections + * try: # <<<<<<<<<<<<<< + * from collections.abc import Mapping + * except ImportError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L7_try_end:; + } + + /* "dawg.pyx":24 + * # Python 2.7 + * from collections import Mapping * import struct # <<<<<<<<<<<<<< * import sys * from binascii import b2a_base64 */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_7) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":21 - * import collections + /* "dawg.pyx":25 + * from collections import Mapping * import struct * import sys # <<<<<<<<<<<<<< * from binascii import b2a_base64 * */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_7) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dawg.pyx":22 + /* "dawg.pyx":26 * import struct * import sys * from binascii import b2a_base64 # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_b2a_base64); __Pyx_GIVEREF(__pyx_n_s_b2a_base64); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_b2a_base64); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_binascii, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_b2a_base64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_b2a_base64, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_b2a_base64); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_binascii, __pyx_t_7, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_b2a_base64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_b2a_base64, __pyx_t_7) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dawg.pyx":25 + /* "dawg.pyx":29 * * * class Error(Exception): # <<<<<<<<<<<<<< * pass * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_dawg, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_4, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_dawg, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Error, __pyx_t_4, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_9) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dawg.pyx":269 + /* "dawg.pyx":273 * * @classmethod * def compile_replaces(cls, replaces): # <<<<<<<<<<<<<< * * for k,v in replaces.items(): */ - __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_4dawg_DAWG, __pyx_n_s_compile_replaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_4dawg_DAWG, __pyx_n_s_compile_replaces); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "dawg.pyx":268 + /* "dawg.pyx":272 * pos += 1 * * @classmethod # <<<<<<<<<<<<<< * def compile_replaces(cls, replaces): * */ - __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_4dawg_DAWG->tp_dict, __pyx_n_s_compile_replaces, __pyx_t_1) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_4dawg_DAWG->tp_dict, __pyx_n_s_compile_replaces, __pyx_t_7) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_4dawg_DAWG); - /* "dawg.pyx":452 + /* "dawg.pyx":456 * # are not supported anyway because dawgdic doesn't support keys containing * # chr(0). * cdef bytes PAYLOAD_SEPARATOR = b'\x01' # <<<<<<<<<<<<<< @@ -22345,7 +22626,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF_SET(__pyx_v_4dawg_PAYLOAD_SEPARATOR, __pyx_kp_b__13); __Pyx_GIVEREF(__pyx_kp_b__13); - /* "dawg.pyx":469 + /* "dawg.pyx":473 * cdef Completer* _completer * * def __init__(self, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -22356,7 +22637,7 @@ if (!__Pyx_RefNanny) { __pyx_k__10 = __pyx_v_4dawg_PAYLOAD_SEPARATOR; __Pyx_GIVEREF(__pyx_v_4dawg_PAYLOAD_SEPARATOR); - /* "dawg.pyx":820 + /* "dawg.pyx":824 * cdef _struct * * def __init__(self, fmt, arg=None, input_is_sorted=False, bytes payload_separator=PAYLOAD_SEPARATOR): # <<<<<<<<<<<<<< @@ -22367,27 +22648,27 @@ if (!__Pyx_RefNanny) { __pyx_k__12 = __pyx_v_4dawg_PAYLOAD_SEPARATOR; __Pyx_GIVEREF(__pyx_v_4dawg_PAYLOAD_SEPARATOR); - /* "dawg.pyx":851 + /* "dawg.pyx":855 * * * def _iterable_from_argument(arg): # <<<<<<<<<<<<<< * if arg is None: * arg = [] */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4dawg_1_iterable_from_argument, NULL, __pyx_n_s_dawg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterable_from_argument, __pyx_t_1) < 0) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_4dawg_1_iterable_from_argument, NULL, __pyx_n_s_dawg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterable_from_argument, __pyx_t_7) < 0) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dawg.pyx":1 * # cython: profile=False # <<<<<<<<<<<<<< * # cython: embedsignature=True * from __future__ import unicode_literals */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "vector.to_py":60 * @@ -22401,10 +22682,11 @@ if (!__Pyx_RefNanny) { goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init dawg", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -24181,6 +24463,31 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); @@ -24333,31 +24640,6 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { return NULL; } -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; icurexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - if (unlikely(PyTuple_Check(err))) - return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - /* GetNameInClass */ static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { PyObject *result; @@ -26878,6 +27160,9 @@ static PyTypeObject __pyx_GeneratorType_type = { #if PY_VERSION_HEX >= 0x030800b1 0, #endif +#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, +#endif }; static int __pyx_Generator_init(void) { __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; diff --git a/src/iostream.cpp b/src/iostream.cpp index ce93872..a15fa38 100644 --- a/src/iostream.cpp +++ b/src/iostream.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.13 */ +/* Generated by Cython 0.29.15 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_13" -#define CYTHON_HEX_VERSION 0x001D0DF0 +#define CYTHON_ABI "0_29_15" +#define CYTHON_HEX_VERSION 0x001D0FF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof