From 7b9d919569b6e9f6ce901544c1ab21c7ba7298a2 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Thu, 2 Aug 2012 14:50:40 +0600 Subject: [PATCH] dstring module from the datrie --- libdatrie/datrie/Makefile.am | 2 + libdatrie/datrie/darray.c | 51 ++- libdatrie/datrie/darray.h | 6 +- libdatrie/datrie/dstring.c | 169 ++++++++++ libdatrie/datrie/dstring.h | 59 ++++ libdatrie/datrie/trie.c | 62 ++-- libdatrie/datrie/trie.h | 2 +- setup.py | 2 +- src/cdatrie.c | 2 +- src/datrie.c | 633 ++++++++++++++++++----------------- src/stdio_ext.c | 2 +- 11 files changed, 625 insertions(+), 365 deletions(-) create mode 100644 libdatrie/datrie/dstring.c create mode 100644 libdatrie/datrie/dstring.h diff --git a/libdatrie/datrie/Makefile.am b/libdatrie/datrie/Makefile.am index d40d582..6d27d01 100644 --- a/libdatrie/datrie/Makefile.am +++ b/libdatrie/datrie/Makefile.am @@ -16,6 +16,8 @@ libdatrie_la_SOURCES = \ typedefs.h \ triedefs.h \ trie-private.h \ + dstring.h \ + dstring.c \ fileutils.h \ fileutils.c \ darray.h \ diff --git a/libdatrie/datrie/darray.c b/libdatrie/datrie/darray.c index f2ff92f..dfce1c6 100644 --- a/libdatrie/datrie/darray.c +++ b/libdatrie/datrie/darray.c @@ -538,53 +538,51 @@ da_output_symbols (const DArray *d, * @param d : the double-array structure * @param from : the node to walk from * @param to : the node to walk to + * @param res_key : the storage for storing the result * - * @return the allocated key string + * @return boolean indicating success * * Get key for walking from state @a from to state @a to, assuming @a from - * is an ancester node of @a to. + * is an ancester node of @a to, and copy it to @a res_key dynamic string. * - * The return string must be freed with free(). + * The @a res_key is assumed to be constructed with + * char_size == sizeof (TrieChar). * * Available since: 0.2.6 */ -TrieChar * +Bool da_get_transition_key (const DArray *d, TrieIndex from, - TrieIndex to) + TrieIndex to, + DString *res_key) { TrieChar *key; - int key_size, key_length; + int key_length; int i; - key_size = 20; - key_length = 0; - key = (TrieChar *) malloc (key_size); + dstring_clear (res_key); /* trace back to root */ while (to != from) { - TrieIndex parent; - - if (key_length + 1 >= key_size) { - key_size += 20; - key = (TrieChar *) realloc (key, key_size); - } - parent = da_get_check (d, to); - key[key_length++] = (TrieChar) (to - da_get_base (d, parent)); + TrieIndex parent = da_get_check (d, to); + TrieChar tc = (TrieChar )(to - da_get_base (d, parent)); + if (!dstring_append_char (res_key, &tc)) + return FALSE; to = parent; } - key[key_length] = '\0'; + if (!dstring_terminate (res_key)) + return FALSE; /* reverse the string */ + key = dstring_get_val_rw (res_key); + key_length = dstring_length (res_key); for (i = 0; i < --key_length; i++) { - TrieChar temp; - - temp = key[i]; + TrieChar temp = key[i]; key[i] = key[key_length]; key[key_length] = temp; } - return key; + return TRUE; } static TrieIndex @@ -835,11 +833,10 @@ da_enumerate_recursive (const DArray *d, base = da_get_base (d, state); if (base < 0) { - TrieChar *key; - - key = da_get_transition_key (d, da_get_root (d), state); - ret = (*enum_func) (key, state, user_data); - free (key); + DString *key = dstring_new (sizeof (TrieChar), 20); + da_get_transition_key (d, da_get_root (d), state, key); + ret = (*enum_func) (dstring_get_val (key), state, user_data); + dstring_free (key); } else { Symbols *symbols; int i; diff --git a/libdatrie/datrie/darray.h b/libdatrie/datrie/darray.h index 0c84a0d..50adf19 100644 --- a/libdatrie/datrie/darray.h +++ b/libdatrie/datrie/darray.h @@ -28,6 +28,7 @@ #define __DARRAY_H #include "triedefs.h" +#include "dstring.h" /** * @file darray.h @@ -89,9 +90,10 @@ Bool da_walk (const DArray *d, TrieIndex *s, TrieChar c); Symbols * da_output_symbols (const DArray *d, TrieIndex s); -TrieChar * da_get_transition_key (const DArray *d, +Bool da_get_transition_key (const DArray *d, TrieIndex from, - TrieIndex to); + TrieIndex to, + DString *res_key); /** * @brief Test walkability in double-array structure diff --git a/libdatrie/datrie/dstring.c b/libdatrie/datrie/dstring.c new file mode 100644 index 0000000..b2f1c3a --- /dev/null +++ b/libdatrie/datrie/dstring.c @@ -0,0 +1,169 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * libdatrie - Double-Array Trie Library + * Copyright (C) 2006 Theppitak Karoonboonyanan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * dstring.c - Dynamic string type + * Created: 2012-08-01 + * Author: Theppitak Karoonboonyanan + */ + +#include "dstring.h" + +#include "trie-private.h" +#include +#include + +struct _DString { + int char_size; + int str_len; + int alloc_size; + void * val; +}; + + +DString * +dstring_new (int char_size, int n_elm) +{ + DString *ds; + + ds = (DString *) malloc (sizeof (DString)); + if (!ds) + return NULL; + + ds->alloc_size = char_size * n_elm; + ds->val = malloc (ds->alloc_size); + if (!ds->val) { + free (ds); + return NULL; + } + + ds->char_size = char_size; + ds->str_len = 0; + + return ds; +} + +void +dstring_free (DString *ds) +{ + free (ds->val); + free (ds); +} + +int +dstring_length (const DString *ds) +{ + return ds->str_len; +} + +const void * +dstring_get_val (const DString *ds) +{ + return ds->val; +} + +void * +dstring_get_val_rw (DString *ds) +{ + return ds->val; +} + +void +dstring_clear (DString *ds) +{ + ds->str_len = 0; +} + +static Bool +dstring_ensure_space (DString *ds, int size) +{ + if (ds->alloc_size < size) { + int re_size = MAX_VAL (ds->alloc_size * 2, size); + void *re_ptr = realloc (ds->val, re_size); + if (!re_ptr) + return FALSE; + ds->val = re_ptr; + ds->alloc_size = re_size; + } + + return TRUE; +} + +Bool +dstring_copy (DString *dst, const DString *src) +{ + if (!dstring_ensure_space (dst, (src->str_len + 1) * src->char_size)) + return FALSE; + + memcpy (dst->val, src->val, (src->str_len + 1) * src->char_size); + + dst->char_size = src->char_size; + dst->str_len = src->str_len; + + return TRUE; +} + +Bool +dstring_append (DString *dst, const DString *src) +{ + if (dst->char_size != src->char_size) + return FALSE; + + if (!dstring_ensure_space (dst, (dst->str_len + src->str_len + 1) + * dst->char_size)) + { + return FALSE; + } + + memcpy (dst->val + (dst->char_size * dst->str_len), src->val, + (src->str_len + 1) * dst->char_size); + + dst->str_len += src->str_len; + + return TRUE; +} + +Bool +dstring_append_char (DString *ds, const void *data) +{ + if (!dstring_ensure_space (ds, (ds->str_len + 2) * ds->char_size)) + return FALSE; + + memcpy (ds->val + (ds->char_size * ds->str_len), data, ds->char_size); + + ds->str_len++; + + return TRUE; +} + +Bool +dstring_terminate (DString *ds) +{ + if (!dstring_ensure_space (ds, (ds->str_len + 2) * ds->char_size)) + return FALSE; + + memset (ds->val + (ds->char_size * ds->str_len), 0, ds->char_size); + + return TRUE; +} + +/* +vi:ts=4:ai:expandtab +*/ diff --git a/libdatrie/datrie/dstring.h b/libdatrie/datrie/dstring.h new file mode 100644 index 0000000..226b79f --- /dev/null +++ b/libdatrie/datrie/dstring.h @@ -0,0 +1,59 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * libdatrie - Double-Array Trie Library + * Copyright (C) 2006 Theppitak Karoonboonyanan + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * dstring.h - Dynamic string type + * Created: 2012-08-01 + * Author: Theppitak Karoonboonyanan + */ + +#ifndef __DSTRING_H +#define __DSTRING_H + +#include "typedefs.h" + +typedef struct _DString DString; + +DString * dstring_new (int char_size, int n_elm); + +void dstring_free (DString *ds); + +int dstring_length (const DString *ds); + +const void * dstring_get_val (const DString *ds); + +void * dstring_get_val_rw (DString *ds); + +void dstring_clear (DString *ds); + +Bool dstring_copy (DString *dst, const DString *src); + +Bool dstring_append (DString *dst, const DString *src); + +Bool dstring_append_char (DString *ds, const void *data); + +Bool dstring_terminate (DString *ds); + + +#endif /* __DSTRING_H */ + +/* +vi:ts=4:ai:expandtab +*/ diff --git a/libdatrie/datrie/trie.c b/libdatrie/datrie/trie.c index e96bd85..452f4c4 100644 --- a/libdatrie/datrie/trie.c +++ b/libdatrie/datrie/trie.c @@ -33,6 +33,7 @@ #include "alpha-map-private.h" #include "darray.h" #include "tail.h" +#include "dstring.h" /** * @brief Trie structure @@ -61,6 +62,7 @@ struct _TrieState { struct _TrieIterator { const TrieState *root; /**< the state to start iteration from */ TrieState *state; /**< the current state */ + DString *key; /**< buffer for calculating the entry key */ }; @@ -946,6 +948,7 @@ trie_iterator_new (TrieState *s) iter->root = s; iter->state = NULL; + iter->key = NULL; return iter; } @@ -965,6 +968,9 @@ trie_iterator_free (TrieIterator *iter) if (iter->state) { trie_state_free (iter->state); } + if (iter->key) { + dstring_free (iter->key); + } free (iter); } @@ -1021,7 +1027,7 @@ trie_iterator_next (TrieIterator *iter) * * @param iter : an iterator * - * @return the allocated key string + * @return the allocated key string; NULL on failure * * Get key for the current entry referenced by the trie iterator @a iter. * @@ -1030,57 +1036,55 @@ trie_iterator_next (TrieIterator *iter) * Available since: 0.2.6 */ AlphaChar * -trie_iterator_get_key (const TrieIterator *iter) +trie_iterator_get_key (TrieIterator *iter) { const TrieState *s; - TrieChar *trie_str; const TrieChar *tail_str; - AlphaChar *alpha_key; s = iter->state; if (!s) return NULL; + if (!iter->key) { + iter->key = dstring_new (sizeof (TrieChar), 20); + } + dstring_clear (iter->key); + /* if s is in tail, root == s */ if (s->is_suffix) { tail_str = tail_get_suffix (s->trie->tail, s->index); - trie_str = (TrieChar *) malloc (strlen (tail_str) - s->suffix_idx + 1); - if (!trie_str) - return NULL; - strcpy (trie_str, tail_str + s->suffix_idx); + tail_str += s->suffix_idx; } else { TrieIndex tail_idx; - TrieChar *re_str; /* get key from branching zone */ - trie_str = da_get_transition_key (s->trie->da, - iter->root->index, s->index); - if (!trie_str) + if (!da_get_transition_key (s->trie->da, + iter->root->index, s->index, + iter->key)) + { return NULL; + } - /* get key from tail zone */ + /* prepare the tail string */ tail_idx = trie_da_get_tail_index (s->trie->da, s->index); tail_str = tail_get_suffix (s->trie->tail, tail_idx); - if (!tail_str) - goto error_trie_str_created; - - /* append tail string */ - re_str = (TrieChar *) realloc (trie_str, - strlen (trie_str) + strlen (tail_str) + 1); - if (!re_str) - goto error_trie_str_created; - trie_str = re_str; - strcat (trie_str, tail_str); } - alpha_key = alpha_map_trie_to_char_str (s->trie->alpha_map, trie_str); + if (!tail_str) + return NULL; - free (trie_str); - return alpha_key; + /* append tail string */ + while (*tail_str) { + if (!dstring_append_char (iter->key, tail_str++)) + return NULL; + } + if (!dstring_terminate (iter->key)) + return NULL; -error_trie_str_created: - free (trie_str); - return NULL; + return alpha_map_trie_to_char_str ( + s->trie->alpha_map, + (const TrieChar *) dstring_get_val (iter->key) + ); } /** diff --git a/libdatrie/datrie/trie.h b/libdatrie/datrie/trie.h index 49bd3a7..3292196 100644 --- a/libdatrie/datrie/trie.h +++ b/libdatrie/datrie/trie.h @@ -176,7 +176,7 @@ void trie_iterator_free (TrieIterator *iter); Bool trie_iterator_next (TrieIterator *iter); -AlphaChar * trie_iterator_get_key (const TrieIterator *iter); +AlphaChar * trie_iterator_get_key (TrieIterator *iter); TrieData trie_iterator_get_data (const TrieIterator *iter); diff --git a/setup.py b/setup.py index 2c4a8cc..871f3f3 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ LIBDATRIE_DIR = 'libdatrie/datrie' LIBDATRIE_FILE_NAMES = [ - 'alpha-map.c', 'darray.c', 'fileutils.c', 'tail.c', 'trie.c', + 'alpha-map.c', 'darray.c', 'fileutils.c', 'tail.c', 'trie.c', 'dstring.c', ] LIBDATRIE_FILES = [os.path.join(LIBDATRIE_DIR, name) for name in LIBDATRIE_FILE_NAMES] diff --git a/src/cdatrie.c b/src/cdatrie.c index cbac9a4..d35f589 100644 --- a/src/cdatrie.c +++ b/src/cdatrie.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17.beta1 on Wed Aug 1 04:17:47 2012 */ +/* Generated by Cython 0.17.beta1 on Thu Aug 2 14:37:53 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff --git a/src/datrie.c b/src/datrie.c index 67b0fbe..60b1228 100644 --- a/src/datrie.c +++ b/src/datrie.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17.beta1 on Wed Aug 1 04:17:46 2012 */ +/* Generated by Cython 0.17.beta1 on Thu Aug 2 14:37:53 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -463,7 +463,7 @@ struct __pyx_opt_args_6datrie_4Trie_values { PyObject *prefix; }; -/* "datrie.pyx":872 +/* "datrie.pyx":869 * return data * * cdef unicode unicode_from_alpha_char(cdatrie.AlphaChar* key, int len=0): # <<<<<<<<<<<<<< @@ -490,7 +490,7 @@ struct __pyx_obj_6datrie__TrieIterator { }; -/* "datrie.pyx":739 +/* "datrie.pyx":736 * * * cdef class Iterator(_TrieIterator): # <<<<<<<<<<<<<< @@ -502,7 +502,7 @@ struct __pyx_obj_6datrie_Iterator { }; -/* "datrie.pyx":781 +/* "datrie.pyx":778 * # ============================ AlphaMap & utils ================================ * * cdef class AlphaMap: # <<<<<<<<<<<<<< @@ -543,7 +543,7 @@ struct __pyx_obj_6datrie_State { }; -/* "datrie.pyx":895 +/* "datrie.pyx":892 * yield b[0][1], b[-1][1] * * def alphabet_to_ranges(alphabet): # <<<<<<<<<<<<<< @@ -561,7 +561,7 @@ struct __pyx_obj_6datrie___pyx_scope_struct_4_alphabet_to_ranges { }; -/* "datrie.pyx":883 +/* "datrie.pyx":880 * * * def to_ranges(lst): # <<<<<<<<<<<<<< @@ -671,7 +671,7 @@ struct __pyx_obj_6datrie___pyx_scope_struct_1_iter_prefix_items { }; -/* "datrie.pyx":730 +/* "datrie.pyx":727 * * * cdef class BaseIterator(_TrieIterator): # <<<<<<<<<<<<<< @@ -711,7 +711,7 @@ struct __pyx_vtabstruct_6datrie__TrieIterator { static struct __pyx_vtabstruct_6datrie__TrieIterator *__pyx_vtabptr_6datrie__TrieIterator; -/* "datrie.pyx":739 +/* "datrie.pyx":736 * * * cdef class Iterator(_TrieIterator): # <<<<<<<<<<<<<< @@ -726,7 +726,7 @@ struct __pyx_vtabstruct_6datrie_Iterator { static struct __pyx_vtabstruct_6datrie_Iterator *__pyx_vtabptr_6datrie_Iterator; -/* "datrie.pyx":730 +/* "datrie.pyx":727 * * * cdef class BaseIterator(_TrieIterator): # <<<<<<<<<<<<<< @@ -776,7 +776,7 @@ struct __pyx_vtabstruct_6datrie_BaseState { static struct __pyx_vtabstruct_6datrie_BaseState *__pyx_vtabptr_6datrie_BaseState; -/* "datrie.pyx":781 +/* "datrie.pyx":778 * # ============================ AlphaMap & utils ================================ * * cdef class AlphaMap: # <<<<<<<<<<<<<< @@ -1356,7 +1356,7 @@ static char __pyx_k_18[] = "range begin > end"; static char __pyx_k_20[] = "datrie.new is deprecated; please use datrie.Trie."; static char __pyx_k_21[] = "\nCython wrapper for libdatrie.\n"; static char __pyx_k_24[] = "/Users/kmike/svn/datrie/src/datrie.pyx"; -static char __pyx_k_29[] = "to_ranges (line 883)"; +static char __pyx_k_29[] = "to_ranges (line 880)"; static char __pyx_k_30[] = "\n Converts a list of numbers to a list of ranges::\n\n >>> numbers = [1,2,3,5,6]\n >>> list(to_ranges(numbers))\n [(1, 3), (5, 6)]\n "; static char __pyx_k__a[] = "a"; static char __pyx_k__b[] = "b"; @@ -4397,8 +4397,8 @@ static PyObject *__pyx_pf_6datrie_8BaseTrie_34prefixes(struct __pyx_obj_6datrie_ __pyx_why = 3; goto __pyx_L6; __pyx_L5: { __pyx_why = 4; - __Pyx_XDECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; goto __pyx_L6; @@ -4710,10 +4710,10 @@ static PyObject *__pyx_f_6datrie_8BaseTrie__prefix_items(struct __pyx_obj_6datri __pyx_why = 3; goto __pyx_L6; __pyx_L5: { __pyx_why = 4; - __Pyx_XDECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; goto __pyx_L6; @@ -10846,13 +10846,12 @@ static PyObject *__pyx_pf_6datrie_13_TrieIterator_4next(struct __pyx_obj_6datrie * * cpdef unicode key(self): # <<<<<<<<<<<<<< * cdef cdatrie.AlphaChar* key = cdatrie.trie_iterator_get_key(self._iter) - * cdef unicode result = unicode_from_alpha_char(key) + * try: */ static PyObject *__pyx_pw_6datrie_13_TrieIterator_7key(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_6datrie_13_TrieIterator_key(struct __pyx_obj_6datrie__TrieIterator *__pyx_v_self, int __pyx_skip_dispatch) { AlphaChar *__pyx_v_key; - PyObject *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10884,43 +10883,72 @@ static PyObject *__pyx_f_6datrie_13_TrieIterator_key(struct __pyx_obj_6datrie__T * * cpdef unicode key(self): * cdef cdatrie.AlphaChar* key = cdatrie.trie_iterator_get_key(self._iter) # <<<<<<<<<<<<<< - * cdef unicode result = unicode_from_alpha_char(key) - * free(key) + * try: + * return unicode_from_alpha_char(key) */ __pyx_v_key = trie_iterator_get_key(__pyx_v_self->_iter); /* "datrie.pyx":721 * cpdef unicode key(self): * cdef cdatrie.AlphaChar* key = cdatrie.trie_iterator_get_key(self._iter) - * cdef unicode result = unicode_from_alpha_char(key) # <<<<<<<<<<<<<< - * free(key) - * return result + * try: # <<<<<<<<<<<<<< + * return unicode_from_alpha_char(key) + * finally: */ - __pyx_t_1 = ((PyObject *)__pyx_f_6datrie_unicode_from_alpha_char(__pyx_v_key, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_result = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + /*try:*/ { - /* "datrie.pyx":722 + /* "datrie.pyx":722 * cdef cdatrie.AlphaChar* key = cdatrie.trie_iterator_get_key(self._iter) - * cdef unicode result = unicode_from_alpha_char(key) - * free(key) # <<<<<<<<<<<<<< - * return result - * # try: + * try: + * return unicode_from_alpha_char(key) # <<<<<<<<<<<<<< + * finally: + * free(key) */ - free(__pyx_v_key); + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)__pyx_f_6datrie_unicode_from_alpha_char(__pyx_v_key, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L4;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L3; + } - /* "datrie.pyx":723 - * cdef unicode result = unicode_from_alpha_char(key) - * free(key) - * return result # <<<<<<<<<<<<<< - * # try: - * # return + /* "datrie.pyx":724 + * return unicode_from_alpha_char(key) + * finally: + * free(key) # <<<<<<<<<<<<<< + * + * */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = __pyx_v_result; - goto __pyx_L0; + /*finally:*/ { + int __pyx_why; + PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; + int __pyx_exc_lineno; + __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 0; goto __pyx_L5; + __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; + __pyx_why = 3; goto __pyx_L5; + __pyx_L4: { + __pyx_why = 4; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + __pyx_exc_lineno = __pyx_lineno; + goto __pyx_L5; + } + __pyx_L5:; + free(__pyx_v_key); + switch (__pyx_why) { + case 3: goto __pyx_L0; + case 4: { + __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + __pyx_lineno = __pyx_exc_lineno; + __pyx_exc_type = 0; + __pyx_exc_value = 0; + __pyx_exc_tb = 0; + goto __pyx_L1_error; + } + } + } __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -10930,7 +10958,6 @@ static PyObject *__pyx_f_6datrie_13_TrieIterator_key(struct __pyx_obj_6datrie__T __Pyx_AddTraceback("datrie._TrieIterator.key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -10952,7 +10979,7 @@ static PyObject *__pyx_pw_6datrie_13_TrieIterator_7key(PyObject *__pyx_v_self, C * * cpdef unicode key(self): # <<<<<<<<<<<<<< * cdef cdatrie.AlphaChar* key = cdatrie.trie_iterator_get_key(self._iter) - * cdef unicode result = unicode_from_alpha_char(key) + * try: */ static PyObject *__pyx_pf_6datrie_13_TrieIterator_6key(struct __pyx_obj_6datrie__TrieIterator *__pyx_v_self) { @@ -10982,7 +11009,7 @@ static PyObject *__pyx_pf_6datrie_13_TrieIterator_6key(struct __pyx_obj_6datrie_ return __pyx_r; } -/* "datrie.pyx":735 +/* "datrie.pyx":732 * traversal. * """ * cpdef cdatrie.TrieData data(self): # <<<<<<<<<<<<<< @@ -11005,12 +11032,12 @@ static TrieData __pyx_f_6datrie_12BaseIterator_data(struct __pyx_obj_6datrie_Bas 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__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __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_6datrie_12BaseIterator_1data)) { - __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 = 735; __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 = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_from_py_TrieData(__pyx_t_2); if (unlikely((__pyx_t_3 == (TrieData)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_from_py_TrieData(__pyx_t_2); if (unlikely((__pyx_t_3 == (TrieData)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11019,7 +11046,7 @@ static TrieData __pyx_f_6datrie_12BaseIterator_data(struct __pyx_obj_6datrie_Bas __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "datrie.pyx":736 + /* "datrie.pyx":733 * """ * cpdef cdatrie.TrieData data(self): * return cdatrie.trie_iterator_get_data(self._iter) # <<<<<<<<<<<<<< @@ -11052,7 +11079,7 @@ static PyObject *__pyx_pw_6datrie_12BaseIterator_1data(PyObject *__pyx_v_self, C return __pyx_r; } -/* "datrie.pyx":735 +/* "datrie.pyx":732 * traversal. * """ * cpdef cdatrie.TrieData data(self): # <<<<<<<<<<<<<< @@ -11069,7 +11096,7 @@ static PyObject *__pyx_pf_6datrie_12BaseIterator_data(struct __pyx_obj_6datrie_B int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_TrieData(((struct __pyx_vtabstruct_6datrie_BaseIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->data(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_TrieData(((struct __pyx_vtabstruct_6datrie_BaseIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->data(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11112,7 +11139,7 @@ static int __pyx_pw_6datrie_8Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -11123,13 +11150,13 @@ static int __pyx_pw_6datrie_8Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("datrie.Iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_6datrie_State, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_6datrie_State, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_6datrie_8Iterator___cinit__(((struct __pyx_obj_6datrie_Iterator *)__pyx_v_self), __pyx_v_state); goto __pyx_L0; __pyx_L1_error:; @@ -11139,7 +11166,7 @@ static int __pyx_pw_6datrie_8Iterator_1__cinit__(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "datrie.pyx":744 +/* "datrie.pyx":741 * traversal. * """ * def __cinit__(self, State state): # this is overriden for extra type check # <<<<<<<<<<<<<< @@ -11156,7 +11183,7 @@ static int __pyx_pf_6datrie_8Iterator___cinit__(struct __pyx_obj_6datrie_Iterato int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "datrie.pyx":745 + /* "datrie.pyx":742 * """ * def __cinit__(self, State state): # this is overriden for extra type check * self._root = state # prevent garbage collection of state # <<<<<<<<<<<<<< @@ -11169,7 +11196,7 @@ static int __pyx_pf_6datrie_8Iterator___cinit__(struct __pyx_obj_6datrie_Iterato __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._root)); __pyx_v_self->__pyx_base._root = ((struct __pyx_obj_6datrie__TrieState *)__pyx_v_state); - /* "datrie.pyx":746 + /* "datrie.pyx":743 * def __cinit__(self, State state): # this is overriden for extra type check * self._root = state # prevent garbage collection of state * self._iter = cdatrie.trie_iterator_new(state._state) # <<<<<<<<<<<<<< @@ -11178,7 +11205,7 @@ static int __pyx_pf_6datrie_8Iterator___cinit__(struct __pyx_obj_6datrie_Iterato */ __pyx_v_self->__pyx_base._iter = trie_iterator_new(__pyx_v_state->__pyx_base._state); - /* "datrie.pyx":747 + /* "datrie.pyx":744 * self._root = state # prevent garbage collection of state * self._iter = cdatrie.trie_iterator_new(state._state) * if self._iter is NULL: # <<<<<<<<<<<<<< @@ -11188,14 +11215,14 @@ static int __pyx_pf_6datrie_8Iterator___cinit__(struct __pyx_obj_6datrie_Iterato __pyx_t_1 = (__pyx_v_self->__pyx_base._iter == NULL); if (__pyx_t_1) { - /* "datrie.pyx":748 + /* "datrie.pyx":745 * self._iter = cdatrie.trie_iterator_new(state._state) * if self._iter is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * cpdef data(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; @@ -11210,7 +11237,7 @@ static int __pyx_pf_6datrie_8Iterator___cinit__(struct __pyx_obj_6datrie_Iterato return __pyx_r; } -/* "datrie.pyx":750 +/* "datrie.pyx":747 * raise MemoryError() * * cpdef data(self): # <<<<<<<<<<<<<< @@ -11233,11 +11260,11 @@ static PyObject *__pyx_f_6datrie_8Iterator_data(struct __pyx_obj_6datrie_Iterato 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__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __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_6datrie_8Iterator_3data)) { __Pyx_XDECREF(__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 = 750; __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 = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -11247,7 +11274,7 @@ static PyObject *__pyx_f_6datrie_8Iterator_data(struct __pyx_obj_6datrie_Iterato __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "datrie.pyx":751 + /* "datrie.pyx":748 * * cpdef data(self): * cdef cdatrie.TrieData data = cdatrie.trie_iterator_get_data(self._iter) # <<<<<<<<<<<<<< @@ -11256,7 +11283,7 @@ static PyObject *__pyx_f_6datrie_8Iterator_data(struct __pyx_obj_6datrie_Iterato */ __pyx_v_data = trie_iterator_get_data(__pyx_v_self->__pyx_base._iter); - /* "datrie.pyx":752 + /* "datrie.pyx":749 * cpdef data(self): * cdef cdatrie.TrieData data = cdatrie.trie_iterator_get_data(self._iter) * return self._root._trie._index_to_value(data) # <<<<<<<<<<<<<< @@ -11264,7 +11291,7 @@ static PyObject *__pyx_f_6datrie_8Iterator_data(struct __pyx_obj_6datrie_Iterato * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_BaseTrie *)__pyx_v_self->__pyx_base._root->_trie->__pyx_vtab)->_index_to_value(__pyx_v_self->__pyx_base._root->_trie, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_BaseTrie *)__pyx_v_self->__pyx_base._root->_trie->__pyx_vtab)->_index_to_value(__pyx_v_self->__pyx_base._root->_trie, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11294,7 +11321,7 @@ static PyObject *__pyx_pw_6datrie_8Iterator_3data(PyObject *__pyx_v_self, CYTHON return __pyx_r; } -/* "datrie.pyx":750 +/* "datrie.pyx":747 * raise MemoryError() * * cpdef data(self): # <<<<<<<<<<<<<< @@ -11311,7 +11338,7 @@ static PyObject *__pyx_pf_6datrie_8Iterator_2data(struct __pyx_obj_6datrie_Itera int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_Iterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->data(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_Iterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->data(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -11329,7 +11356,7 @@ static PyObject *__pyx_pf_6datrie_8Iterator_2data(struct __pyx_obj_6datrie_Itera return __pyx_r; } -/* "datrie.pyx":755 +/* "datrie.pyx":752 * * * cdef (cdatrie.Trie* ) _load_from_file(f) except NULL: # <<<<<<<<<<<<<< @@ -11354,23 +11381,23 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_load_from_file", 0); - /* "datrie.pyx":756 + /* "datrie.pyx":753 * * cdef (cdatrie.Trie* ) _load_from_file(f) except NULL: * cdef int fd = f.fileno() # <<<<<<<<<<<<<< * cdef stdio.FILE* f_ptr = stdio_ext.fdopen(fd, "r") * if f_ptr == NULL: */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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 = 756; __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 = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fd = __pyx_t_3; - /* "datrie.pyx":757 + /* "datrie.pyx":754 * cdef (cdatrie.Trie* ) _load_from_file(f) except NULL: * cdef int fd = f.fileno() * cdef stdio.FILE* f_ptr = stdio_ext.fdopen(fd, "r") # <<<<<<<<<<<<<< @@ -11379,7 +11406,7 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { */ __pyx_v_f_ptr = fdopen(__pyx_v_fd, __pyx_k__r); - /* "datrie.pyx":758 + /* "datrie.pyx":755 * cdef int fd = f.fileno() * cdef stdio.FILE* f_ptr = stdio_ext.fdopen(fd, "r") * if f_ptr == NULL: # <<<<<<<<<<<<<< @@ -11389,23 +11416,23 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { __pyx_t_4 = (__pyx_v_f_ptr == NULL); if (__pyx_t_4) { - /* "datrie.pyx":759 + /* "datrie.pyx":756 * cdef stdio.FILE* f_ptr = stdio_ext.fdopen(fd, "r") * if f_ptr == NULL: * raise IOError() # <<<<<<<<<<<<<< * cdef cdatrie.Trie* trie = cdatrie.trie_fread(f_ptr) * if trie == NULL: */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "datrie.pyx":760 + /* "datrie.pyx":757 * if f_ptr == NULL: * raise IOError() * cdef cdatrie.Trie* trie = cdatrie.trie_fread(f_ptr) # <<<<<<<<<<<<<< @@ -11414,7 +11441,7 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { */ __pyx_v_trie = trie_fread(__pyx_v_f_ptr); - /* "datrie.pyx":761 + /* "datrie.pyx":758 * raise IOError() * cdef cdatrie.Trie* trie = cdatrie.trie_fread(f_ptr) * if trie == NULL: # <<<<<<<<<<<<<< @@ -11424,26 +11451,26 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { __pyx_t_4 = (__pyx_v_trie == NULL); if (__pyx_t_4) { - /* "datrie.pyx":762 + /* "datrie.pyx":759 * cdef cdatrie.Trie* trie = cdatrie.trie_fread(f_ptr) * if trie == NULL: * raise DatrieError("Can't load trie from stream") # <<<<<<<<<<<<<< * * cdef int f_pos = stdio.ftell(f_ptr) */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatrieError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatrieError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; - /* "datrie.pyx":764 + /* "datrie.pyx":761 * raise DatrieError("Can't load trie from stream") * * cdef int f_pos = stdio.ftell(f_ptr) # <<<<<<<<<<<<<< @@ -11452,29 +11479,29 @@ static Trie *__pyx_f_6datrie__load_from_file(PyObject *__pyx_v_f) { */ __pyx_v_f_pos = ftell(__pyx_v_f_ptr); - /* "datrie.pyx":765 + /* "datrie.pyx":762 * * cdef int f_pos = stdio.ftell(f_ptr) * f.seek(f_pos) # <<<<<<<<<<<<<< * * return trie */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_f_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_f_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "datrie.pyx":767 + /* "datrie.pyx":764 * f.seek(f_pos) * * return trie # <<<<<<<<<<<<<< @@ -11511,7 +11538,7 @@ static int __pyx_pw_6datrie_8AlphaMap_1__cinit__(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "datrie.pyx":797 +/* "datrie.pyx":794 * cdef cdatrie.AlphaMap *_c_alpha_map * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -11528,7 +11555,7 @@ static int __pyx_pf_6datrie_8AlphaMap___cinit__(struct __pyx_obj_6datrie_AlphaMa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "datrie.pyx":798 + /* "datrie.pyx":795 * * def __cinit__(self): * self._c_alpha_map = cdatrie.alpha_map_new() # <<<<<<<<<<<<<< @@ -11537,7 +11564,7 @@ static int __pyx_pf_6datrie_8AlphaMap___cinit__(struct __pyx_obj_6datrie_AlphaMa */ __pyx_v_self->_c_alpha_map = alpha_map_new(); - /* "datrie.pyx":799 + /* "datrie.pyx":796 * def __cinit__(self): * self._c_alpha_map = cdatrie.alpha_map_new() * if self._c_alpha_map is NULL: # <<<<<<<<<<<<<< @@ -11547,14 +11574,14 @@ static int __pyx_pf_6datrie_8AlphaMap___cinit__(struct __pyx_obj_6datrie_AlphaMa __pyx_t_1 = (__pyx_v_self->_c_alpha_map == NULL); if (__pyx_t_1) { - /* "datrie.pyx":800 + /* "datrie.pyx":797 * self._c_alpha_map = cdatrie.alpha_map_new() * if self._c_alpha_map is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; @@ -11578,7 +11605,7 @@ static void __pyx_pw_6datrie_8AlphaMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "datrie.pyx":802 +/* "datrie.pyx":799 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -11591,7 +11618,7 @@ static void __pyx_pf_6datrie_8AlphaMap_2__dealloc__(struct __pyx_obj_6datrie_Alp int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "datrie.pyx":803 + /* "datrie.pyx":800 * * def __dealloc__(self): * if self._c_alpha_map is not NULL: # <<<<<<<<<<<<<< @@ -11601,7 +11628,7 @@ static void __pyx_pf_6datrie_8AlphaMap_2__dealloc__(struct __pyx_obj_6datrie_Alp __pyx_t_1 = (__pyx_v_self->_c_alpha_map != NULL); if (__pyx_t_1) { - /* "datrie.pyx":804 + /* "datrie.pyx":801 * def __dealloc__(self): * if self._c_alpha_map is not NULL: * cdatrie.alpha_map_free(self._c_alpha_map) # <<<<<<<<<<<<<< @@ -11628,7 +11655,7 @@ static int __pyx_pw_6datrie_8AlphaMap_5__init__(PyObject *__pyx_v_self, PyObject static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet,&__pyx_n_s__ranges,0}; PyObject* values[2] = {0,0}; - /* "datrie.pyx":806 + /* "datrie.pyx":803 * cdatrie.alpha_map_free(self._c_alpha_map) * * def __init__(self, alphabet=None, ranges=None): # <<<<<<<<<<<<<< @@ -11660,7 +11687,7 @@ static int __pyx_pw_6datrie_8AlphaMap_5__init__(PyObject *__pyx_v_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -11675,7 +11702,7 @@ static int __pyx_pw_6datrie_8AlphaMap_5__init__(PyObject *__pyx_v_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __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 = 803; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("datrie.AlphaMap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -11702,7 +11729,7 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "datrie.pyx":807 + /* "datrie.pyx":804 * * def __init__(self, alphabet=None, ranges=None): * if ranges is not None: # <<<<<<<<<<<<<< @@ -11712,7 +11739,7 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa __pyx_t_1 = (__pyx_v_ranges != Py_None); if (__pyx_t_1) { - /* "datrie.pyx":808 + /* "datrie.pyx":805 * def __init__(self, alphabet=None, ranges=None): * if ranges is not None: * for range in ranges: # <<<<<<<<<<<<<< @@ -11723,7 +11750,7 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa __pyx_t_2 = __pyx_v_ranges; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -11733,21 +11760,21 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -11757,18 +11784,18 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa __pyx_v_range = __pyx_t_5; __pyx_t_5 = 0; - /* "datrie.pyx":809 + /* "datrie.pyx":806 * if ranges is not None: * for range in ranges: * self.add_range(*range) # <<<<<<<<<<<<<< * * if alphabet is not None: */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_range); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_range); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_Tuple(__pyx_v_range); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_Tuple(__pyx_v_range); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; @@ -11779,7 +11806,7 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa } __pyx_L3:; - /* "datrie.pyx":811 + /* "datrie.pyx":808 * self.add_range(*range) * * if alphabet is not None: # <<<<<<<<<<<<<< @@ -11789,21 +11816,21 @@ static int __pyx_pf_6datrie_8AlphaMap_4__init__(struct __pyx_obj_6datrie_AlphaMa __pyx_t_1 = (__pyx_v_alphabet != Py_None); if (__pyx_t_1) { - /* "datrie.pyx":812 + /* "datrie.pyx":809 * * if alphabet is not None: * self.add_alphabet(alphabet) # <<<<<<<<<<<<<< * * def add_alphabet(self, alphabet): */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_alphabet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__add_alphabet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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 = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_alphabet); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_alphabet); __Pyx_GIVEREF(__pyx_v_alphabet); - __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -11839,7 +11866,7 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_7add_alphabet(PyObject *__pyx_v_self return __pyx_r; } -/* "datrie.pyx":814 +/* "datrie.pyx":811 * self.add_alphabet(alphabet) * * def add_alphabet(self, alphabet): # <<<<<<<<<<<<<< @@ -11867,21 +11894,21 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_alphabet", 0); - /* "datrie.pyx":818 + /* "datrie.pyx":815 * Adds all chars from iterable to the alphabet set. * """ * for begin, end in alphabet_to_ranges(alphabet): # <<<<<<<<<<<<<< * self._add_range(begin, end) * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__alphabet_to_ranges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__alphabet_to_ranges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __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 = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_alphabet); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_alphabet); __Pyx_GIVEREF(__pyx_v_alphabet); - __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 = 818; __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 = 815; __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_2)); __pyx_t_2 = 0; @@ -11889,7 +11916,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; } @@ -11900,21 +11927,21 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -11930,7 +11957,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -11943,14 +11970,14 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -11958,7 +11985,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; @@ -11966,7 +11993,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF(__pyx_v_begin); @@ -11976,16 +12003,16 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_6add_alphabet(struct __pyx_obj_6datr __pyx_v_end = __pyx_t_6; __pyx_t_6 = 0; - /* "datrie.pyx":819 + /* "datrie.pyx":816 * """ * for begin, end in alphabet_to_ranges(alphabet): * self._add_range(begin, end) # <<<<<<<<<<<<<< * * def add_range(self, begin, end): */ - __pyx_t_9 = __Pyx_PyInt_from_py_AlphaChar(__pyx_v_begin); if (unlikely((__pyx_t_9 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_from_py_AlphaChar(__pyx_v_end); if (unlikely((__pyx_t_10 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_t_9, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_from_py_AlphaChar(__pyx_v_begin); if (unlikely((__pyx_t_9 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyInt_from_py_AlphaChar(__pyx_v_end); if (unlikely((__pyx_t_10 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_t_9, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -12038,11 +12065,11 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_9add_range(PyObject *__pyx_v_self, P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("add_range", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_range", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_range") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_range") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -12055,7 +12082,7 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_9add_range(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_range", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("add_range", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("datrie.AlphaMap.add_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12066,7 +12093,7 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_9add_range(PyObject *__pyx_v_self, P return __pyx_r; } -/* "datrie.pyx":821 +/* "datrie.pyx":818 * self._add_range(begin, end) * * def add_range(self, begin, end): # <<<<<<<<<<<<<< @@ -12086,34 +12113,34 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_8add_range(struct __pyx_obj_6datrie_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_range", 0); - /* "datrie.pyx":829 + /* "datrie.pyx":826 * ``end`` - the last character of the range. * """ * self._add_range(ord(begin), ord(end)) # <<<<<<<<<<<<<< * * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_begin); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_from_py_AlphaChar(__pyx_t_2); if (unlikely((__pyx_t_3 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_from_py_AlphaChar(__pyx_t_2); if (unlikely((__pyx_t_3 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __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 = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_end); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_from_py_AlphaChar(__pyx_t_1); if (unlikely((__pyx_t_4 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_from_py_AlphaChar(__pyx_t_1); if (unlikely((__pyx_t_4 == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_t_3, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_t_3, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12130,7 +12157,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_8add_range(struct __pyx_obj_6datrie_ return __pyx_r; } -/* "datrie.pyx":831 +/* "datrie.pyx":828 * self._add_range(ord(begin), ord(end)) * * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): # <<<<<<<<<<<<<< @@ -12156,15 +12183,15 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A 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___add_range); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___add_range); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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_6datrie_8AlphaMap_11_add_range)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_to_py_AlphaChar(__pyx_v_begin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_AlphaChar(__pyx_v_begin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_to_py_AlphaChar(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_AlphaChar(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -12172,7 +12199,7 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __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 = 831; __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 = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; @@ -12183,7 +12210,7 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "datrie.pyx":832 + /* "datrie.pyx":829 * * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): * if begin > end: # <<<<<<<<<<<<<< @@ -12193,26 +12220,26 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A __pyx_t_5 = (__pyx_v_begin > __pyx_v_end); if (__pyx_t_5) { - /* "datrie.pyx":833 + /* "datrie.pyx":830 * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): * if begin > end: * raise DatrieError('range begin > end') # <<<<<<<<<<<<<< * code = cdatrie.alpha_map_add_range(self._c_alpha_map, begin, end) * if code != 0: */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatrieError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__DatrieError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "datrie.pyx":834 + /* "datrie.pyx":831 * if begin > end: * raise DatrieError('range begin > end') * code = cdatrie.alpha_map_add_range(self._c_alpha_map, begin, end) # <<<<<<<<<<<<<< @@ -12221,7 +12248,7 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A */ __pyx_v_code = alpha_map_add_range(__pyx_v_self->_c_alpha_map, __pyx_v_begin, __pyx_v_end); - /* "datrie.pyx":835 + /* "datrie.pyx":832 * raise DatrieError('range begin > end') * code = cdatrie.alpha_map_add_range(self._c_alpha_map, begin, end) * if code != 0: # <<<<<<<<<<<<<< @@ -12231,14 +12258,14 @@ static PyObject *__pyx_f_6datrie_8AlphaMap__add_range(struct __pyx_obj_6datrie_A __pyx_t_5 = (__pyx_v_code != 0); if (__pyx_t_5) { - /* "datrie.pyx":836 + /* "datrie.pyx":833 * code = cdatrie.alpha_map_add_range(self._c_alpha_map, begin, end) * if code != 0: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef cdatrie.AlphaChar* new_alpha_char_from_unicode(unicode txt): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -12286,11 +12313,11 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_11_add_range(PyObject *__pyx_v_self, case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_add_range", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_add_range", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_add_range") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_add_range") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -12298,12 +12325,12 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_11_add_range(PyObject *__pyx_v_self, values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_begin = __Pyx_PyInt_from_py_AlphaChar(values[0]); if (unlikely((__pyx_v_begin == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_end = __Pyx_PyInt_from_py_AlphaChar(values[1]); if (unlikely((__pyx_v_end == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_begin = __Pyx_PyInt_from_py_AlphaChar(values[0]); if (unlikely((__pyx_v_begin == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_end = __Pyx_PyInt_from_py_AlphaChar(values[1]); if (unlikely((__pyx_v_end == (AlphaChar)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_add_range", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_add_range", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("datrie.AlphaMap._add_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12314,7 +12341,7 @@ static PyObject *__pyx_pw_6datrie_8AlphaMap_11_add_range(PyObject *__pyx_v_self, return __pyx_r; } -/* "datrie.pyx":831 +/* "datrie.pyx":828 * self._add_range(ord(begin), ord(end)) * * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): # <<<<<<<<<<<<<< @@ -12331,7 +12358,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_10_add_range(struct __pyx_obj_6datri int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_add_range", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_v_begin, __pyx_v_end, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_6datrie_AlphaMap *)__pyx_v_self->__pyx_vtab)->_add_range(__pyx_v_self, __pyx_v_begin, __pyx_v_end, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12349,7 +12376,7 @@ static PyObject *__pyx_pf_6datrie_8AlphaMap_10_add_range(struct __pyx_obj_6datri return __pyx_r; } -/* "datrie.pyx":838 +/* "datrie.pyx":835 * raise MemoryError() * * cdef cdatrie.AlphaChar* new_alpha_char_from_unicode(unicode txt): # <<<<<<<<<<<<<< @@ -12378,7 +12405,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_alpha_char_from_unicode", 0); - /* "datrie.pyx":845 + /* "datrie.pyx":842 * The caller should free the result of this function. * """ * cdef int txt_len = len(txt) # <<<<<<<<<<<<<< @@ -12387,12 +12414,12 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ if (unlikely(((PyObject *)__pyx_v_txt) == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(((PyObject *)__pyx_v_txt)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyUnicode_GET_LENGTH(((PyObject *)__pyx_v_txt)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_txt_len = __pyx_t_1; - /* "datrie.pyx":846 + /* "datrie.pyx":843 * """ * cdef int txt_len = len(txt) * cdef int size = (txt_len + 1) * sizeof(cdatrie.AlphaChar) # <<<<<<<<<<<<<< @@ -12401,7 +12428,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ __pyx_v_size = ((__pyx_v_txt_len + 1) * (sizeof(AlphaChar))); - /* "datrie.pyx":849 + /* "datrie.pyx":846 * * # allocate buffer * cdef cdatrie.AlphaChar* data = malloc(size) # <<<<<<<<<<<<<< @@ -12410,7 +12437,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ __pyx_v_data = ((AlphaChar *)malloc(__pyx_v_size)); - /* "datrie.pyx":850 + /* "datrie.pyx":847 * # allocate buffer * cdef cdatrie.AlphaChar* data = malloc(size) * if data is NULL: # <<<<<<<<<<<<<< @@ -12420,19 +12447,19 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ __pyx_t_2 = (__pyx_v_data == NULL); if (__pyx_t_2) { - /* "datrie.pyx":851 + /* "datrie.pyx":848 * cdef cdatrie.AlphaChar* data = malloc(size) * if data is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * # Copy text contents to buffer. */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "datrie.pyx":863 + /* "datrie.pyx":860 * # but the following is much (say 10x) faster and this * # function is really in a hot spot. * cdef int i = 0 # <<<<<<<<<<<<<< @@ -12441,7 +12468,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ __pyx_v_i = 0; - /* "datrie.pyx":864 + /* "datrie.pyx":861 * # function is really in a hot spot. * cdef int i = 0 * for char in txt: # <<<<<<<<<<<<<< @@ -12450,16 +12477,16 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ if (unlikely(((PyObject *)__pyx_v_txt) == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_INCREF(((PyObject *)__pyx_v_txt)); __pyx_t_3 = __pyx_v_txt; - __pyx_t_7 = __Pyx_init_unicode_iteration(((PyObject *)__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_init_unicode_iteration(((PyObject *)__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8++) { __pyx_t_1 = __pyx_t_8; __pyx_v_char = __Pyx_PyUnicode_READ(__pyx_t_6, __pyx_t_5, __pyx_t_1); - /* "datrie.pyx":865 + /* "datrie.pyx":862 * cdef int i = 0 * for char in txt: * data[i] = char # <<<<<<<<<<<<<< @@ -12468,7 +12495,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ (__pyx_v_data[__pyx_v_i]) = ((AlphaChar)__pyx_v_char); - /* "datrie.pyx":866 + /* "datrie.pyx":863 * for char in txt: * data[i] = char * i+=1 # <<<<<<<<<<<<<< @@ -12479,7 +12506,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ } __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "datrie.pyx":869 + /* "datrie.pyx":866 * * # Buffer must be null-terminated (last 4 bytes must be zero). * data[txt_len] = 0 # <<<<<<<<<<<<<< @@ -12488,7 +12515,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ */ (__pyx_v_data[__pyx_v_txt_len]) = 0; - /* "datrie.pyx":870 + /* "datrie.pyx":867 * # Buffer must be null-terminated (last 4 bytes must be zero). * data[txt_len] = 0 * return data # <<<<<<<<<<<<<< @@ -12509,7 +12536,7 @@ static AlphaChar *__pyx_f_6datrie_new_alpha_char_from_unicode(PyObject *__pyx_v_ return __pyx_r; } -/* "datrie.pyx":872 +/* "datrie.pyx":869 * return data * * cdef unicode unicode_from_alpha_char(cdatrie.AlphaChar* key, int len=0): # <<<<<<<<<<<<<< @@ -12535,7 +12562,7 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, } } - /* "datrie.pyx":876 + /* "datrie.pyx":873 * Converts libdatrie's AlphaChar* to Python unicode. * """ * cdef int length = len # <<<<<<<<<<<<<< @@ -12544,7 +12571,7 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, */ __pyx_v_length = __pyx_v_len; - /* "datrie.pyx":877 + /* "datrie.pyx":874 * """ * cdef int length = len * if length == 0: # <<<<<<<<<<<<<< @@ -12554,7 +12581,7 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, __pyx_t_1 = (__pyx_v_length == 0); if (__pyx_t_1) { - /* "datrie.pyx":878 + /* "datrie.pyx":875 * cdef int length = len * if length == 0: * length = cdatrie.alpha_char_strlen(key)*sizeof(cdatrie.AlphaChar) # <<<<<<<<<<<<<< @@ -12566,7 +12593,7 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, } __pyx_L3:; - /* "datrie.pyx":879 + /* "datrie.pyx":876 * if length == 0: * length = cdatrie.alpha_char_strlen(key)*sizeof(cdatrie.AlphaChar) * cdef char* c_str = key # <<<<<<<<<<<<<< @@ -12575,7 +12602,7 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, */ __pyx_v_c_str = ((char *)__pyx_v_key); - /* "datrie.pyx":880 + /* "datrie.pyx":877 * length = cdatrie.alpha_char_strlen(key)*sizeof(cdatrie.AlphaChar) * cdef char* c_str = key * return c_str[:length].decode('utf_32_le') # <<<<<<<<<<<<<< @@ -12583,9 +12610,9 @@ static PyObject *__pyx_f_6datrie_unicode_from_alpha_char(AlphaChar *__pyx_v_key, * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_c_str, 0, __pyx_v_length, __pyx_k__utf_32_le, NULL, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_c_str, 0, __pyx_v_length, __pyx_k__utf_32_le, NULL, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_2)))||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_2))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyUnicode_CheckExact(((PyObject *)__pyx_t_2)))||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(((PyObject *)__pyx_t_2))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; @@ -12628,7 +12655,7 @@ static PyObject *__pyx_pw_6datrie_9to_ranges_lambda1(PyObject *__pyx_self, PyObj return __pyx_r; } -/* "datrie.pyx":891 +/* "datrie.pyx":888 * [(1, 3), (5, 6)] * """ * for a, b in itertools.groupby(enumerate(lst), lambda t: t[1] - t[0]): # <<<<<<<<<<<<<< @@ -12647,11 +12674,11 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_t, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_t, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_t, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_t, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12673,7 +12700,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "datrie.pyx":883 +/* "datrie.pyx":880 * * * def to_ranges(lst): # <<<<<<<<<<<<<< @@ -12699,7 +12726,7 @@ static PyObject *__pyx_pf_6datrie_to_ranges(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lst); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lst); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6datrie_2generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6datrie_2generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -12739,31 +12766,31 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "datrie.pyx":891 + /* "datrie.pyx":888 * [(1, 3), (5, 6)] * """ * for a, b in itertools.groupby(enumerate(lst), lambda t: t[1] - t[0]): # <<<<<<<<<<<<<< * b = list(b) * yield b[0][1], b[-1][1] */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__groupby); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__groupby); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_lst); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_lst); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lst); - __pyx_t_3 = PyObject_Call(__pyx_builtin_enumerate, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_enumerate, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __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 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6datrie_9to_ranges_lambda1, 0, NULL, __pyx_n_s__datrie, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6datrie_9to_ranges_lambda1, 0, NULL, __pyx_n_s__datrie, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __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); @@ -12771,7 +12798,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -12779,7 +12806,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; } @@ -12790,21 +12817,21 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -12820,7 +12847,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -12833,14 +12860,14 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -12848,7 +12875,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -12856,7 +12883,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_a); @@ -12870,19 +12897,19 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __pyx_cur_scope->__pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; - /* "datrie.pyx":892 + /* "datrie.pyx":889 * """ * for a, b in itertools.groupby(enumerate(lst), lambda t: t[1] - t[0]): * b = list(b) # <<<<<<<<<<<<<< * yield b[0][1], b[-1][1] * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_b); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_b); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_b); @@ -12891,24 +12918,24 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __pyx_cur_scope->__pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; - /* "datrie.pyx":893 + /* "datrie.pyx":890 * for a, b in itertools.groupby(enumerate(lst), lambda t: t[1] - t[0]): * b = list(b) * yield b[0][1], b[-1][1] # <<<<<<<<<<<<<< * * def alphabet_to_ranges(alphabet): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_b, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_b, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_b, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_b, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -12933,7 +12960,7 @@ static PyObject *__pyx_gb_6datrie_2generator3(__pyx_GeneratorObject *__pyx_gener __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -12966,7 +12993,7 @@ static PyObject *__pyx_pw_6datrie_4alphabet_to_ranges(PyObject *__pyx_self, PyOb return __pyx_r; } -/* "datrie.pyx":895 +/* "datrie.pyx":892 * yield b[0][1], b[-1][1] * * def alphabet_to_ranges(alphabet): # <<<<<<<<<<<<<< @@ -12992,7 +13019,7 @@ static PyObject *__pyx_pf_6datrie_3alphabet_to_ranges(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_alphabet); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alphabet); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6datrie_5generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6datrie_5generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -13032,20 +13059,20 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "datrie.pyx":896 + /* "datrie.pyx":893 * * def alphabet_to_ranges(alphabet): * for begin, end in to_ranges(sorted(map(ord, iter(alphabet)))): # <<<<<<<<<<<<<< * yield begin, end * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__to_ranges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__to_ranges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_alphabet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_alphabet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_builtin_ord); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_ord); @@ -13053,23 +13080,23 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -13077,7 +13104,7 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; } @@ -13088,21 +13115,21 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #endif } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -13118,7 +13145,7 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -13131,14 +13158,14 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; @@ -13146,7 +13173,7 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; @@ -13154,7 +13181,7 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_begin); @@ -13168,14 +13195,14 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __pyx_cur_scope->__pyx_v_end = __pyx_t_6; __pyx_t_6 = 0; - /* "datrie.pyx":897 + /* "datrie.pyx":894 * def alphabet_to_ranges(alphabet): * for begin, end in to_ranges(sorted(map(ord, iter(alphabet)))): * yield begin, end # <<<<<<<<<<<<<< * * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_begin); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_begin); @@ -13200,7 +13227,7 @@ static PyObject *__pyx_gb_6datrie_5generator4(__pyx_GeneratorObject *__pyx_gener __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyErr_SetNone(PyExc_StopIteration); @@ -13234,7 +13261,7 @@ static PyObject *__pyx_pw_6datrie_7new(PyObject *__pyx_self, PyObject *__pyx_arg static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet,&__pyx_n_s__ranges,&__pyx_n_s__alpha_map,0}; PyObject* values[3] = {0,0,0}; - /* "datrie.pyx":899 + /* "datrie.pyx":896 * yield begin, end * * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): # <<<<<<<<<<<<<< @@ -13273,7 +13300,7 @@ static PyObject *__pyx_pw_6datrie_7new(PyObject *__pyx_self, PyObject *__pyx_arg } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -13290,13 +13317,13 @@ static PyObject *__pyx_pw_6datrie_7new(PyObject *__pyx_self, PyObject *__pyx_arg } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("new", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("new", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("datrie.new", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha_map), __pyx_ptype_6datrie_AlphaMap, 1, "alpha_map", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha_map), __pyx_ptype_6datrie_AlphaMap, 1, "alpha_map", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_6datrie_6new(__pyx_self, __pyx_v_alphabet, __pyx_v_ranges, __pyx_v_alpha_map); goto __pyx_L0; __pyx_L1_error:; @@ -13317,19 +13344,19 @@ static PyObject *__pyx_pf_6datrie_6new(CYTHON_UNUSED PyObject *__pyx_self, PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new", 0); - /* "datrie.pyx":900 + /* "datrie.pyx":897 * * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): * warnings.warn('datrie.new is deprecated; please use datrie.Trie.', DeprecationWarning) # <<<<<<<<<<<<<< * return Trie(alphabet, ranges, alpha_map) * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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 = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_20)); @@ -13337,13 +13364,13 @@ static PyObject *__pyx_pf_6datrie_6new(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_INCREF(__pyx_builtin_DeprecationWarning); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_DeprecationWarning); __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "datrie.pyx":901 + /* "datrie.pyx":898 * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): * warnings.warn('datrie.new is deprecated; please use datrie.Trie.', DeprecationWarning) * return Trie(alphabet, ranges, alpha_map) # <<<<<<<<<<<<<< @@ -13351,7 +13378,7 @@ static PyObject *__pyx_pf_6datrie_6new(CYTHON_UNUSED PyObject *__pyx_self, PyObj * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_alphabet); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_alphabet); @@ -13362,7 +13389,7 @@ static PyObject *__pyx_pf_6datrie_6new(CYTHON_UNUSED PyObject *__pyx_self, PyObj __Pyx_INCREF(((PyObject *)__pyx_v_alpha_map)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_alpha_map)); __Pyx_GIVEREF(((PyObject *)__pyx_v_alpha_map)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6datrie_Trie)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6datrie_Trie)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; @@ -16313,11 +16340,11 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_DeprecationWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_DeprecationWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -16409,42 +16436,42 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - /* "datrie.pyx":762 + /* "datrie.pyx":759 * cdef cdatrie.Trie* trie = cdatrie.trie_fread(f_ptr) * if trie == NULL: * raise DatrieError("Can't load trie from stream") # <<<<<<<<<<<<<< * * cdef int f_pos = stdio.ftell(f_ptr) */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_17); __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - /* "datrie.pyx":833 + /* "datrie.pyx":830 * cpdef _add_range(self, cdatrie.AlphaChar begin, cdatrie.AlphaChar end): * if begin > end: * raise DatrieError('range begin > end') # <<<<<<<<<<<<<< * code = cdatrie.alpha_map_add_range(self._c_alpha_map, begin, end) * if code != 0: */ - __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_19); __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - /* "datrie.pyx":883 + /* "datrie.pyx":880 * * * def to_ranges(lst): # <<<<<<<<<<<<<< * """ * Converts a list of numbers to a list of ranges:: */ - __pyx_k_tuple_22 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_22 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_22); __Pyx_INCREF(((PyObject *)__pyx_n_s__lst)); PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_n_s__lst)); @@ -16456,16 +16483,16 @@ static int __Pyx_InitCachedConstants(void) { PyTuple_SET_ITEM(__pyx_k_tuple_22, 2, ((PyObject *)__pyx_n_s__b)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__b)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__to_ranges, 883, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_23 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__to_ranges, 880, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "datrie.pyx":895 + /* "datrie.pyx":892 * yield b[0][1], b[-1][1] * * def alphabet_to_ranges(alphabet): # <<<<<<<<<<<<<< * for begin, end in to_ranges(sorted(map(ord, iter(alphabet)))): * yield begin, end */ - __pyx_k_tuple_25 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_25 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_25); __Pyx_INCREF(((PyObject *)__pyx_n_s__alphabet)); PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_n_s__alphabet)); @@ -16477,16 +16504,16 @@ static int __Pyx_InitCachedConstants(void) { PyTuple_SET_ITEM(__pyx_k_tuple_25, 2, ((PyObject *)__pyx_n_s__end)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__end)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__alphabet_to_ranges, 895, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_26 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__alphabet_to_ranges, 892, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "datrie.pyx":899 + /* "datrie.pyx":896 * yield begin, end * * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): # <<<<<<<<<<<<<< * warnings.warn('datrie.new is deprecated; please use datrie.Trie.', DeprecationWarning) * return Trie(alphabet, ranges, alpha_map) */ - __pyx_k_tuple_27 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_27 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_27); __Pyx_INCREF(((PyObject *)__pyx_n_s__alphabet)); PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_n_s__alphabet)); @@ -16498,7 +16525,7 @@ static int __Pyx_InitCachedConstants(void) { PyTuple_SET_ITEM(__pyx_k_tuple_27, 2, ((PyObject *)__pyx_n_s__alpha_map)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__alpha_map)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27)); - __pyx_k_codeobj_28 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__new, 899, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_28 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_24, __pyx_n_s__new, 896, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -16675,23 +16702,23 @@ PyMODINIT_FUNC PyInit_datrie(void) __pyx_vtable_6datrie_BaseIterator.__pyx_base = *__pyx_vtabptr_6datrie__TrieIterator; __pyx_vtable_6datrie_BaseIterator.data = (TrieData (*)(struct __pyx_obj_6datrie_BaseIterator *, int __pyx_skip_dispatch))__pyx_f_6datrie_12BaseIterator_data; __pyx_type_6datrie_BaseIterator.tp_base = __pyx_ptype_6datrie__TrieIterator; - if (PyType_Ready(&__pyx_type_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6datrie_BaseIterator.tp_dict, __pyx_vtabptr_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BaseIterator", (PyObject *)&__pyx_type_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_6datrie_BaseIterator.tp_dict, __pyx_vtabptr_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BaseIterator", (PyObject *)&__pyx_type_6datrie_BaseIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie_BaseIterator = &__pyx_type_6datrie_BaseIterator; __pyx_vtabptr_6datrie_Iterator = &__pyx_vtable_6datrie_Iterator; __pyx_vtable_6datrie_Iterator.__pyx_base = *__pyx_vtabptr_6datrie__TrieIterator; __pyx_vtable_6datrie_Iterator.data = (PyObject *(*)(struct __pyx_obj_6datrie_Iterator *, int __pyx_skip_dispatch))__pyx_f_6datrie_8Iterator_data; __pyx_type_6datrie_Iterator.tp_base = __pyx_ptype_6datrie__TrieIterator; - if (PyType_Ready(&__pyx_type_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6datrie_Iterator.tp_dict, __pyx_vtabptr_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Iterator", (PyObject *)&__pyx_type_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_6datrie_Iterator.tp_dict, __pyx_vtabptr_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Iterator", (PyObject *)&__pyx_type_6datrie_Iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie_Iterator = &__pyx_type_6datrie_Iterator; __pyx_vtabptr_6datrie_AlphaMap = &__pyx_vtable_6datrie_AlphaMap; __pyx_vtable_6datrie_AlphaMap._add_range = (PyObject *(*)(struct __pyx_obj_6datrie_AlphaMap *, AlphaChar, AlphaChar, int __pyx_skip_dispatch))__pyx_f_6datrie_8AlphaMap__add_range; - if (PyType_Ready(&__pyx_type_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6datrie_AlphaMap.tp_dict, __pyx_vtabptr_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AlphaMap", (PyObject *)&__pyx_type_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_6datrie_AlphaMap.tp_dict, __pyx_vtabptr_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "AlphaMap", (PyObject *)&__pyx_type_6datrie_AlphaMap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie_AlphaMap = &__pyx_type_6datrie_AlphaMap; if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct__iter_prefixes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie___pyx_scope_struct__iter_prefixes = &__pyx_type_6datrie___pyx_scope_struct__iter_prefixes; @@ -16699,9 +16726,9 @@ PyMODINIT_FUNC PyInit_datrie(void) __pyx_ptype_6datrie___pyx_scope_struct_1_iter_prefix_items = &__pyx_type_6datrie___pyx_scope_struct_1_iter_prefix_items; if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct_2_iter_prefix_items) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie___pyx_scope_struct_2_iter_prefix_items = &__pyx_type_6datrie___pyx_scope_struct_2_iter_prefix_items; - if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct_3_to_ranges) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct_3_to_ranges) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie___pyx_scope_struct_3_to_ranges = &__pyx_type_6datrie___pyx_scope_struct_3_to_ranges; - if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct_4_alphabet_to_ranges) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6datrie___pyx_scope_struct_4_alphabet_to_ranges) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6datrie___pyx_scope_struct_4_alphabet_to_ranges = &__pyx_type_6datrie___pyx_scope_struct_4_alphabet_to_ranges; /*--- Type import code ---*/ /*--- Variable import code ---*/ @@ -17005,40 +17032,40 @@ PyMODINIT_FUNC PyInit_datrie(void) __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "datrie.pyx":883 + /* "datrie.pyx":880 * * * def to_ranges(lst): # <<<<<<<<<<<<<< * """ * Converts a list of numbers to a list of ranges:: */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_1to_ranges, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_1to_ranges, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__to_ranges, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__to_ranges, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "datrie.pyx":895 + /* "datrie.pyx":892 * yield b[0][1], b[-1][1] * * def alphabet_to_ranges(alphabet): # <<<<<<<<<<<<<< * for begin, end in to_ranges(sorted(map(ord, iter(alphabet)))): * yield begin, end */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_4alphabet_to_ranges, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_4alphabet_to_ranges, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__alphabet_to_ranges, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__alphabet_to_ranges, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "datrie.pyx":899 + /* "datrie.pyx":896 * yield begin, end * * def new(alphabet=None, ranges=None, AlphaMap alpha_map=None): # <<<<<<<<<<<<<< * warnings.warn('datrie.new is deprecated; please use datrie.Trie.', DeprecationWarning) * return Trie(alphabet, ranges, alpha_map) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_7new, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6datrie_7new, NULL, __pyx_n_s__datrie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__new, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__new, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "datrie.pyx":1 diff --git a/src/stdio_ext.c b/src/stdio_ext.c index bd49e41..37c9264 100644 --- a/src/stdio_ext.c +++ b/src/stdio_ext.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17.beta1 on Wed Aug 1 04:17:47 2012 */ +/* Generated by Cython 0.17.beta1 on Thu Aug 2 14:37:54 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h"