Commits

Mikhail Korobov committed 98c4bfa

rebuild wrapper

Comments (0)

Files changed (13)

src/_base_types.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_completer.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_dawg_builder.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_dictionary.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_dictionary_builder.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_dictionary_unit.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_guide_builder.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/_guide_unit.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"

src/b64_decode.cpp

-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-/* Generated by Cython 0.17 on Tue Sep 25 15:25:25 2012 */
+/* Generated by Cython 0.17.1 on Sun Sep 30 20:33:55 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 struct __pyx_opt_args_4dawg_7IntDAWG_get;
 
 /* "dawg.pyx":281
- *         del self.completer
+ *             del self.completer
  * 
  *     cpdef list keys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
  *         cdef bytes b_prefix = prefix.encode('utf8')
   PyObject *prefix;
 };
 
-/* "dawg.pyx":443
+/* "dawg.pyx":444
  *         return res
  * 
  *     cpdef get(self, key, default=None):             # <<<<<<<<<<<<<<
   PyObject *__pyx_default;
 };
 
-/* "dawg.pyx":496
+/* "dawg.pyx":497
  * 
  * 
  *     cpdef list items(self, unicode prefix=""):             # <<<<<<<<<<<<<<
   PyObject *prefix;
 };
 
-/* "dawg.pyx":571
+/* "dawg.pyx":572
  *             yield (u_key, value)
  * 
  *     cpdef list keys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
   PyObject *prefix;
 };
 
-/* "dawg.pyx":752
+/* "dawg.pyx":753
  *         return [self._struct.unpack(val) for val in value]
  * 
  *     cpdef list items(self, unicode prefix=""):             # <<<<<<<<<<<<<<
   PyObject *prefix;
 };
 
-/* "dawg.pyx":802
+/* "dawg.pyx":803
  *         return res
  * 
  *     cpdef get(self, key, default=None):             # <<<<<<<<<<<<<<
   PyObject *__pyx_default;
 };
 
-/* "dawg.pyx":756
+/* "dawg.pyx":757
  *         return [(key, self._struct.unpack(val)) for (key, val) in items]
  * 
  *     def iteritems(self, unicode prefix=""):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":297
+/* "dawg.pyx":298
  *         return res
  * 
  *     def iterkeys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":424
+/* "dawg.pyx":425
  *             arg = []
  * 
  *         keys = (self._raw_key(d[0], d[1]) for d in arg)             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":408
+/* "dawg.pyx":409
  * DEF MAX_VALUE_SIZE = 32768
  * 
  * cdef class BytesDAWG(CompletionDAWG):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":766
+/* "dawg.pyx":767
  *     It can store integer values for unicode keys.
  *     """
  *     def __init__(self, arg=None, input_is_sorted=False):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":536
+/* "dawg.pyx":537
  *         return res
  * 
  *     def iteritems(self, unicode prefix=""):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":745
+/* "dawg.pyx":746
  *             arg = []
  * 
  *         keys = ((d[0], self._struct.pack(*d[1])) for d in arg)             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":417
+/* "dawg.pyx":418
  *     """
  * 
  *     def __init__(self, arg=None, input_is_sorted=False):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":761
+/* "dawg.pyx":762
  * 
  * 
  * cdef class IntDAWG(DAWG):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":594
+/* "dawg.pyx":595
  *         return res
  * 
  *     def iterkeys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":730
+/* "dawg.pyx":731
  *     cdef _struct
  * 
  *     def __init__(self, fmt, arg=None, input_is_sorted=False):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":713
+/* "dawg.pyx":714
  * 
  * 
  * cdef class RecordDAWG(BytesDAWG):             # <<<<<<<<<<<<<<
 };
 
 
-/* "dawg.pyx":775
+/* "dawg.pyx":776
  * 
  *         if isinstance(arg, collections.Mapping):
  *             iterable = ((key, arg[key]) for key in arg)             # <<<<<<<<<<<<<<
 static struct __pyx_vtabstruct_4dawg_CompletionDAWG *__pyx_vtabptr_4dawg_CompletionDAWG;
 
 
-/* "dawg.pyx":408
+/* "dawg.pyx":409
  * DEF MAX_VALUE_SIZE = 32768
  * 
  * cdef class BytesDAWG(CompletionDAWG):             # <<<<<<<<<<<<<<
 static struct __pyx_vtabstruct_4dawg_BytesDAWG *__pyx_vtabptr_4dawg_BytesDAWG;
 
 
-/* "dawg.pyx":713
+/* "dawg.pyx":714
  * 
  * 
  * cdef class RecordDAWG(BytesDAWG):             # <<<<<<<<<<<<<<
 static struct __pyx_vtabstruct_4dawg_RecordDAWG *__pyx_vtabptr_4dawg_RecordDAWG;
 
 
-/* "dawg.pyx":761
+/* "dawg.pyx":762
  * 
  * 
  * cdef class IntDAWG(DAWG):             # <<<<<<<<<<<<<<
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+    const char* function_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
 #ifndef CYTHON_PROFILE
   #define CYTHON_PROFILE 1
 #endif
   #define __Pyx_TraceReturn(result)
 #endif /* CYTHON_PROFILE */
 
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
 
 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
     const char *name, int exact); /*proto*/
 
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
-
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
 #define __Pyx_GetItemInt_Unicode(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
 
 /* Implementation of 'dawg' */
 static PyObject *__pyx_builtin_sorted;
+static PyObject *__pyx_builtin_Exception;
 static PyObject *__pyx_builtin_IOError;
 static PyObject *__pyx_builtin_open;
 static PyObject *__pyx_builtin_ValueError;
 static PyObject *__pyx_builtin_super;
-static PyObject *__pyx_builtin_Exception;
 static PyObject *__pyx_builtin_range;
 static PyObject *__pyx_builtin_KeyError;
-static void __pyx_pf_4dawg_4DAWG___dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self); /* proto */
-static int __pyx_pf_4dawg_4DAWG_2__init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_arg, PyObject *__pyx_v_input_is_sorted); /* proto */
+static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_arg, PyObject *__pyx_v_input_is_sorted); /* proto */
+static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self); /* proto */
 static PyObject *__pyx_pf_4dawg_4DAWG_4_build_from_iterable(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_iterable); /* proto */
 static int __pyx_pf_4dawg_4DAWG_6__contains__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
 static PyObject *__pyx_pf_4dawg_4DAWG_8has_key(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
 static PyObject *__pyx_pf_4dawg_7IntDAWG_8get_value(struct __pyx_obj_4dawg_IntDAWG *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
 static PyObject *__pyx_pf_4dawg_7IntDAWG_10b_get_value(struct __pyx_obj_4dawg_IntDAWG *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
 static char __pyx_k_2[] = "_build_from_iterable";
-static char __pyx_k_4[] = "Invalid data format";
-static char __pyx_k_6[] = "getfilesystemencoding";
-static char __pyx_k_9[] = "";
-static char __pyx_k_14[] = "Keys and values must be single-char unicode strings.";
-static char __pyx_k_17[] = "Error building completion information";
-static char __pyx_k_19[] = "Invalid data format: can't load _dawg.Dictionary";
-static char __pyx_k_21[] = "Invalid data format: can't load _dawg.Guide";
-static char __pyx_k_26[] = "\377";
-static char __pyx_k_29[] = "Negative values are not supported";
+static char __pyx_k_4[] = "Can't build dictionary";
+static char __pyx_k_6[] = "Invalid data format";
+static char __pyx_k_8[] = "getfilesystemencoding";
+static char __pyx_k_11[] = "";
+static char __pyx_k_16[] = "Keys and values must be single-char unicode strings.";
+static char __pyx_k_19[] = "Error building completion information";
+static char __pyx_k_21[] = "Invalid data format: can't load _dawg.Dictionary";
+static char __pyx_k_23[] = "Invalid data format: can't load _dawg.Guide";
+static char __pyx_k_28[] = "\377";
+static char __pyx_k_31[] = "Negative values are not supported";
 static char __pyx_k__wb[] = "wb";
 static char __pyx_k__arg[] = "arg";
 static char __pyx_k__fmt[] = "fmt";
 static char __pyx_k__input_is_sorted[] = "input_is_sorted";
 static char __pyx_k__compile_replaces[] = "compile_replaces";
 static char __pyx_k__similar_item_values[] = "similar_item_values";
-static PyObject *__pyx_kp_u_14;
-static PyObject *__pyx_kp_u_17;
+static PyObject *__pyx_kp_u_11;
+static PyObject *__pyx_kp_u_16;
 static PyObject *__pyx_kp_u_19;
 static PyObject *__pyx_n_s_2;
 static PyObject *__pyx_kp_u_21;
-static PyObject *__pyx_kp_b_26;
-static PyObject *__pyx_kp_u_29;
+static PyObject *__pyx_kp_u_23;
+static PyObject *__pyx_kp_b_28;
+static PyObject *__pyx_kp_u_31;
 static PyObject *__pyx_kp_u_4;
-static PyObject *__pyx_n_s_6;
-static PyObject *__pyx_kp_u_9;
+static PyObject *__pyx_kp_u_6;
+static PyObject *__pyx_n_s_8;
 static PyObject *__pyx_n_s__Exception;
 static PyObject *__pyx_n_s__IOError;
 static PyObject *__pyx_n_s__KeyError;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_neg_1;
 static PyObject *__pyx_k_1;
-static PyObject *__pyx_k_16;
-static PyObject *__pyx_k_25;
+static PyObject *__pyx_k_18;
 static PyObject *__pyx_k_27;
-static PyObject *__pyx_k_28;
+static PyObject *__pyx_k_29;
+static PyObject *__pyx_k_30;
 static PyObject *__pyx_k_tuple_3;
 static PyObject *__pyx_k_tuple_5;
 static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_8;
+static PyObject *__pyx_k_tuple_9;
 static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_11;
 static PyObject *__pyx_k_tuple_12;
 static PyObject *__pyx_k_tuple_13;
+static PyObject *__pyx_k_tuple_14;
 static PyObject *__pyx_k_tuple_15;
-static PyObject *__pyx_k_tuple_18;
+static PyObject *__pyx_k_tuple_17;
 static PyObject *__pyx_k_tuple_20;
 static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_23;
 static PyObject *__pyx_k_tuple_24;
-static PyObject *__pyx_k_tuple_30;
-static PyObject *__pyx_k_tuple_31;
-
-/* Python wrapper */
-static void __pyx_pw_4dawg_4DAWG_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_4dawg_4DAWG_1__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_4dawg_4DAWG___dealloc__(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self));
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "dawg.pyx":32
- *     cdef _dawg.Dawg dawg
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         self.dct.Clear()
- *         self.dawg.Clear()
- */
-
-static void __pyx_pf_4dawg_4DAWG___dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 32);
-
-  /* "dawg.pyx":33
- * 
- *     def __dealloc__(self):
- *         self.dct.Clear()             # <<<<<<<<<<<<<<
- *         self.dawg.Clear()
- * 
- */
-  __pyx_v_self->dct.Clear();
-
-  /* "dawg.pyx":34
- *     def __dealloc__(self):
- *         self.dct.Clear()
- *         self.dawg.Clear()             # <<<<<<<<<<<<<<
- * 
- *     def __init__(self, arg=None, input_is_sorted=False):
- */
-  __pyx_v_self->dawg.Clear();
-
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* Python wrapper */
-static int __pyx_pw_4dawg_4DAWG_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_4dawg_4DAWG_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_k_tuple_25;
+static PyObject *__pyx_k_tuple_26;
+static PyObject *__pyx_k_tuple_32;
+static PyObject *__pyx_k_tuple_33;
+
+/* Python wrapper */
+static int __pyx_pw_4dawg_4DAWG_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_4dawg_4DAWG_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_arg = 0;
   PyObject *__pyx_v_input_is_sorted = 0;
   int __pyx_r;
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arg,&__pyx_n_s__input_is_sorted,0};
     PyObject* values[2] = {0,0};
 
-    /* "dawg.pyx":36
- *         self.dawg.Clear()
+    /* "dawg.pyx":32
+ *     cdef _dawg.Dawg dawg
  * 
  *     def __init__(self, arg=None, input_is_sorted=False):             # <<<<<<<<<<<<<<
  *         if arg is None:
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("dawg.DAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_4dawg_4DAWG_2__init__(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), __pyx_v_arg, __pyx_v_input_is_sorted);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_4dawg_4DAWG_2__init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_arg, PyObject *__pyx_v_input_is_sorted) {
+  __pyx_r = __pyx_pf_4dawg_4DAWG___init__(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), __pyx_v_arg, __pyx_v_input_is_sorted);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_4dawg_4DAWG___init__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self, PyObject *__pyx_v_arg, PyObject *__pyx_v_input_is_sorted) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 36);
+  __Pyx_TraceCall("__init__", __pyx_f[0], 32);
   __Pyx_INCREF(__pyx_v_arg);
 
-  /* "dawg.pyx":37
+  /* "dawg.pyx":33
  * 
  *     def __init__(self, arg=None, input_is_sorted=False):
  *         if arg is None:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_arg == Py_None);
   if (__pyx_t_1) {
 
-    /* "dawg.pyx":38
+    /* "dawg.pyx":34
  *     def __init__(self, arg=None, input_is_sorted=False):
  *         if arg is None:
  *             arg = []             # <<<<<<<<<<<<<<
  *         if not input_is_sorted:
  *             arg = sorted(arg)
  */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_v_arg);
     __pyx_v_arg = ((PyObject *)__pyx_t_2);
   }
   __pyx_L3:;
 
-  /* "dawg.pyx":39
+  /* "dawg.pyx":35
  *         if arg is None:
  *             arg = []
  *         if not input_is_sorted:             # <<<<<<<<<<<<<<
  *             arg = sorted(arg)
  *         self._build_from_iterable(arg)
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_input_is_sorted); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_input_is_sorted); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_3 = (!__pyx_t_1);
   if (__pyx_t_3) {
 
-    /* "dawg.pyx":40
+    /* "dawg.pyx":36
  *             arg = []
  *         if not input_is_sorted:
  *             arg = sorted(arg)             # <<<<<<<<<<<<<<
  *         self._build_from_iterable(arg)
  * 
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_arg);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arg);
     __Pyx_GIVEREF(__pyx_v_arg);
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_v_arg);
   }
   __pyx_L4:;
 
-  /* "dawg.pyx":41
+  /* "dawg.pyx":37
  *         if not input_is_sorted:
  *             arg = sorted(arg)
  *         self._build_from_iterable(arg)             # <<<<<<<<<<<<<<
  * 
- * 
- */
-  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ *     def __dealloc__(self):
+ */
+  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_arg);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arg);
   __Pyx_GIVEREF(__pyx_v_arg);
-  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 }
 
 /* Python wrapper */
+static void __pyx_pw_4dawg_4DAWG_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_4dawg_4DAWG_3__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_4dawg_4DAWG_2__dealloc__(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+}
+
+/* "dawg.pyx":39
+ *         self._build_from_iterable(arg)
+ * 
+ *     def __dealloc__(self):             # <<<<<<<<<<<<<<
+ *         self.dct.Clear()
+ *         self.dawg.Clear()
+ */
+
+static void __pyx_pf_4dawg_4DAWG_2__dealloc__(struct __pyx_obj_4dawg_DAWG *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_TraceDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 39);
+
+  /* "dawg.pyx":40
+ * 
+ *     def __dealloc__(self):
+ *         self.dct.Clear()             # <<<<<<<<<<<<<<
+ *         self.dawg.Clear()
+ * 
+ */
+  __pyx_v_self->dct.Clear();
+
+  /* "dawg.pyx":41
+ *     def __dealloc__(self):
+ *         self.dct.Clear()
+ *         self.dawg.Clear()             # <<<<<<<<<<<<<<
+ * 
+ *     def _build_from_iterable(self, iterable):
+ */
+  __pyx_v_self->dawg.Clear();
+
+  __Pyx_TraceReturn(Py_None);
+  __Pyx_RefNannyFinishContext();
+}
+
+/* Python wrapper */
 static PyObject *__pyx_pw_4dawg_4DAWG_5_build_from_iterable(PyObject *__pyx_v_self, PyObject *__pyx_v_iterable); /*proto*/
 static PyObject *__pyx_pw_4dawg_4DAWG_5_build_from_iterable(PyObject *__pyx_v_self, PyObject *__pyx_v_iterable) {
   PyObject *__pyx_r = 0;
   return __pyx_r;
 }
 
-/* "dawg.pyx":44
- * 
+/* "dawg.pyx":43
+ *         self.dawg.Clear()
  * 
  *     def _build_from_iterable(self, iterable):             # <<<<<<<<<<<<<<
  *         cdef DawgBuilder dawg_builder
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("_build_from_iterable", 0);
-  __Pyx_TraceCall("_build_from_iterable", __pyx_f[0], 44);
-
-  /* "dawg.pyx":48
+  __Pyx_TraceCall("_build_from_iterable", __pyx_f[0], 43);
+
+  /* "dawg.pyx":47
  * 
  *         cdef bytes b_key
  *         for key in iterable:             # <<<<<<<<<<<<<<
     __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_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iterable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
   }
     if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
       #if CYTHON_COMPILING_IN_CPYTHON
-      __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_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #endif
     } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
       #if CYTHON_COMPILING_IN_CPYTHON
-      __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_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       #endif
     } else {
       __pyx_t_4 = __pyx_t_3(__pyx_t_1);
       if (unlikely(!__pyx_t_4)) {
         if (PyErr_Occurred()) {
           if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         }
         break;
       }
     __pyx_v_key = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "dawg.pyx":49
+    /* "dawg.pyx":48
  *         cdef bytes b_key
  *         for key in iterable:
  *             if isinstance(key, unicode):             # <<<<<<<<<<<<<<
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_5) {
 
-      /* "dawg.pyx":50
+      /* "dawg.pyx":49
  *         for key in iterable:
  *             if isinstance(key, unicode):
  *                 b_key = key.encode('utf8')             # <<<<<<<<<<<<<<
  *             else:
  *                 b_key = key
  */
-      __pyx_t_4 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_XDECREF(((PyObject *)__pyx_v_b_key));
       __pyx_v_b_key = ((PyObject*)__pyx_t_6);
       __pyx_t_6 = 0;
     }
     /*else*/ {
 
-      /* "dawg.pyx":52
+      /* "dawg.pyx":51
  *                 b_key = key.encode('utf8')
  *             else:
  *                 b_key = key             # <<<<<<<<<<<<<<
  *             dawg_builder.Insert(b_key)
  * 
  */
-      if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (!(likely(PyBytes_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_key)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_INCREF(__pyx_v_key);
       __Pyx_XDECREF(((PyObject *)__pyx_v_b_key));
       __pyx_v_b_key = ((PyObject*)__pyx_v_key);
     }
     __pyx_L5:;
 
-    /* "dawg.pyx":53
+    /* "dawg.pyx":52
  *             else:
  *                 b_key = key
  *             dawg_builder.Insert(b_key)             # <<<<<<<<<<<<<<
  * 
  *         dawg_builder.Finish(&self.dawg)
  */
-    __pyx_t_7 = PyBytes_AsString(((PyObject *)__pyx_v_b_key)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = PyBytes_AsString(((PyObject *)__pyx_v_b_key)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_v_dawg_builder.Insert(__pyx_t_7);
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
+  /* "dawg.pyx":54
+ *             dawg_builder.Insert(b_key)
+ * 
+ *         dawg_builder.Finish(&self.dawg)             # <<<<<<<<<<<<<<
+ *         if not _dictionary_builder.Build(self.dawg, &(self.dct)):
+ *             raise Exception("Can't build dictionary")
+ */
+  __pyx_v_dawg_builder.Finish((&__pyx_v_self->dawg));
+
   /* "dawg.pyx":55
- *             dawg_builder.Insert(b_key)
- * 
- *         dawg_builder.Finish(&self.dawg)             # <<<<<<<<<<<<<<
- *         _dictionary_builder.Build(self.dawg, &(self.dct))
- * 
- */
-  __pyx_v_dawg_builder.Finish((&__pyx_v_self->dawg));
-
-  /* "dawg.pyx":56
  * 
  *         dawg_builder.Finish(&self.dawg)
- *         _dictionary_builder.Build(self.dawg, &(self.dct))             # <<<<<<<<<<<<<<
+ *         if not _dictionary_builder.Build(self.dawg, &(self.dct)):             # <<<<<<<<<<<<<<
+ *             raise Exception("Can't build dictionary")
+ * 
+ */
+  __pyx_t_5 = (!dawgdic::DictionaryBuilder::Build(__pyx_v_self->dawg, (&__pyx_v_self->dct)));
+  if (__pyx_t_5) {
+
+    /* "dawg.pyx":56
+ *         dawg_builder.Finish(&self.dawg)
+ *         if not _dictionary_builder.Build(self.dawg, &(self.dct)):
+ *             raise Exception("Can't build dictionary")             # <<<<<<<<<<<<<<
  * 
  *     def __contains__(self, key):
  */
-  dawgdic::DictionaryBuilder::Build(__pyx_v_self->dawg, (&__pyx_v_self->dct));
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 }
 
 /* "dawg.pyx":58
- *         _dictionary_builder.Build(self.dawg, &(self.dct))
+ *             raise Exception("Can't build dictionary")
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
  *         if isinstance(key, unicode):
  * 
  *             return self
  */
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L4;}
+      __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L4;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  * 
  *         return self
  */
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __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;
     }
     /*finally:*/ {
       if (__pyx_t_3) {
-        __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_8, NULL);
+        __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_10, NULL);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_7);
  *     cpdef list prefixes(self, unicode key):
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_kp_u_9);
+  __pyx_t_1 = ((PyObject *)__pyx_kp_u_11);
   __Pyx_INCREF(__pyx_t_1);
   __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4dawg_DAWG *)__pyx_v_self->__pyx_vtab)->_similar_keys(__pyx_v_self, ((PyObject*)__pyx_t_1), __pyx_v_key, __pyx_v_self->dct.root(), __pyx_v_replaces)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_10 = PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_t_1), __pyx_n_s__decode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __pyx_r = __pyx_t_1;
  */
     __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_k, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
  */
     __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_v, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  * 
  *         return dict(
  */
-      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __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;
  *         if not _guide_builder.Build(self.dawg, self.dct, &self.guide):
  */
     values[0] = ((PyObject *)Py_None);
-    values[1] = __pyx_k_16;
+    values[1] = __pyx_k_18;
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  *         if not self.completer:
  *             self.completer = new Completer(self.dct, self.guide)
  */
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __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;
  *         if not self.completer:
  *             self.completer = new Completer(self.dct, self.guide)             # <<<<<<<<<<<<<<
  * 
- * 
+ *     def __dealloc__(self):
  */
     __pyx_v_self->completer = new dawgdic::Completer(__pyx_v_self->__pyx_base.dct, __pyx_v_self->guide);
     goto __pyx_L4;
   __Pyx_RefNannyFinishContext();
 }
 
-/* "dawg.pyx":277
- * 
+/* "dawg.pyx":276
+ *             self.completer = new Completer(self.dct, self.guide)
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
  *         self.guide.Clear()
- *         del self.completer
+ *         if self.completer:
  */
 
 static void __pyx_pf_4dawg_14CompletionDAWG_2__dealloc__(struct __pyx_obj_4dawg_CompletionDAWG *__pyx_v_self) {
   __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 277);
-
-  /* "dawg.pyx":278
+  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 276);
+
+  /* "dawg.pyx":277
  * 
  *     def __dealloc__(self):
  *         self.guide.Clear()             # <<<<<<<<<<<<<<
- *         del self.completer
- * 
+ *         if self.completer:
+ *             del self.completer
  */
   __pyx_v_self->guide.Clear();
 
-  /* "dawg.pyx":279
+  /* "dawg.pyx":278
  *     def __dealloc__(self):
  *         self.guide.Clear()
- *         del self.completer             # <<<<<<<<<<<<<<
+ *         if self.completer:             # <<<<<<<<<<<<<<
+ *             del self.completer
+ * 
+ */
+  __pyx_t_1 = (__pyx_v_self->completer != 0);
+  if (__pyx_t_1) {
+
+    /* "dawg.pyx":279
+ *         self.guide.Clear()
+ *         if self.completer:
+ *             del self.completer             # <<<<<<<<<<<<<<
  * 
  *     cpdef list keys(self, unicode prefix=""):
  */
-  delete __pyx_v_self->completer;
+    delete __pyx_v_self->completer;
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
 
   __Pyx_TraceReturn(Py_None);
   __Pyx_RefNannyFinishContext();
 }
 
 /* "dawg.pyx":281
- *         del self.completer
+ *             del self.completer
  * 
  *     cpdef list keys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
  *         cdef bytes b_prefix = prefix.encode('utf8')
 
 static PyObject *__pyx_pw_4dawg_14CompletionDAWG_5keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static PyObject *__pyx_f_4dawg_14CompletionDAWG_keys(struct __pyx_obj_4dawg_CompletionDAWG *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_4dawg_14CompletionDAWG_keys *__pyx_optional_args) {
-  PyObject *__pyx_v_prefix = ((PyObject*)__pyx_kp_u_9);
+  PyObject *__pyx_v_prefix = ((PyObject*)__pyx_kp_u_11);
   PyObject *__pyx_v_b_prefix = 0;
   PyObject *__pyx_v_key = 0;
   dawgdic::BaseType __pyx_v_index;
  *             return res
  * 
  *         self.completer.Start(index, b_prefix)             # <<<<<<<<<<<<<<
+ * 
  *         while self.completer.Next():
- *             key = (<char*>self.completer.key()).decode('utf8')
  */
   __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_b_prefix)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_self->completer->Start(__pyx_v_index, __pyx_t_6);
 
-  /* "dawg.pyx":291
- * 
+  /* "dawg.pyx":292
  *         self.completer.Start(index, b_prefix)
+ * 
  *         while self.completer.Next():             # <<<<<<<<<<<<<<
  *             key = (<char*>self.completer.key()).decode('utf8')
  *             res.append(key)
     __pyx_t_5 = __pyx_v_self->completer->Next();
     if (!__pyx_t_5) break;
 
-    /* "dawg.pyx":292
- *         self.completer.Start(index, b_prefix)
+    /* "dawg.pyx":293
+ * 
  *         while self.completer.Next():
  *             key = (<char*>self.completer.key()).decode('utf8')             # <<<<<<<<<<<<<<
  *             res.append(key)
  * 
  */
     __pyx_t_6 = ((char *)__pyx_v_self->completer->key());
-    __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_t_6, 0, strlen(__pyx_t_6), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_t_6, 0, strlen(__pyx_t_6), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_1)))||((((PyObject *)__pyx_t_1)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_1)))||((((PyObject *)__pyx_t_1)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_INCREF(__pyx_t_1);
     __Pyx_XDECREF(((PyObject *)__pyx_v_key));
     __pyx_v_key = ((PyObject*)__pyx_t_1);
     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
-    /* "dawg.pyx":293
+    /* "dawg.pyx":294
  *         while self.completer.Next():
  *             key = (<char*>self.completer.key()).decode('utf8')
  *             res.append(key)             # <<<<<<<<<<<<<<
  * 
  *         return res
  */
-    __pyx_t_7 = PyList_Append(__pyx_v_res, ((PyObject *)__pyx_v_key)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "dawg.pyx":295
+    __pyx_t_7 = PyList_Append(__pyx_v_res, ((PyObject *)__pyx_v_key)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+
+  /* "dawg.pyx":296
  *             res.append(key)
  * 
  *         return res             # <<<<<<<<<<<<<<
   {
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__prefix,0};
     PyObject* values[1] = {0};
-    values[0] = ((PyObject*)__pyx_kp_u_9);
+    values[0] = ((PyObject*)__pyx_kp_u_11);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
 }
 
 /* "dawg.pyx":281
- *         del self.completer
+ *             del self.completer
  * 
  *     cpdef list keys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
  *         cdef bytes b_prefix = prefix.encode('utf8')
   {
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__prefix,0};
     PyObject* values[1] = {0};
-    values[0] = ((PyObject*)__pyx_kp_u_9);
+    values[0] = ((PyObject*)__pyx_kp_u_11);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterkeys") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("iterkeys", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), (&PyUnicode_Type), 1, "prefix", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_6iterkeys(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), __pyx_v_prefix);
   goto __pyx_L0;
   __pyx_L1_error:;
   return __pyx_r;
 }
 
-/* "dawg.pyx":297
+/* "dawg.pyx":298
  *         return res
  * 
  *     def iterkeys(self, unicode prefix=""):             # <<<<<<<<<<<<<<
     return NULL;
   }
   __Pyx_GOTREF(__pyx_cur_scope);
-  __Pyx_TraceCall("iterkeys", __pyx_f[0], 297);
+  __Pyx_TraceCall("iterkeys", __pyx_f[0], 298);
   __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix);
   {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4dawg_14CompletionDAWG_8generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4dawg_14CompletionDAWG_8generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "dawg.pyx":298
+  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "dawg.pyx":299
  * 
  *     def iterkeys(self, unicode prefix=""):
  *         cdef bytes b_prefix = prefix.encode('utf8')             # <<<<<<<<<<<<<<
  */
   if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_prefix) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_1 = ((PyObject *)PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_t_1 = ((PyObject *)PyUnicode_AsUTF8String(__pyx_cur_scope->__pyx_v_prefix)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  if (!(likely(PyBytes_CheckExact(((PyObject *)__pyx_t_1)))||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(PyBytes_CheckExact(((PyObject *)__pyx_t_1)))||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_b_prefix = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "dawg.pyx":300
+  /* "dawg.pyx":301
  *         cdef bytes b_prefix = prefix.encode('utf8')
  *         cdef unicode key
  *         cdef BaseType index = self.dct.root()             # <<<<<<<<<<<<<<
  */
   __pyx_cur_scope->__pyx_v_index = __pyx_cur_scope->__pyx_v_self->__pyx_base.dct.root();
 
-  /* "dawg.pyx":302
+  /* "dawg.pyx":303
  *         cdef BaseType index = self.dct.root()
  * 
  *         if not self.dct.Follow(b_prefix, &index):             # <<<<<<<<<<<<<<
  *             return
  * 
  */
-  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_cur_scope->__pyx_v_b_prefix)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_cur_scope->__pyx_v_b_prefix)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __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)));
   if (__pyx_t_3) {
 
-    /* "dawg.pyx":303
+    /* "dawg.pyx":304
  * 
  *         if not self.dct.Follow(b_prefix, &index):
  *             return             # <<<<<<<<<<<<<<
   }
   __pyx_L4:;
 
-  /* "dawg.pyx":305
+  /* "dawg.pyx":306
  *             return
  * 
  *         self.completer.Start(index, b_prefix)             # <<<<<<<<<<<<<<
  *         while self.completer.Next():
  *             key = (<char*>self.completer.key()).decode('utf8')
  */
-  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_cur_scope->__pyx_v_b_prefix)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_cur_scope->__pyx_v_b_prefix)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_cur_scope->__pyx_v_self->completer->Start(__pyx_cur_scope->__pyx_v_index, __pyx_t_4);
 
-  /* "dawg.pyx":306
+  /* "dawg.pyx":307
  * 
  *         self.completer.Start(index, b_prefix)
  *         while self.completer.Next():             # <<<<<<<<<<<<<<
     __pyx_t_3 = __pyx_cur_scope->__pyx_v_self->completer->Next();
     if (!__pyx_t_3) break;
 
-    /* "dawg.pyx":307
+    /* "dawg.pyx":308
  *         self.completer.Start(index, b_prefix)
  *         while self.completer.Next():
  *             key = (<char*>self.completer.key()).decode('utf8')             # <<<<<<<<<<<<<<
  * 
  */
     __pyx_t_4 = ((char *)__pyx_cur_scope->__pyx_v_self->completer->key());
-    __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_1)))||((((PyObject *)__pyx_t_1)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_1)))||((((PyObject *)__pyx_t_1)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_1))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_INCREF(__pyx_t_1);
     __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
     __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
     __pyx_cur_scope->__pyx_v_key = ((PyObject*)__pyx_t_1);
     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
-    /* "dawg.pyx":308
+    /* "dawg.pyx":309
  *         while self.completer.Next():
  *             key = (<char*>self.completer.key()).decode('utf8')
  *             yield key             # <<<<<<<<<<<<<<
     __pyx_generator->resume_label = 1;
     return __pyx_r;
     __pyx_L7_resume_from_yield:;
-    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   PyErr_SetNone(PyExc_StopIteration);
   goto __pyx_L0;
   return NULL;
 }
 
-/* "dawg.pyx":311
+/* "dawg.pyx":312
  * 
  * 
  *     cpdef bytes tobytes(self) except +:             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("tobytes", 0);
-  __Pyx_TraceCall("tobytes", __pyx_f[0], 311);
+  __Pyx_TraceCall("tobytes", __pyx_f[0], 312);
   /* Check if called by wrapper */
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overriden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__tobytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__tobytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_4dawg_14CompletionDAWG_10tobytes)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
-      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __pyx_r = ((PyObject*)__pyx_t_2);
       __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "dawg.pyx":316
+  /* "dawg.pyx":317
  *         """
  *         cdef stringstream stream
  *         self.dct.Write(<ostream *> &stream)             # <<<<<<<<<<<<<<
  *         self.guide.Write(<ostream *> &stream)
  *         cdef bytes res = stream.str()
  */
-  try {__pyx_t_3 = __pyx_v_self->__pyx_base.dct.Write(((std::ostream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
-
-  /* "dawg.pyx":317
+  try {__pyx_t_3 = __pyx_v_self->__pyx_base.dct.Write(((std::ostream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+
+  /* "dawg.pyx":318
  *         cdef stringstream stream
  *         self.dct.Write(<ostream *> &stream)
  *         self.guide.Write(<ostream *> &stream)             # <<<<<<<<<<<<<<
  */
   __pyx_v_self->guide.Write(((std::ostream *)(&__pyx_v_stream)));
 
-  /* "dawg.pyx":318
+  /* "dawg.pyx":319
  *         self.dct.Write(<ostream *> &stream)
  *         self.guide.Write(<ostream *> &stream)
  *         cdef bytes res = stream.str()             # <<<<<<<<<<<<<<
  *         return res
  * 
  */
-  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_convert_string_to_py_(__pyx_v_stream.str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __pyx_v_res = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "dawg.pyx":319
+  /* "dawg.pyx":320
  *         self.guide.Write(<ostream *> &stream)
  *         cdef bytes res = stream.str()
  *         return res             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "dawg.pyx":311
+/* "dawg.pyx":312
  * 
  * 
  *     cpdef bytes tobytes(self) except +:             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("tobytes", 0);
-  __Pyx_TraceCall("tobytes", __pyx_f[0], 311);
+  __Pyx_TraceCall("tobytes", __pyx_f[0], 312);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4dawg_CompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.tobytes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4dawg_CompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.tobytes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   return __pyx_r;
 }
 
-/* "dawg.pyx":321
+/* "dawg.pyx":322
  *         return res
  * 
  *     cpdef frombytes(self, bytes data):             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("frombytes", 0);
-  __Pyx_TraceCall("frombytes", __pyx_f[0], 321);
+  __Pyx_TraceCall("frombytes", __pyx_f[0], 322);
   /* Check if called by wrapper */
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overriden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__frombytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__frombytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_4dawg_14CompletionDAWG_12frombytes)) {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_INCREF(((PyObject *)__pyx_v_data));
       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_data));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
-      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_3;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "dawg.pyx":328
+  /* "dawg.pyx":329
  *         loaded using frombytes vs load).
  *         """
  *         cdef char* c_data = data             # <<<<<<<<<<<<<<
  *         cdef stringstream stream
  *         stream.write(c_data, len(data))
  */
-  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_c_data = __pyx_t_4;
 
-  /* "dawg.pyx":330
+  /* "dawg.pyx":331
  *         cdef char* c_data = data
  *         cdef stringstream stream
  *         stream.write(c_data, len(data))             # <<<<<<<<<<<<<<
  */
   if (unlikely(((PyObject *)__pyx_v_data) == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_5 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_t_5 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_stream.write(__pyx_v_c_data, __pyx_t_5);
 
-  /* "dawg.pyx":331
+  /* "dawg.pyx":332
  *         cdef stringstream stream
  *         stream.write(c_data, len(data))
  *         stream.seekg(0)             # <<<<<<<<<<<<<<
  */
   __pyx_v_stream.seekg(0);
 
-  /* "dawg.pyx":333
+  /* "dawg.pyx":334
  *         stream.seekg(0)
  * 
  *         res = self.dct.Read(<istream*> &stream)             # <<<<<<<<<<<<<<
  *         if not res:
  *             self.dct.Clear()
  */
-  try {__pyx_t_6 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+  try {__pyx_t_6 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
   __pyx_v_res = __pyx_t_6;
 
-  /* "dawg.pyx":334
+  /* "dawg.pyx":335
  * 
  *         res = self.dct.Read(<istream*> &stream)
  *         if not res:             # <<<<<<<<<<<<<<
   __pyx_t_6 = (!__pyx_v_res);
   if (__pyx_t_6) {
 
-    /* "dawg.pyx":335
+    /* "dawg.pyx":336
  *         res = self.dct.Read(<istream*> &stream)
  *         if not res:
  *             self.dct.Clear()             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->__pyx_base.dct.Clear();
 
-    /* "dawg.pyx":336
+    /* "dawg.pyx":337
  *         if not res:
  *             self.dct.Clear()
  *             raise IOError("Invalid data format: can't load _dawg.Dictionary")             # <<<<<<<<<<<<<<
  * 
  *         res = self.guide.Read(<istream*> &stream)
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L3;
   }
   __pyx_L3:;
 
-  /* "dawg.pyx":338
+  /* "dawg.pyx":339
  *             raise IOError("Invalid data format: can't load _dawg.Dictionary")
  * 
  *         res = self.guide.Read(<istream*> &stream)             # <<<<<<<<<<<<<<
  */
   __pyx_v_res = __pyx_v_self->guide.Read(((std::istream *)(&__pyx_v_stream)));
 
-  /* "dawg.pyx":339
+  /* "dawg.pyx":340
  * 
  *         res = self.guide.Read(<istream*> &stream)
  *         if not res:             # <<<<<<<<<<<<<<
   __pyx_t_6 = (!__pyx_v_res);
   if (__pyx_t_6) {
 
-    /* "dawg.pyx":340
+    /* "dawg.pyx":341
  *         res = self.guide.Read(<istream*> &stream)
  *         if not res:
  *             self.guide.Clear()             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->guide.Clear();
 
-    /* "dawg.pyx":341
+    /* "dawg.pyx":342
  *         if not res:
  *             self.guide.Clear()
  *             self.dct.Clear()             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->__pyx_base.dct.Clear();
 
-    /* "dawg.pyx":342
+    /* "dawg.pyx":343
  *             self.guide.Clear()
  *             self.dct.Clear()
  *             raise IOError("Invalid data format: can't load _dawg.Guide")             # <<<<<<<<<<<<<<
  * 
  *         if self.completer:
  */
-    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L4;
   }
   __pyx_L4:;
 
-  /* "dawg.pyx":344
+  /* "dawg.pyx":345
  *             raise IOError("Invalid data format: can't load _dawg.Guide")
  * 
  *         if self.completer:             # <<<<<<<<<<<<<<
   __pyx_t_6 = (__pyx_v_self->completer != 0);
   if (__pyx_t_6) {
 
-    /* "dawg.pyx":345
+    /* "dawg.pyx":346
  * 
  *         if self.completer:
  *             del self.completer             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "dawg.pyx":346
+  /* "dawg.pyx":347
  *         if self.completer:
  *             del self.completer
  *         self.completer = new Completer(self.dct, self.guide)             # <<<<<<<<<<<<<<
  */
   __pyx_v_self->completer = new dawgdic::Completer(__pyx_v_self->__pyx_base.dct, __pyx_v_self->guide);
 
-  /* "dawg.pyx":348
+  /* "dawg.pyx":349
  *         self.completer = new Completer(self.dct, self.guide)
  * 
  *         return self             # <<<<<<<<<<<<<<
   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_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_4dawg_14CompletionDAWG_11frombytes(((struct __pyx_obj_4dawg_CompletionDAWG *)__pyx_v_self), ((PyObject*)__pyx_v_data));
   goto __pyx_L0;
   __pyx_L1_error:;
   return __pyx_r;
 }
 
-/* "dawg.pyx":321
+/* "dawg.pyx":322
  *         return res
  * 
  *     cpdef frombytes(self, bytes data):             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("frombytes", 0);
-  __Pyx_TraceCall("frombytes", __pyx_f[0], 321);
+  __Pyx_TraceCall("frombytes", __pyx_f[0], 322);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_CompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.frombytes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4dawg_CompletionDAWG *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.frombytes(((struct __pyx_obj_4dawg_DAWG *)__pyx_v_self), __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   return __pyx_r;
 }
 
-/* "dawg.pyx":351
+/* "dawg.pyx":352
  * 
  * 
  *     def load(self, path):             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("load", 0);
-  __Pyx_TraceCall("load", __pyx_f[0], 351);
+  __Pyx_TraceCall("load", __pyx_f[0], 352);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "dawg.pyx":355
+  /* "dawg.pyx":356
  *         Loads DAWG from a file.
  *         """
  *         if isinstance(path, unicode):             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "dawg.pyx":356
+    /* "dawg.pyx":357
  *         """
  *         if isinstance(path, unicode):
  *             path = path.encode(sys.getfilesystemencoding())             # <<<<<<<<<<<<<<
  * 
  *         cdef ifstream stream
  */
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_path, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_v_path, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   }
   __pyx_L3:;
 
-  /* "dawg.pyx":359
+  /* "dawg.pyx":360
  * 
  *         cdef ifstream stream
  *         stream.open(path, iostream.binary)             # <<<<<<<<<<<<<<
  * 
  *         try:
  */
-  __pyx_t_5 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  try {__pyx_v_stream.open(__pyx_t_5, std::stringstream::binary);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
-
-  /* "dawg.pyx":361
+  __pyx_t_5 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  try {__pyx_v_stream.open(__pyx_t_5, std::stringstream::binary);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+
+  /* "dawg.pyx":362
  *         stream.open(path, iostream.binary)
  * 
  *         try:             # <<<<<<<<<<<<<<
  */
   /*try:*/ {
 
-    /* "dawg.pyx":362
+    /* "dawg.pyx":363
  * 
  *         try:
  *             res = self.dct.Read(<istream*> &stream)             # <<<<<<<<<<<<<<
  *             if not res:
  *                 self.dct.Clear()
  */
-    try {__pyx_t_2 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L5;}}
+    try {__pyx_t_2 = __pyx_v_self->__pyx_base.dct.Read(((std::istream *)(&__pyx_v_stream)));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L5;}}
     __pyx_v_res = __pyx_t_2;
 
-    /* "dawg.pyx":363
+    /* "dawg.pyx":364
  *         try:
  *             res = self.dct.Read(<istream*> &stream)
  *             if not res:             # <<<<<<<<<<<<<<
     __pyx_t_2 = (!__pyx_v_res);
     if (__pyx_t_2) {
 
-      /* "dawg.pyx":364
+      /* "dawg.pyx":365
  *             res = self.dct.Read(<istream*> &stream)
  *             if not res:
  *                 self.dct.Clear()             # <<<<<<<<<<<<<<
  */
       __pyx_v_self->__pyx_base.dct.Clear();
 
-      /* "dawg.pyx":365
+      /* "dawg.pyx":366
  *             if not res:
  *                 self.dct.Clear()
  *                 raise IOError("Invalid data format: can't load _dawg.Dictionary")             # <<<<<<<<<<<<<<
  * 
  *             res = self.guide.Read(<istream*> &stream)
  */
-      __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L5;}
+      __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L5;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L5;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L5;}
       goto __pyx_L7;
     }
     __pyx_L7:;
 
-    /* "dawg.pyx":367
+    /* "dawg.pyx":368
  *                 raise IOError("Invalid data format: can't load _dawg.Dictionary")
  * 
  *             res = self.guide.Read(<istream*> &stream)             # <<<<<<<<<<<<<<
  */
     __pyx_v_res = __pyx_v_self->guide.Read(((std::istream *)(&__pyx_v_stream)));
 
-    /* "dawg.pyx":368
+    /* "dawg.pyx":369
  * 
  *             res = self.guide.Read(<istream*> &stream)
  *             if not res:             # <<<<<<<<<<<<<<
     __pyx_t_2 = (!__pyx_v_res);
     if (__pyx_t_2) {
 
-      /* "dawg.pyx":369
+      /* "dawg.pyx":370
  *             res = self.guide.Read(<istream*> &stream)
  *             if not res:
  *                 self.guide.Clear()             # <<<<<<<<<<<<<<
  */
       __pyx_v_self->guide.Clear();
 
-      /* "dawg.pyx":370
+      /* "dawg.pyx":371
  *             if not res:
  *                 self.guide.Clear()
  *                 self.dct.Clear()             # <<<<<<<<<<<<<<
  */
       __pyx_v_self->__pyx_base.dct.Clear();
 
-      /* "dawg.pyx":371
+      /* "dawg.pyx":372
  *                 self.guide.Clear()
  *                 self.dct.Clear()
  *                 raise IOError("Invalid data format: can't load _dawg.Guide")             # <<<<<<<<<<<<<<
  * 
  *             if self.completer:
  */
-      __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L5;}
+      __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L5;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L5;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L5;}
       goto __pyx_L8;
     }
     __pyx_L8:;
 
-    /* "dawg.pyx":373
+    /* "dawg.pyx":374
  *                 raise IOError("Invalid data format: can't load _dawg.Guide")
  * 
  *             if self.completer:             # <<<<<<<<<<<<<<
     __pyx_t_2 = (__pyx_v_self->completer != 0);
     if (__pyx_t_2) {
 
-      /* "dawg.pyx":374
+      /* "dawg.pyx":375
  * 
  *             if self.completer:
  *                 del self.completer             # <<<<<<<<<<<<<<
     }
     __pyx_L9:;
 
-    /* "dawg.pyx":375
+    /* "dawg.pyx":376
  *             if self.completer:
  *                 del self.completer
  *             self.completer = new Completer(self.dct, self.guide)             # <<<<<<<<<<<<<<
     __pyx_v_self->completer = new dawgdic::Completer(__pyx_v_self->__pyx_base.dct, __pyx_v_self->guide);
   }
 
-  /* "dawg.pyx":378
+  /* "dawg.pyx":379
  * 
  *         finally:
  *             stream.close()             # <<<<<<<<<<<<<<
       goto __pyx_L6;
     }
     __pyx_L6:;
-    try {__pyx_v_stream.close();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L10_error;}}
+    try {__pyx_v_stream.close();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L10_error;}}
     goto __pyx_L11;
     __pyx_L10_error:;
     if (__pyx_why == 4) {
     }
   }
 
-  /* "dawg.pyx":380
+  /* "dawg.pyx":381
  *             stream.close()
  * 
  *         return self             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "dawg.pyx":382
+/* "dawg.pyx":383
  *         return self
  * 
  *     def _transitions(self):             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_TraceDeclarations
   __Pyx_RefNannySetupContext("_transitions", 0);
-  __Pyx_TraceCall("_transitions", __pyx_f[0], 382);
-
-  /* "dawg.pyx":383
+  __Pyx_TraceCall("_transitions", __pyx_f[0], 383);
+
+  /* "dawg.pyx":384
  * 
  *     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_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __pyx_v_transitions = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "dawg.pyx":387
+  /* "dawg.pyx":388
  *         cdef char* key
  * 
  *         self.completer.Start(self.dct.root())             # <<<<<<<<<<<<<<
  */
   __pyx_v_self->completer->Start(__pyx_v_self->__pyx_base.dct.root());
 
-  /* "dawg.pyx":388
+  /* "dawg.pyx":389
  * 
  *         self.completer.Start(self.dct.root())
  *         while self.completer.Next():             # <<<<<<<<<<<<<<
     __pyx_t_2 = __pyx_v_self->completer->Next();
     if (!__pyx_t_2) break;
 
-    /* "dawg.pyx":389
+    /* "dawg.pyx":390
  *         self.completer.Start(self.dct.root())
  *         while self.completer.Next():
  *             key = <char*>self.completer.key()             # <<<<<<<<<<<<<<
  */
     __pyx_v_key = ((char *)__pyx_v_self->completer->key());
 
-    /* "dawg.pyx":391
+    /* "dawg.pyx":392
  *             key = <char*>self.completer.key()
  * 
  *             index = self.dct.root()             # <<<<<<<<<<<<<<
  */
     __pyx_v_index = __pyx_v_self->__pyx_base.dct.root();
 
-    /* "dawg.pyx":393
+    /* "dawg.pyx":394
  *             index = self.dct.root()
  * 
  *             for i in range(self.completer.length()):             # <<<<<<<<<<<<<<
     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
       __pyx_v_i = __pyx_t_4;
 
-      /* "dawg.pyx":394
+      /* "dawg.pyx":395
  * 
  *             for i in range(self.completer.length()):
  *                 prev_index = index             # <<<<<<<<<<<<<<
  */
       __pyx_v_prev_index = __pyx_v_index;
 
-      /* "dawg.pyx":395
+      /* "dawg.pyx":396
  *             for i in range(self.completer.length()):
  *                 prev_index = index
  *                 self.dct.Follow(&(key[i]), 1, &index)             # <<<<<<<<<<<<<<
  */
       __pyx_v_self->__pyx_base.dct.Follow((&(__pyx_v_key[__pyx_v_i])), 1, (&__pyx_v_index));
 
-      /* "dawg.pyx":397
+      /* "dawg.pyx":398
  *                 self.dct.Follow(&(key[i]), 1, &index)
  *                 transitions.add(
  *                     (prev_index, <unsigned char>key[i], index)             # <<<<<<<<<<<<<<
  *                 )
  * 
  */
-      __pyx_t_1 = __Pyx_PyInt_to_py_dawgdic__BaseType(__pyx_v_prev_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = __Pyx_PyInt_to_py_dawgdic__BaseType(__pyx_v_prev_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = PyInt_FromLong(((unsigned char)(__pyx_v_key[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(((unsigned char)(__pyx_v_key[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = __Pyx_PyInt_to_py_dawgdic__BaseType(__pyx_v_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = __Pyx_PyInt_to_py_dawgdic__BaseType(__pyx_v_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_7);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
       __Pyx_GIVEREF(__pyx_t_1);
       __pyx_t_1 = 0;
       __pyx_t_5 = 0;
       __pyx_t_6 = 0;
-      __pyx_t_8 = PySet_Add(__pyx_v_transitions, ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = PySet_Add(__pyx_v_transitions, ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
     }
   }
 
-  /* "dawg.pyx":400
+  /* "dawg.pyx":401
  *                 )
  * 
  *         return sorted(list(transitions))             # <<<<<<<<<<<<<<
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(((PyObject *)__pyx_v_transitions));
   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_transitions));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_transitions));
-  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_7);
   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_6 = 0;
-  __pyx_t_6 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
   __pyx_r = __pyx_t_6;
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arg,&__pyx_n_s__input_is_sorted,0};
     PyObject* values[2] = {0,0};
 
-    /* "dawg.pyx":417
+    /* "dawg.pyx":418
  *     """
  * 
  *     def __init__(self, arg=None, input_is_sorted=False):             # <<<<<<<<<<<<<<
  *         ``arg`` must be an iterable of tuples (unicode_key, bytes_payload).
  */
     values[0] = ((PyObject *)Py_None);
-    values[1] = __pyx_k_25;
+    values[1] = __pyx_k_27;
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("dawg.BytesDAWG.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
 }
 static PyObject *__pyx_gb_4dawg_9BytesDAWG_8__init___2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
 
-/* "dawg.pyx":424
+/* "dawg.pyx":425
  *             arg = []
  * 
  *         keys = (self._raw_key(d[0], d[1]) for d in arg)             # <<<<<<<<<<<<<<
   __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4dawg___pyx_scope_struct_4___init__ *) __pyx_self;
   __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
-  __Pyx_TraceCall("genexpr", __pyx_f[0], 424);
+  __Pyx_TraceCall("genexpr", __pyx_f[0], 425);
   {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4dawg_9BytesDAWG_8__init___2generator6, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4dawg_9BytesDAWG_8__init___2generator6, (PyObject *) __pyx_cu