diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-27 22:25:15 -0400 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-27 22:25:15 -0400 |
commit | 1d481414a2fa8505a2591c88e2b7b8f86a682ca2 (patch) | |
tree | ed5e9dff569d89da453578ce3d109991623d9303 /python/src/sa | |
parent | b317e0efd2398d75d70e027bb1e2cf442e683981 (diff) |
[python] conversion from cdec.sa.Rule to cdec.TRule
+ remove configobj dependency
+ re-structure packages (no more top-level library)
+ "const" stuff
+ use __new__ instead of constructor for some objects
Diffstat (limited to 'python/src/sa')
-rw-r--r-- | python/src/sa/_sa.c (renamed from python/src/sa/_cdec_sa.c) | 16412 | ||||
-rw-r--r-- | python/src/sa/_sa.pxd | 17 | ||||
-rw-r--r-- | python/src/sa/_sa.pyx (renamed from python/src/sa/_cdec_sa.pyx) | 0 | ||||
-rw-r--r-- | python/src/sa/rule.pxi | 39 | ||||
-rw-r--r-- | python/src/sa/rulefactory.pxi | 3 | ||||
-rw-r--r-- | python/src/sa/sym.pxi | 16 |
6 files changed, 8576 insertions, 7911 deletions
diff --git a/python/src/sa/_cdec_sa.c b/python/src/sa/_sa.c index 5bd9b28c..34f170bf 100644 --- a/python/src/sa/_cdec_sa.c +++ b/python/src/sa/_sa.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.16 on Fri Jul 27 00:18:44 2012 */ +/* Generated by Cython 0.17.beta1 on Fri Jul 27 22:15:31 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -47,12 +47,6 @@ #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCFunction_Call PyObject_Call -#else - #define __Pyx_PyCFunction_Call PyCFunction_Call -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -60,8 +54,11 @@ #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o)) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #define __PYX_BUILD_PY_SSIZE_T "i" #else @@ -130,14 +127,20 @@ #endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_GET_LENGTH) +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + + #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if PY_MAJOR_VERSION >= 3 @@ -268,8 +271,8 @@ #define _USE_MATH_DEFINES #endif #include <math.h> -#define __PYX_HAVE___cdec_sa -#define __PYX_HAVE_API___cdec_sa +#define __PYX_HAVE___sa +#define __PYX_HAVE_API___sa #include "stdio.h" #include "stdlib.h" #include "string.h" @@ -329,7 +332,11 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +#if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #ifdef __GNUC__ @@ -357,7 +364,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { - "_cdec_sa.pyx", + "_sa.pyx", "float_list.pxi", "int_list.pxi", "data_array.pxi", @@ -368,44 +375,46 @@ static const char *__pyx_f[] = { "rulefactory.pxi", "lcp.pxi", "sym.pxi", + "_sa.pxd", "precomputation.pxi", "suffix_array.pxi", "str_map.pxi", }; /*--- Type declarations ---*/ -struct __pyx_obj_8_cdec_sa_VEB; -struct __pyx_obj_8_cdec_sa_Sampler; -struct __pyx_obj_8_cdec_sa_BitSet; -struct __pyx_obj_8_cdec_sa_DataArray; -struct __pyx_obj_8_cdec_sa_TrieNode; -struct __pyx_obj_8_cdec_sa_VEBIterator; -struct __pyx_obj_8_cdec_sa_BitSetIterator; -struct __pyx_obj_8_cdec_sa_Phrase; -struct __pyx_obj_8_cdec_sa_IntList; -struct __pyx_obj_8_cdec_sa_ExtendedTrieNode; -struct __pyx_obj_8_cdec_sa_PhraseLocation; -struct __pyx_obj_8_cdec_sa_Rule; -struct __pyx_obj_8_cdec_sa_LCP; -struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory; -struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats; -struct __pyx_obj_8_cdec_sa_BiLex; -struct __pyx_obj_8_cdec_sa_SuffixArray; -struct __pyx_obj_8_cdec_sa_StringMap; -struct __pyx_obj_8_cdec_sa_TrieMap; -struct __pyx_obj_8_cdec_sa_Alphabet; -struct __pyx_obj_8_cdec_sa_Alignment; -struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input; -struct __pyx_obj_8_cdec_sa_Precomputation; -struct __pyx_obj_8_cdec_sa_FloatList; -struct __pyx_obj_8_cdec_sa_TrieTable; -struct __pyx_t_8_cdec_sa__node; -struct __pyx_t_8_cdec_sa__BitSet; -struct __pyx_t_8_cdec_sa__VEB; -struct __pyx_t_8_cdec_sa__Trie_Edge; -struct __pyx_t_8_cdec_sa__Trie_Node; -struct __pyx_t_8_cdec_sa_match_node; -struct __pyx_t_8_cdec_sa_Matching; +struct __pyx_obj_3_sa_HieroCachingRuleFactory; +struct __pyx_obj_3_sa_IntList; +struct __pyx_obj_3_sa_VEBIterator; +struct __pyx_obj_3_sa_BiLex; +struct __pyx_obj_3_sa_VEB; +struct __pyx_obj_3_sa_LCP; +struct __pyx_obj_3_sa_DataArray; +struct __pyx_obj_3_sa_BitSetIterator; +struct __pyx_obj_3_sa_Precomputation; +struct __pyx_obj_3_sa_SuffixArray; +struct __pyx_obj_3_sa_Alphabet; +struct __pyx_obj_3_sa_Rule; +struct __pyx_obj_3_sa_PhraseLocation; +struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats; +struct __pyx_obj_3_sa___pyx_scope_struct_2_input; +struct __pyx_obj_3_sa_Alignment; +struct __pyx_obj_3_sa_BitSet; +struct __pyx_obj_3_sa_Sampler; +struct __pyx_obj_3_sa_StringMap; +struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__; +struct __pyx_obj_3_sa_TrieNode; +struct __pyx_obj_3_sa_ExtendedTrieNode; +struct __pyx_obj_3_sa_TrieMap; +struct __pyx_obj_3_sa_Phrase; +struct __pyx_obj_3_sa_TrieTable; +struct __pyx_obj_3_sa_FloatList; +struct __pyx_t_3_sa__node; +struct __pyx_t_3_sa__BitSet; +struct __pyx_t_3_sa__VEB; +struct __pyx_t_3_sa__Trie_Edge; +struct __pyx_t_3_sa__Trie_Node; +struct __pyx_t_3_sa_match_node; +struct __pyx_t_3_sa_Matching; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":9 * from libc.string cimport memset, strcpy, strlen @@ -414,9 +423,9 @@ struct __pyx_t_8_cdec_sa_Matching; * _node* smaller * _node* bigger */ -struct __pyx_t_8_cdec_sa__node { - struct __pyx_t_8_cdec_sa__node *smaller; - struct __pyx_t_8_cdec_sa__node *bigger; +struct __pyx_t_3_sa__node { + struct __pyx_t_3_sa__node *smaller; + struct __pyx_t_3_sa__node *bigger; int key; int val; }; @@ -428,7 +437,7 @@ struct __pyx_t_8_cdec_sa__node { * long bitset * int min_val */ -struct __pyx_t_8_cdec_sa__BitSet { +struct __pyx_t_3_sa__BitSet { long bitset; int min_val; int max_val; @@ -442,7 +451,7 @@ struct __pyx_t_8_cdec_sa__BitSet { * int top_universe_size * int num_bottom_bits */ -struct __pyx_t_8_cdec_sa__VEB { +struct __pyx_t_3_sa__VEB { int top_universe_size; int num_bottom_bits; int max_val; @@ -459,11 +468,11 @@ struct __pyx_t_8_cdec_sa__VEB { * int val * _Trie_Node* node */ -struct __pyx_t_8_cdec_sa__Trie_Edge { +struct __pyx_t_3_sa__Trie_Edge { int val; - struct __pyx_t_8_cdec_sa__Trie_Node *node; - struct __pyx_t_8_cdec_sa__Trie_Edge *bigger; - struct __pyx_t_8_cdec_sa__Trie_Edge *smaller; + struct __pyx_t_3_sa__Trie_Node *node; + struct __pyx_t_3_sa__Trie_Edge *bigger; + struct __pyx_t_3_sa__Trie_Edge *smaller; }; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":8 @@ -473,8 +482,8 @@ struct __pyx_t_8_cdec_sa__Trie_Edge { * * cdef struct _Trie_Edge: */ -struct __pyx_t_8_cdec_sa__Trie_Node { - struct __pyx_t_8_cdec_sa__Trie_Edge *root; +struct __pyx_t_3_sa__Trie_Node { + struct __pyx_t_3_sa__Trie_Edge *root; int *arr; int arr_len; }; @@ -486,9 +495,9 @@ struct __pyx_t_8_cdec_sa__Trie_Node { * int* match * match_node* next */ -struct __pyx_t_8_cdec_sa_match_node { +struct __pyx_t_3_sa_match_node { int *match; - struct __pyx_t_8_cdec_sa_match_node *next; + struct __pyx_t_3_sa_match_node *next; }; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":145 @@ -498,7 +507,7 @@ struct __pyx_t_8_cdec_sa_match_node { * int* arr * int start */ -struct __pyx_t_8_cdec_sa_Matching { +struct __pyx_t_3_sa_Matching { int *arr; int start; int end; @@ -506,90 +515,150 @@ struct __pyx_t_8_cdec_sa_Matching { int size; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":354 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":201 * * - * cdef class VEB: # <<<<<<<<<<<<<< - * cdef _VEB* veb - * cdef int _findsucc(self, int i) + * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< + * '''This RuleFactory implements a caching + * method using TrieTable, which makes phrase */ -struct __pyx_obj_8_cdec_sa_VEB { +struct __pyx_obj_3_sa_HieroCachingRuleFactory { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_VEB *__pyx_vtab; - struct __pyx_t_8_cdec_sa__VEB *veb; + struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *__pyx_vtab; + struct __pyx_obj_3_sa_TrieTable *rules; + struct __pyx_obj_3_sa_Sampler *sampler; + int max_chunks; + int max_target_chunks; + int max_length; + int max_target_length; + int max_nonterminals; + int max_initial_size; + int train_max_initial_size; + int min_gap_size; + int train_min_gap_size; + int category; + PyObject *precomputed_index; + PyObject *precomputed_collocations; + PyObject *precompute_file; + PyObject *max_rank; + int precompute_rank; + int precompute_secondary_rank; + int use_baeza_yates; + int use_index; + int use_collocations; + float by_slack_factor; + PyObject *prev_norm_prefix; + float extract_time; + struct __pyx_obj_3_sa_SuffixArray *fsa; + struct __pyx_obj_3_sa_DataArray *fda; + struct __pyx_obj_3_sa_DataArray *eda; + struct __pyx_obj_3_sa_Alignment *alignment; + struct __pyx_obj_3_sa_IntList *eid2symid; + struct __pyx_obj_3_sa_IntList *fid2symid; + int tight_phrases; + int require_aligned_terminal; + int require_aligned_chunks; + struct __pyx_obj_3_sa_IntList *findexes; + struct __pyx_obj_3_sa_IntList *findexes1; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":79 - * +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":9 + * from libc.string cimport memset, memcpy * - * cdef class Sampler: # <<<<<<<<<<<<<< - * '''A Sampler implements a logic for choosing - * samples from a population range''' + * cdef class IntList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment */ -struct __pyx_obj_8_cdec_sa_Sampler { +struct __pyx_obj_3_sa_IntList { PyObject_HEAD - int sample_size; - struct __pyx_obj_8_cdec_sa_IntList *sa; + struct __pyx_vtabstruct_3_sa_IntList *__pyx_vtab; + int size; + int increment; + int len; + int *arr; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":118 - * # (entirely C-implemented) _BitSet struct. - * # Very slow; use only for debugging - * cdef class BitSet: # <<<<<<<<<<<<<< +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":340 * - * cdef _BitSet* b + * + * cdef class VEBIterator: # <<<<<<<<<<<<<< + * cdef _VEB* v + * cdef int next_val */ -struct __pyx_obj_8_cdec_sa_BitSet { +struct __pyx_obj_3_sa_VEBIterator { PyObject_HEAD - struct __pyx_t_8_cdec_sa__BitSet *b; + struct __pyx_t_3_sa__VEB *v; + int next_val; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":9 - * from libc.string cimport memset, strcpy, strlen +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":47 * - * cdef class DataArray: # <<<<<<<<<<<<<< - * cdef word2id - * cdef id2word + * + * cdef class BiLex: # <<<<<<<<<<<<<< + * cdef FloatList col1 + * cdef FloatList col2 */ -struct __pyx_obj_8_cdec_sa_DataArray { +struct __pyx_obj_3_sa_BiLex { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_DataArray *__pyx_vtab; - PyObject *word2id; - PyObject *id2word; - struct __pyx_obj_8_cdec_sa_IntList *data; - struct __pyx_obj_8_cdec_sa_IntList *sent_id; - struct __pyx_obj_8_cdec_sa_IntList *sent_index; - int use_sent_id; + struct __pyx_vtabstruct_3_sa_BiLex *__pyx_vtab; + struct __pyx_obj_3_sa_FloatList *col1; + struct __pyx_obj_3_sa_FloatList *col2; + struct __pyx_obj_3_sa_IntList *f_index; + struct __pyx_obj_3_sa_IntList *e_index; + PyObject *id2eword; + PyObject *id2fword; + PyObject *eword2id; + PyObject *fword2id; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":18 - * cdef int EPSILON = sym_fromstring('*EPS*', True) +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":354 * - * cdef class TrieNode: # <<<<<<<<<<<<<< - * cdef public children * + * cdef class VEB: # <<<<<<<<<<<<<< + * cdef _VEB* veb + * cdef int _findsucc(self, int i) */ -struct __pyx_obj_8_cdec_sa_TrieNode { +struct __pyx_obj_3_sa_VEB { PyObject_HEAD - PyObject *children; + struct __pyx_vtabstruct_3_sa_VEB *__pyx_vtab; + struct __pyx_t_3_sa__VEB *veb; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":340 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":5 + * as k most frequent n-grams""" * + * cdef class LCP: # <<<<<<<<<<<<<< + * cdef SuffixArray sa + * cdef IntList lcp + */ +struct __pyx_obj_3_sa_LCP { + PyObject_HEAD + struct __pyx_obj_3_sa_SuffixArray *sa; + struct __pyx_obj_3_sa_IntList *lcp; +}; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":9 + * from libc.string cimport memset, strcpy, strlen * - * cdef class VEBIterator: # <<<<<<<<<<<<<< - * cdef _VEB* v - * cdef int next_val + * cdef class DataArray: # <<<<<<<<<<<<<< + * cdef word2id + * cdef id2word */ -struct __pyx_obj_8_cdec_sa_VEBIterator { +struct __pyx_obj_3_sa_DataArray { PyObject_HEAD - struct __pyx_t_8_cdec_sa__VEB *v; - int next_val; + struct __pyx_vtabstruct_3_sa_DataArray *__pyx_vtab; + PyObject *word2id; + PyObject *id2word; + struct __pyx_obj_3_sa_IntList *data; + struct __pyx_obj_3_sa_IntList *sent_id; + struct __pyx_obj_3_sa_IntList *sent_index; + int use_sent_id; }; @@ -600,59 +669,75 @@ struct __pyx_obj_8_cdec_sa_VEBIterator { * cdef _BitSet* b * cdef int next_val */ -struct __pyx_obj_8_cdec_sa_BitSetIterator { +struct __pyx_obj_3_sa_BitSetIterator { PyObject_HEAD - struct __pyx_t_8_cdec_sa__BitSet *b; + struct __pyx_t_3_sa__BitSet *b; int next_val; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":4 - * from libc.string cimport strsep, strcpy, strlen +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":188 * - * cdef class Phrase: # <<<<<<<<<<<<<< - * cdef int *syms - * cdef int n, *varpos, n_vars + * + * cdef class Precomputation: # <<<<<<<<<<<<<< + * cdef int precompute_rank + * cdef int precompute_secondary_rank */ -struct __pyx_obj_8_cdec_sa_Phrase { +struct __pyx_obj_3_sa_Precomputation { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_Phrase *__pyx_vtab; - int *syms; - int n; - int *varpos; - int n_vars; + struct __pyx_vtabstruct_3_sa_Precomputation *__pyx_vtab; + int precompute_rank; + int precompute_secondary_rank; + int max_length; + int max_nonterminals; + int train_max_initial_size; + int train_min_gap_size; + PyObject *precomputed_index; + PyObject *precomputed_collocations; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":9 - * from libc.string cimport memset, memcpy +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":6 + * from libc.stdio cimport FILE, fclose, fopen * - * cdef class IntList: # <<<<<<<<<<<<<< - * cdef int size - * cdef int increment + * cdef class SuffixArray: # <<<<<<<<<<<<<< + * cdef DataArray darray + * cdef IntList sa */ -struct __pyx_obj_8_cdec_sa_IntList { +struct __pyx_obj_3_sa_SuffixArray { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_IntList *__pyx_vtab; - int size; - int increment; - int len; - int *arr; + struct __pyx_vtabstruct_3_sa_SuffixArray *__pyx_vtab; + struct __pyx_obj_3_sa_DataArray *darray; + struct __pyx_obj_3_sa_IntList *sa; + struct __pyx_obj_3_sa_IntList *ha; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":24 - * self.children = {} +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":7 + * cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 * - * cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<< - * cdef public phrase - * cdef public phrase_location + * cdef class Alphabet: # <<<<<<<<<<<<<< + * cdef readonly StringMap terminals, nonterminals + * cdef int first_nonterminal, last_nonterminal */ -struct __pyx_obj_8_cdec_sa_ExtendedTrieNode { - struct __pyx_obj_8_cdec_sa_TrieNode __pyx_base; - PyObject *phrase; - PyObject *phrase_location; - PyObject *suffix_link; +struct __pyx_obj_3_sa_Alphabet { + PyObject_HEAD + struct __pyx_vtabstruct_3_sa_Alphabet *__pyx_vtab; + struct __pyx_obj_3_sa_StringMap *terminals; + struct __pyx_obj_3_sa_StringMap *nonterminals; + int first_nonterminal; + int last_nonterminal; + PyObject *id2sym; +}; + +struct __pyx_obj_3_sa_Rule { + PyObject_HEAD + int lhs; + struct __pyx_obj_3_sa_Phrase *f; + struct __pyx_obj_3_sa_Phrase *e; + float *cscores; + int n_scores; + PyObject *word_alignments; }; @@ -663,98 +748,18 @@ struct __pyx_obj_8_cdec_sa_ExtendedTrieNode { * cdef int sa_low * cdef int sa_high */ -struct __pyx_obj_8_cdec_sa_PhraseLocation { +struct __pyx_obj_3_sa_PhraseLocation { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_PhraseLocation *__pyx_vtab; + struct __pyx_vtabstruct_3_sa_PhraseLocation *__pyx_vtab; int sa_low; int sa_high; int arr_low; int arr_high; - struct __pyx_obj_8_cdec_sa_IntList *arr; + struct __pyx_obj_3_sa_IntList *arr; int num_subpatterns; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":159 - * return start - * - * cdef class Rule: # <<<<<<<<<<<<<< - * cdef public int lhs - * cdef readonly Phrase f, e - */ -struct __pyx_obj_8_cdec_sa_Rule { - PyObject_HEAD - int lhs; - struct __pyx_obj_8_cdec_sa_Phrase *f; - struct __pyx_obj_8_cdec_sa_Phrase *e; - float *cscores; - int n_scores; - PyObject *word_alignments; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":5 - * as k most frequent n-grams""" - * - * cdef class LCP: # <<<<<<<<<<<<<< - * cdef SuffixArray sa - * cdef IntList lcp - */ -struct __pyx_obj_8_cdec_sa_LCP { - PyObject_HEAD - struct __pyx_obj_8_cdec_sa_SuffixArray *sa; - struct __pyx_obj_8_cdec_sa_IntList *lcp; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":201 - * - * - * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< - * '''This RuleFactory implements a caching - * method using TrieTable, which makes phrase - */ -struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *__pyx_vtab; - struct __pyx_obj_8_cdec_sa_TrieTable *rules; - struct __pyx_obj_8_cdec_sa_Sampler *sampler; - int max_chunks; - int max_target_chunks; - int max_length; - int max_target_length; - int max_nonterminals; - int max_initial_size; - int train_max_initial_size; - int min_gap_size; - int train_min_gap_size; - int category; - PyObject *precomputed_index; - PyObject *precomputed_collocations; - PyObject *precompute_file; - PyObject *max_rank; - int precompute_rank; - int precompute_secondary_rank; - int use_baeza_yates; - int use_index; - int use_collocations; - float by_slack_factor; - PyObject *prev_norm_prefix; - float extract_time; - struct __pyx_obj_8_cdec_sa_SuffixArray *fsa; - struct __pyx_obj_8_cdec_sa_DataArray *fda; - struct __pyx_obj_8_cdec_sa_DataArray *eda; - struct __pyx_obj_8_cdec_sa_Alignment *alignment; - struct __pyx_obj_8_cdec_sa_IntList *eid2symid; - struct __pyx_obj_8_cdec_sa_IntList *fid2symid; - int tight_phrases; - int require_aligned_terminal; - int require_aligned_chunks; - struct __pyx_obj_8_cdec_sa_IntList *findexes; - struct __pyx_obj_8_cdec_sa_IntList *findexes1; -}; - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":36 * logger.info("LCP array completed") * @@ -762,7 +767,7 @@ struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory { * """Note: the output of this function is not exact. In * particular, the frequency associated with each word is */ -struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats { +struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats { PyObject_HEAD int __pyx_v_N; int __pyx_v_freq; @@ -775,116 +780,17 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats { int __pyx_v_max_n; int __pyx_v_n; PyObject *__pyx_v_ngram; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_ngram_start; + struct __pyx_obj_3_sa_IntList *__pyx_v_ngram_start; PyObject *__pyx_v_ngram_starts; int __pyx_v_rs; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_run_start; - struct __pyx_obj_8_cdec_sa_LCP *__pyx_v_self; + struct __pyx_obj_3_sa_IntList *__pyx_v_run_start; + struct __pyx_obj_3_sa_LCP *__pyx_v_self; int __pyx_v_valid; - struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_veb; + struct __pyx_obj_3_sa_VEB *__pyx_v_veb; int __pyx_t_0; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":47 - * - * - * cdef class BiLex: # <<<<<<<<<<<<<< - * cdef FloatList col1 - * cdef FloatList col2 - */ -struct __pyx_obj_8_cdec_sa_BiLex { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_BiLex *__pyx_vtab; - struct __pyx_obj_8_cdec_sa_FloatList *col1; - struct __pyx_obj_8_cdec_sa_FloatList *col2; - struct __pyx_obj_8_cdec_sa_IntList *f_index; - struct __pyx_obj_8_cdec_sa_IntList *e_index; - PyObject *id2eword; - PyObject *id2fword; - PyObject *eword2id; - PyObject *fword2id; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":6 - * from libc.stdio cimport FILE, fclose, fopen - * - * cdef class SuffixArray: # <<<<<<<<<<<<<< - * cdef DataArray darray - * cdef IntList sa - */ -struct __pyx_obj_8_cdec_sa_SuffixArray { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *__pyx_vtab; - struct __pyx_obj_8_cdec_sa_DataArray *darray; - struct __pyx_obj_8_cdec_sa_IntList *sa; - struct __pyx_obj_8_cdec_sa_IntList *ha; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/str_map.pxi":8 - * char* stringmap_word(StrMap *vocab, int i) - * - * cdef class StringMap: # <<<<<<<<<<<<<< - * cdef StrMap *vocab - * cdef char *word(self, int i) - */ -struct __pyx_obj_8_cdec_sa_StringMap { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_StringMap *__pyx_vtab; - StrMap *vocab; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":109 - * trie_node_to_map(edge.node, result, prefix, include_zeros) - * - * cdef class TrieMap: # <<<<<<<<<<<<<< - * - * cdef _Trie_Node** root - */ -struct __pyx_obj_8_cdec_sa_TrieMap { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_TrieMap *__pyx_vtab; - struct __pyx_t_8_cdec_sa__Trie_Node **root; - int V; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":7 - * cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 - * - * cdef class Alphabet: # <<<<<<<<<<<<<< - * cdef readonly StringMap terminals, nonterminals - * cdef int first_nonterminal, last_nonterminal - */ -struct __pyx_obj_8_cdec_sa_Alphabet { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_Alphabet *__pyx_vtab; - struct __pyx_obj_8_cdec_sa_StringMap *terminals; - struct __pyx_obj_8_cdec_sa_StringMap *nonterminals; - int first_nonterminal; - int last_nonterminal; - PyObject *id2sym; -}; - - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":8 - * # May need to revisit if things get really tight, though. - * - * cdef class Alignment: # <<<<<<<<<<<<<< - * cdef IntList links - * cdef IntList sent_index - */ -struct __pyx_obj_8_cdec_sa_Alignment { - PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_Alignment *__pyx_vtab; - struct __pyx_obj_8_cdec_sa_IntList *links; - struct __pyx_obj_8_cdec_sa_IntList *sent_index; -}; - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":919 * return sorted(result); * @@ -892,7 +798,7 @@ struct __pyx_obj_8_cdec_sa_Alignment { * '''When this function is called on the RuleFactory, * it looks up all of the rules that can be used to translate */ -struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { +struct __pyx_obj_3_sa___pyx_scope_struct_2_input { PyObject_HEAD PyObject *__pyx_v_alignment; PyObject *__pyx_v_als; @@ -900,7 +806,7 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { int __pyx_v_alt; int __pyx_v_alt_id; int __pyx_v_arity; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_chunklen; + struct __pyx_obj_3_sa_IntList *__pyx_v_chunklen; PyObject *__pyx_v_count; PyObject *__pyx_v_currcount; PyObject *__pyx_v_e; @@ -918,7 +824,7 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { PyObject *__pyx_v_frontier; PyObject *__pyx_v_frontier_nodes; PyObject *__pyx_v_fwords; - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_hiero_phrase; + struct __pyx_obj_3_sa_Phrase *__pyx_v_hiero_phrase; long __pyx_v_hit; int __pyx_v_i; PyObject *__pyx_v_is_shadow_path; @@ -926,7 +832,7 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { int __pyx_v_k; PyObject *__pyx_v_key; int __pyx_v_lookup_required; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_matching; + struct __pyx_t_3_sa_Matching __pyx_v_matching; PyObject *__pyx_v_model; PyObject *__pyx_v_models; PyObject *__pyx_v_new_frontier; @@ -939,17 +845,16 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { int __pyx_v_num_subpatterns; PyObject *__pyx_v_pathlen; PyObject *__pyx_v_phrase; - struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_phrase_location; + struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_phrase_location; PyObject *__pyx_v_prefix; PyObject *__pyx_v_reachable_buffer; PyObject *__pyx_v_sa_range; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_sample; + struct __pyx_obj_3_sa_IntList *__pyx_v_sample; PyObject *__pyx_v_scores; - struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self; + struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self; PyObject *__pyx_v_spanlen; float __pyx_v_start_time; PyObject *__pyx_v_stop_time; - PyObject *__pyx_v_str_phrase; PyObject *__pyx_v_suffix_link; int __pyx_v_suffix_link_xcat; PyObject *__pyx_v_suffix_link_xcat_index; @@ -960,142 +865,178 @@ struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input { PyObject *__pyx_v_xnode; PyObject *__pyx_v_xroot; Py_ssize_t __pyx_t_0; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2; - PyObject *__pyx_t_3; + PyObject *__pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4; - Py_ssize_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":188 - * +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":8 + * # May need to revisit if things get really tight, though. * - * cdef class Precomputation: # <<<<<<<<<<<<<< - * cdef int precompute_rank - * cdef int precompute_secondary_rank + * cdef class Alignment: # <<<<<<<<<<<<<< + * cdef IntList links + * cdef IntList sent_index */ -struct __pyx_obj_8_cdec_sa_Precomputation { +struct __pyx_obj_3_sa_Alignment { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_Precomputation *__pyx_vtab; - int precompute_rank; - int precompute_secondary_rank; - int max_length; - int max_nonterminals; - int train_max_initial_size; - int train_min_gap_size; - PyObject *precomputed_index; - PyObject *precomputed_collocations; + struct __pyx_vtabstruct_3_sa_Alignment *__pyx_vtab; + struct __pyx_obj_3_sa_IntList *links; + struct __pyx_obj_3_sa_IntList *sent_index; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/float_list.pxi":9 - * from libc.string cimport memset, strcpy, strlen +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":118 + * # (entirely C-implemented) _BitSet struct. + * # Very slow; use only for debugging + * cdef class BitSet: # <<<<<<<<<<<<<< * - * cdef class FloatList: # <<<<<<<<<<<<<< - * cdef int size - * cdef int increment + * cdef _BitSet* b */ -struct __pyx_obj_8_cdec_sa_FloatList { +struct __pyx_obj_3_sa_BitSet { PyObject_HEAD - struct __pyx_vtabstruct_8_cdec_sa_FloatList *__pyx_vtab; - int size; - int increment; - int len; - float *arr; + struct __pyx_t_3_sa__BitSet *b; }; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":35 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":79 * * - * cdef class TrieTable: # <<<<<<<<<<<<<< - * cdef public int extended - * cdef public int count + * cdef class Sampler: # <<<<<<<<<<<<<< + * '''A Sampler implements a logic for choosing + * samples from a population range''' */ -struct __pyx_obj_8_cdec_sa_TrieTable { +struct __pyx_obj_3_sa_Sampler { PyObject_HEAD - int extended; - int count; - PyObject *root; + int sample_size; + struct __pyx_obj_3_sa_IntList *sa; }; - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":6 - * from libc.stdio cimport FILE, fclose, fopen +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/str_map.pxi":8 + * char* stringmap_word(StrMap *vocab, int i) * - * cdef class SuffixArray: # <<<<<<<<<<<<<< - * cdef DataArray darray - * cdef IntList sa + * cdef class StringMap: # <<<<<<<<<<<<<< + * cdef StrMap *vocab + * cdef char *word(self, int i) */ +struct __pyx_obj_3_sa_StringMap { + PyObject_HEAD + struct __pyx_vtabstruct_3_sa_StringMap *__pyx_vtab; + StrMap *vocab; +}; + -struct __pyx_vtabstruct_8_cdec_sa_SuffixArray { - int (*__pyx___search_high)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int); - int (*__pyx___search_low)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int); - PyObject *(*__pyx___get_range)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int, int); - PyObject *(*__pyx___lookup_helper)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int); +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":141 + * return self.syms[i] + * + * def __iter__(self): # <<<<<<<<<<<<<< + * cdef int i + * for i from 0 <= i < self.n: + */ +struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ { + PyObject_HEAD + int __pyx_v_i; + struct __pyx_obj_3_sa_Phrase *__pyx_v_self; + int __pyx_t_0; }; -static struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *__pyx_vtabptr_8_cdec_sa_SuffixArray; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":201 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":18 + * cdef int EPSILON = sym_fromstring('*EPS*', True) * + * cdef class TrieNode: # <<<<<<<<<<<<<< + * cdef public children * - * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< - * '''This RuleFactory implements a caching - * method using TrieTable, which makes phrase */ +struct __pyx_obj_3_sa_TrieNode { + PyObject_HEAD + PyObject *children; +}; + -struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory { - PyObject *(*set_idmap)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_DataArray *); - int *(*baeza_yates_helper)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *); - long (*compare_matchings_set)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, struct __pyx_t_8_cdec_sa_Matching *, int, int); - long (*compare_matchings)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_t_8_cdec_sa_Matching *, struct __pyx_t_8_cdec_sa_Matching *, int, int); - int *(*merge_helper)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *); - void (*sort_phrase_loc)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_IntList *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, struct __pyx_obj_8_cdec_sa_Phrase *); - PyObject *(*intersect_helper)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, int); - PyObject *(*loc2str)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_PhraseLocation *); - struct __pyx_obj_8_cdec_sa_PhraseLocation *(*intersect)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, PyObject *, PyObject *, struct __pyx_obj_8_cdec_sa_Phrase *); - int (*find_fixpoint)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, PyObject *, int *, int *, int *, int *, int, int, int *, int *, int *, int *, int, int, int, int, int, int, int, int, int, int, int); - PyObject *(*find_projection)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int *); - int *(*int_arr_extend)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int *, int *, int *, int); - PyObject *(*extract_phrases)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int); - PyObject *(*create_alignments)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *); - PyObject *(*extract)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_t_8_cdec_sa_Matching *, int *, int); +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":24 + * self.children = {} + * + * cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<< + * cdef public phrase + * cdef public phrase_location + */ +struct __pyx_obj_3_sa_ExtendedTrieNode { + struct __pyx_obj_3_sa_TrieNode __pyx_base; + PyObject *phrase; + PyObject *phrase_location; + PyObject *suffix_link; }; -static struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *__pyx_vtabptr_8_cdec_sa_HieroCachingRuleFactory; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":188 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":109 + * trie_node_to_map(edge.node, result, prefix, include_zeros) * + * cdef class TrieMap: # <<<<<<<<<<<<<< * - * cdef class Precomputation: # <<<<<<<<<<<<<< - * cdef int precompute_rank - * cdef int precompute_secondary_rank + * cdef _Trie_Node** root */ +struct __pyx_obj_3_sa_TrieMap { + PyObject_HEAD + struct __pyx_vtabstruct_3_sa_TrieMap *__pyx_vtab; + struct __pyx_t_3_sa__Trie_Node **root; + int V; +}; + -struct __pyx_vtabstruct_8_cdec_sa_Precomputation { - PyObject *(*read_map)(struct __pyx_obj_8_cdec_sa_Precomputation *, FILE *); - PyObject *(*write_map)(struct __pyx_obj_8_cdec_sa_Precomputation *, PyObject *, FILE *); +/* "_sa.pxd":1 + * cdef class Phrase: # <<<<<<<<<<<<<< + * cdef int *syms + * cdef int n, *varpos, n_vars + */ +struct __pyx_obj_3_sa_Phrase { + PyObject_HEAD + struct __pyx_vtabstruct_3_sa_Phrase *__pyx_vtab; + int *syms; + int n; + int *varpos; + int n_vars; }; -static struct __pyx_vtabstruct_8_cdec_sa_Precomputation *__pyx_vtabptr_8_cdec_sa_Precomputation; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":56 - * # in the suffix array; if discontiguous, it is the set of - * # actual locations (packed into an array) - * cdef class PhraseLocation: # <<<<<<<<<<<<<< - * cdef int sa_low - * cdef int sa_high +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":35 + * + * + * cdef class TrieTable: # <<<<<<<<<<<<<< + * cdef public int extended + * cdef public int count */ +struct __pyx_obj_3_sa_TrieTable { + PyObject_HEAD + int extended; + int count; + PyObject *root; +}; + -struct __pyx_vtabstruct_8_cdec_sa_PhraseLocation { - int (*contains)(struct __pyx_obj_8_cdec_sa_PhraseLocation *, int); +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/float_list.pxi":9 + * from libc.string cimport memset, strcpy, strlen + * + * cdef class FloatList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment + */ +struct __pyx_obj_3_sa_FloatList { + PyObject_HEAD + struct __pyx_vtabstruct_3_sa_FloatList *__pyx_vtab; + int size; + int increment; + int len; + float *arr; }; -static struct __pyx_vtabstruct_8_cdec_sa_PhraseLocation *__pyx_vtabptr_8_cdec_sa_PhraseLocation; + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/str_map.pxi":8 @@ -1106,11 +1047,57 @@ static struct __pyx_vtabstruct_8_cdec_sa_PhraseLocation *__pyx_vtabptr_8_cdec_sa * cdef char *word(self, int i) */ -struct __pyx_vtabstruct_8_cdec_sa_StringMap { - char *(*word)(struct __pyx_obj_8_cdec_sa_StringMap *, int); - int (*index)(struct __pyx_obj_8_cdec_sa_StringMap *, char *); +struct __pyx_vtabstruct_3_sa_StringMap { + char *(*word)(struct __pyx_obj_3_sa_StringMap *, int); + int (*index)(struct __pyx_obj_3_sa_StringMap *, char *); +}; +static struct __pyx_vtabstruct_3_sa_StringMap *__pyx_vtabptr_3_sa_StringMap; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":9 + * from libc.string cimport memset, strcpy, strlen + * + * cdef class DataArray: # <<<<<<<<<<<<<< + * cdef word2id + * cdef id2word + */ + +struct __pyx_vtabstruct_3_sa_DataArray { + void (*read_handle)(struct __pyx_obj_3_sa_DataArray *, FILE *); + void (*write_handle)(struct __pyx_obj_3_sa_DataArray *, FILE *); }; -static struct __pyx_vtabstruct_8_cdec_sa_StringMap *__pyx_vtabptr_8_cdec_sa_StringMap; +static struct __pyx_vtabstruct_3_sa_DataArray *__pyx_vtabptr_3_sa_DataArray; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":109 + * trie_node_to_map(edge.node, result, prefix, include_zeros) + * + * cdef class TrieMap: # <<<<<<<<<<<<<< + * + * cdef _Trie_Node** root + */ + +struct __pyx_vtabstruct_3_sa_TrieMap { + struct __pyx_t_3_sa__Trie_Node *(*_insert)(struct __pyx_obj_3_sa_TrieMap *, int *, int); + struct __pyx_t_3_sa__Trie_Node *(*_contains)(struct __pyx_obj_3_sa_TrieMap *, int *, int); +}; +static struct __pyx_vtabstruct_3_sa_TrieMap *__pyx_vtabptr_3_sa_TrieMap; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":8 + * # May need to revisit if things get really tight, though. + * + * cdef class Alignment: # <<<<<<<<<<<<<< + * cdef IntList links + * cdef IntList sent_index + */ + +struct __pyx_vtabstruct_3_sa_Alignment { + int (*link)(struct __pyx_obj_3_sa_Alignment *, int, int); + PyObject *(*_unlink)(struct __pyx_obj_3_sa_Alignment *, int, int *, int *); + int *(*_get_sent_links)(struct __pyx_obj_3_sa_Alignment *, int, int *); +}; +static struct __pyx_vtabstruct_3_sa_Alignment *__pyx_vtabptr_3_sa_Alignment; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":47 @@ -1121,82 +1108,79 @@ static struct __pyx_vtabstruct_8_cdec_sa_StringMap *__pyx_vtabptr_8_cdec_sa_Stri * cdef FloatList col2 */ -struct __pyx_vtabstruct_8_cdec_sa_BiLex { - PyObject *(*compute_from_data)(struct __pyx_obj_8_cdec_sa_BiLex *, struct __pyx_obj_8_cdec_sa_SuffixArray *, struct __pyx_obj_8_cdec_sa_DataArray *, struct __pyx_obj_8_cdec_sa_Alignment *); - PyObject *(*_add_node)(struct __pyx_obj_8_cdec_sa_BiLex *, struct __pyx_t_8_cdec_sa__node *, int *, float, int *); - PyObject *(*write_wordlist)(struct __pyx_obj_8_cdec_sa_BiLex *, PyObject *, FILE *); - PyObject *(*read_wordlist)(struct __pyx_obj_8_cdec_sa_BiLex *, PyObject *, PyObject *, FILE *); - PyObject *(*swap)(struct __pyx_obj_8_cdec_sa_BiLex *, int, int); - PyObject *(*qsort)(struct __pyx_obj_8_cdec_sa_BiLex *, int, int, PyObject *); +struct __pyx_vtabstruct_3_sa_BiLex { + PyObject *(*compute_from_data)(struct __pyx_obj_3_sa_BiLex *, struct __pyx_obj_3_sa_SuffixArray *, struct __pyx_obj_3_sa_DataArray *, struct __pyx_obj_3_sa_Alignment *); + PyObject *(*_add_node)(struct __pyx_obj_3_sa_BiLex *, struct __pyx_t_3_sa__node *, int *, float, int *); + PyObject *(*write_wordlist)(struct __pyx_obj_3_sa_BiLex *, PyObject *, FILE *); + PyObject *(*read_wordlist)(struct __pyx_obj_3_sa_BiLex *, PyObject *, PyObject *, FILE *); + PyObject *(*swap)(struct __pyx_obj_3_sa_BiLex *, int, int); + PyObject *(*qsort)(struct __pyx_obj_3_sa_BiLex *, int, int, PyObject *); }; -static struct __pyx_vtabstruct_8_cdec_sa_BiLex *__pyx_vtabptr_8_cdec_sa_BiLex; +static struct __pyx_vtabstruct_3_sa_BiLex *__pyx_vtabptr_3_sa_BiLex; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":354 - * +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":9 + * from libc.string cimport memset, memcpy * - * cdef class VEB: # <<<<<<<<<<<<<< - * cdef _VEB* veb - * cdef int _findsucc(self, int i) + * cdef class IntList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment */ -struct __pyx_vtabstruct_8_cdec_sa_VEB { - int (*_findsucc)(struct __pyx_obj_8_cdec_sa_VEB *, int); - int (*_insert)(struct __pyx_obj_8_cdec_sa_VEB *, int); - int (*_first)(struct __pyx_obj_8_cdec_sa_VEB *); +struct __pyx_vtabstruct_3_sa_IntList { + void (*set)(struct __pyx_obj_3_sa_IntList *, int, int); + void (*_append)(struct __pyx_obj_3_sa_IntList *, int); + void (*_extend)(struct __pyx_obj_3_sa_IntList *, struct __pyx_obj_3_sa_IntList *); + void (*_extend_arr)(struct __pyx_obj_3_sa_IntList *, int *, int); + void (*_clear)(struct __pyx_obj_3_sa_IntList *); + void (*write_handle)(struct __pyx_obj_3_sa_IntList *, FILE *); + void (*read_handle)(struct __pyx_obj_3_sa_IntList *, FILE *); }; -static struct __pyx_vtabstruct_8_cdec_sa_VEB *__pyx_vtabptr_8_cdec_sa_VEB; +static struct __pyx_vtabstruct_3_sa_IntList *__pyx_vtabptr_3_sa_IntList; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":4 * from libc.string cimport strsep, strcpy, strlen * * cdef class Phrase: # <<<<<<<<<<<<<< - * cdef int *syms - * cdef int n, *varpos, n_vars + * + * def __cinit__(self, words): */ -struct __pyx_vtabstruct_8_cdec_sa_Phrase { - int (*chunkpos)(struct __pyx_obj_8_cdec_sa_Phrase *, int); - int (*chunklen)(struct __pyx_obj_8_cdec_sa_Phrase *, int); +struct __pyx_vtabstruct_3_sa_Phrase { + int (*chunkpos)(struct __pyx_obj_3_sa_Phrase *, int); + int (*chunklen)(struct __pyx_obj_3_sa_Phrase *, int); }; -static struct __pyx_vtabstruct_8_cdec_sa_Phrase *__pyx_vtabptr_8_cdec_sa_Phrase; +static struct __pyx_vtabstruct_3_sa_Phrase *__pyx_vtabptr_3_sa_Phrase; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":9 - * from libc.string cimport memset, memcpy - * - * cdef class IntList: # <<<<<<<<<<<<<< - * cdef int size - * cdef int increment +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":56 + * # in the suffix array; if discontiguous, it is the set of + * # actual locations (packed into an array) + * cdef class PhraseLocation: # <<<<<<<<<<<<<< + * cdef int sa_low + * cdef int sa_high */ -struct __pyx_vtabstruct_8_cdec_sa_IntList { - void (*set)(struct __pyx_obj_8_cdec_sa_IntList *, int, int); - void (*_append)(struct __pyx_obj_8_cdec_sa_IntList *, int); - void (*_extend)(struct __pyx_obj_8_cdec_sa_IntList *, struct __pyx_obj_8_cdec_sa_IntList *); - void (*_extend_arr)(struct __pyx_obj_8_cdec_sa_IntList *, int *, int); - void (*_clear)(struct __pyx_obj_8_cdec_sa_IntList *); - void (*write_handle)(struct __pyx_obj_8_cdec_sa_IntList *, FILE *); - void (*read_handle)(struct __pyx_obj_8_cdec_sa_IntList *, FILE *); +struct __pyx_vtabstruct_3_sa_PhraseLocation { + int (*contains)(struct __pyx_obj_3_sa_PhraseLocation *, int); }; -static struct __pyx_vtabstruct_8_cdec_sa_IntList *__pyx_vtabptr_8_cdec_sa_IntList; +static struct __pyx_vtabstruct_3_sa_PhraseLocation *__pyx_vtabptr_3_sa_PhraseLocation; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":8 - * # May need to revisit if things get really tight, though. +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":188 * - * cdef class Alignment: # <<<<<<<<<<<<<< - * cdef IntList links - * cdef IntList sent_index + * + * cdef class Precomputation: # <<<<<<<<<<<<<< + * cdef int precompute_rank + * cdef int precompute_secondary_rank */ -struct __pyx_vtabstruct_8_cdec_sa_Alignment { - int (*link)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int); - PyObject *(*_unlink)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int *, int *); - int *(*_get_sent_links)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int *); +struct __pyx_vtabstruct_3_sa_Precomputation { + PyObject *(*read_map)(struct __pyx_obj_3_sa_Precomputation *, FILE *); + PyObject *(*write_map)(struct __pyx_obj_3_sa_Precomputation *, PyObject *, FILE *); }; -static struct __pyx_vtabstruct_8_cdec_sa_Alignment *__pyx_vtabptr_8_cdec_sa_Alignment; +static struct __pyx_vtabstruct_3_sa_Precomputation *__pyx_vtabptr_3_sa_Precomputation; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/float_list.pxi":9 @@ -1207,65 +1191,96 @@ static struct __pyx_vtabstruct_8_cdec_sa_Alignment *__pyx_vtabptr_8_cdec_sa_Alig * cdef int increment */ -struct __pyx_vtabstruct_8_cdec_sa_FloatList { - void (*set)(struct __pyx_obj_8_cdec_sa_FloatList *, int, float); - void (*write_handle)(struct __pyx_obj_8_cdec_sa_FloatList *, FILE *); - void (*read_handle)(struct __pyx_obj_8_cdec_sa_FloatList *, FILE *); +struct __pyx_vtabstruct_3_sa_FloatList { + void (*set)(struct __pyx_obj_3_sa_FloatList *, int, float); + void (*write_handle)(struct __pyx_obj_3_sa_FloatList *, FILE *); + void (*read_handle)(struct __pyx_obj_3_sa_FloatList *, FILE *); }; -static struct __pyx_vtabstruct_8_cdec_sa_FloatList *__pyx_vtabptr_8_cdec_sa_FloatList; +static struct __pyx_vtabstruct_3_sa_FloatList *__pyx_vtabptr_3_sa_FloatList; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":109 - * trie_node_to_map(edge.node, result, prefix, include_zeros) +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":354 * - * cdef class TrieMap: # <<<<<<<<<<<<<< * - * cdef _Trie_Node** root + * cdef class VEB: # <<<<<<<<<<<<<< + * cdef _VEB* veb + * cdef int _findsucc(self, int i) */ -struct __pyx_vtabstruct_8_cdec_sa_TrieMap { - struct __pyx_t_8_cdec_sa__Trie_Node *(*_insert)(struct __pyx_obj_8_cdec_sa_TrieMap *, int *, int); - struct __pyx_t_8_cdec_sa__Trie_Node *(*_contains)(struct __pyx_obj_8_cdec_sa_TrieMap *, int *, int); +struct __pyx_vtabstruct_3_sa_VEB { + int (*_findsucc)(struct __pyx_obj_3_sa_VEB *, int); + int (*_insert)(struct __pyx_obj_3_sa_VEB *, int); + int (*_first)(struct __pyx_obj_3_sa_VEB *); }; -static struct __pyx_vtabstruct_8_cdec_sa_TrieMap *__pyx_vtabptr_8_cdec_sa_TrieMap; +static struct __pyx_vtabstruct_3_sa_VEB *__pyx_vtabptr_3_sa_VEB; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":9 - * from libc.string cimport memset, strcpy, strlen +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":7 + * cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 * - * cdef class DataArray: # <<<<<<<<<<<<<< - * cdef word2id - * cdef id2word + * cdef class Alphabet: # <<<<<<<<<<<<<< + * cdef readonly StringMap terminals, nonterminals + * cdef int first_nonterminal, last_nonterminal */ -struct __pyx_vtabstruct_8_cdec_sa_DataArray { - void (*read_handle)(struct __pyx_obj_8_cdec_sa_DataArray *, FILE *); - void (*write_handle)(struct __pyx_obj_8_cdec_sa_DataArray *, FILE *); +struct __pyx_vtabstruct_3_sa_Alphabet { + int (*isvar)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*isword)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*getindex)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*setindex)(struct __pyx_obj_3_sa_Alphabet *, int, int); + int (*clearindex)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*match)(struct __pyx_obj_3_sa_Alphabet *, int, int); + char *(*tocat)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*fromcat)(struct __pyx_obj_3_sa_Alphabet *, char *); + char *(*tostring)(struct __pyx_obj_3_sa_Alphabet *, int); + int (*fromstring)(struct __pyx_obj_3_sa_Alphabet *, char *, int); }; -static struct __pyx_vtabstruct_8_cdec_sa_DataArray *__pyx_vtabptr_8_cdec_sa_DataArray; +static struct __pyx_vtabstruct_3_sa_Alphabet *__pyx_vtabptr_3_sa_Alphabet; -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":7 - * cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":201 * - * cdef class Alphabet: # <<<<<<<<<<<<<< - * cdef readonly StringMap terminals, nonterminals - * cdef int first_nonterminal, last_nonterminal + * + * cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<< + * '''This RuleFactory implements a caching + * method using TrieTable, which makes phrase */ -struct __pyx_vtabstruct_8_cdec_sa_Alphabet { - int (*isvar)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*isword)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*getindex)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*setindex)(struct __pyx_obj_8_cdec_sa_Alphabet *, int, int); - int (*clearindex)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*match)(struct __pyx_obj_8_cdec_sa_Alphabet *, int, int); - char *(*tocat)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*fromcat)(struct __pyx_obj_8_cdec_sa_Alphabet *, char *); - char *(*tostring)(struct __pyx_obj_8_cdec_sa_Alphabet *, int); - int (*fromstring)(struct __pyx_obj_8_cdec_sa_Alphabet *, char *, int); +struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory { + PyObject *(*set_idmap)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_DataArray *); + int *(*baeza_yates_helper)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *); + long (*compare_matchings_set)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, struct __pyx_t_3_sa_Matching *, int, int); + long (*compare_matchings)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_t_3_sa_Matching *, struct __pyx_t_3_sa_Matching *, int, int); + int *(*merge_helper)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *); + void (*sort_phrase_loc)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_IntList *, struct __pyx_obj_3_sa_PhraseLocation *, struct __pyx_obj_3_sa_Phrase *); + PyObject *(*intersect_helper)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_obj_3_sa_PhraseLocation *, struct __pyx_obj_3_sa_PhraseLocation *, int); + PyObject *(*loc2str)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_PhraseLocation *); + struct __pyx_obj_3_sa_PhraseLocation *(*intersect)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, PyObject *, PyObject *, struct __pyx_obj_3_sa_Phrase *); + int (*find_fixpoint)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, PyObject *, int *, int *, int *, int *, int, int, int *, int *, int *, int *, int, int, int, int, int, int, int, int, int, int, int); + PyObject *(*find_projection)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int *); + int *(*int_arr_extend)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int *, int *, int); + PyObject *(*extract_phrases)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int); + PyObject *(*create_alignments)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *); + PyObject *(*extract)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_t_3_sa_Matching *, int *, int); }; -static struct __pyx_vtabstruct_8_cdec_sa_Alphabet *__pyx_vtabptr_8_cdec_sa_Alphabet; +static struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *__pyx_vtabptr_3_sa_HieroCachingRuleFactory; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":6 + * from libc.stdio cimport FILE, fclose, fopen + * + * cdef class SuffixArray: # <<<<<<<<<<<<<< + * cdef DataArray darray + * cdef IntList sa + */ + +struct __pyx_vtabstruct_3_sa_SuffixArray { + int (*__pyx___search_high)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int); + int (*__pyx___search_low)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int); + PyObject *(*__pyx___get_range)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int, int); + PyObject *(*__pyx___lookup_helper)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int); +}; +static struct __pyx_vtabstruct_3_sa_SuffixArray *__pyx_vtabptr_3_sa_SuffixArray; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif @@ -1425,42 +1440,47 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } +#if CYTHON_COMPILING_IN_CPYTHON + if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); + Py_INCREF(r); + return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif } #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } +#if CYTHON_COMPILING_IN_CPYTHON + if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); + Py_INCREF(r); + return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif } #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { +#if CYTHON_COMPILING_IN_CPYTHON if (PyList_CheckExact(o)) { Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -1476,13 +1496,22 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) Py_INCREF(r); return r; } - } - else if (likely(i >= 0)) { + } else { /* inlined PySequence_GetItem() */ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { + if (unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (unlikely(l < 0)) return NULL; + i += l; + } return m->sq_item(o, i); } } +#else + if (PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } @@ -1495,11 +1524,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; + if (unlikely(PyList_Append(L, x) < 0)) return NULL; Py_INCREF(Py_None); return Py_None; /* this is just to have an accurate signature */ - } - else { + } else { PyObject *r, *m; m = __Pyx_GetAttrString(L, "append"); if (!m) return NULL; @@ -1515,9 +1543,11 @@ static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ @@ -1532,6 +1562,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyOb return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { +#if CYTHON_COMPILING_IN_CPYTHON if (PyList_CheckExact(o)) { Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) { @@ -1541,26 +1572,74 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje Py_DECREF(old); return 1; } - } - else if (likely(i >= 0)) { + } else { /* inlined PySequence_SetItem() */ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { + if (unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (unlikely(l < 0)) return -1; + i += l; + } return m->sq_ass_item(o, i, v); } } +#else +#if CYTHON_COMPILING_IN_PYPY + if (PySequence_Check(o) && !PyDict_Check(o)) { +#else + if (PySequence_Check(o)) { +#endif + return PySequence_SetItem(o, i, v); + } +#endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj) \ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ + likely(PyInt_CheckExact(obj)) ? \ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else #define __Pyx_PyObject_AsDouble(obj) \ ((likely(PyFloat_CheckExact(obj))) ? \ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /*proto*/ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, + int is_tuple, int has_known_size, int decref_tuple); + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + #if PY_VERSION_HEX < 0x02050000 #ifndef PyAnySet_CheckExact #define PyAnySet_CheckExact(ob) \ @@ -1594,15 +1673,9 @@ static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { #endif /* PyAnySet_CheckExact (<= Py2.4) */ #endif /* < Py2.5 */ -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void); - #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; - if (unlikely(d == Py_None)) { - __Pyx_RaiseNoneIndexingError(); - return NULL; - } value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) @@ -1712,6 +1785,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, #define __Pyx_Generator_USED #include <structmember.h> +#include <frameobject.h> typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *); typedef struct { PyObject_HEAD @@ -1724,13 +1798,22 @@ typedef struct { PyObject *exc_traceback; PyObject *gi_weakreflist; PyObject *classobj; + PyObject *yieldfrom; } __pyx_GeneratorObject; static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject *closure); static int __pyx_Generator_init(void); +static int __Pyx_Generator_clear(PyObject* self); +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) +#endif static int __Pyx_check_binary_version(void); +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ + static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ typedef struct { @@ -1761,76 +1844,80 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from 'libc.math' */ -/* Module declarations from '_cdec_sa' */ -static PyTypeObject *__pyx_ptype_8_cdec_sa_FloatList = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_IntList = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_StringMap = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_DataArray = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Alignment = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_BiLex = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_BitSetIterator = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_BitSet = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_VEBIterator = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_VEB = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_LCP = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Alphabet = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Phrase = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Rule = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_TrieMap = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Precomputation = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_SuffixArray = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_TrieNode = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_ExtendedTrieNode = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_TrieTable = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_PhraseLocation = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_Sampler = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa_HieroCachingRuleFactory = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa___pyx_scope_struct__compute_stats = 0; -static PyTypeObject *__pyx_ptype_8_cdec_sa___pyx_scope_struct_1_input = 0; -static int __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE; -static int __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS; -static int __pyx_v_8_cdec_sa_LOWER_MASK[32]; -static int __pyx_v_8_cdec_sa_INDEX_SHIFT; -static int __pyx_v_8_cdec_sa_INDEX_MASK; -static struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_8_cdec_sa_ALPHABET = 0; -static int __pyx_v_8_cdec_sa_PRECOMPUTE; -static int __pyx_v_8_cdec_sa_MERGE; -static int __pyx_v_8_cdec_sa_BAEZA_YATES; -static int __pyx_v_8_cdec_sa_EPSILON; -static float __pyx_f_8_cdec_sa_monitor_cpu(void); /*proto*/ -static struct __pyx_t_8_cdec_sa__node *__pyx_f_8_cdec_sa_new_node(int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *); /*proto*/ -static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *, int); /*proto*/ -static void __pyx_f_8_cdec_sa__init_lower_mask(void); /*proto*/ -static struct __pyx_t_8_cdec_sa__BitSet *__pyx_f_8_cdec_sa_new_BitSet(void); /*proto*/ -static int __pyx_f_8_cdec_sa_bitset_findsucc(struct __pyx_t_8_cdec_sa__BitSet *, int); /*proto*/ -static int __pyx_f_8_cdec_sa_bitset_insert(struct __pyx_t_8_cdec_sa__BitSet *, int); /*proto*/ -static int __pyx_f_8_cdec_sa_bitset_contains(struct __pyx_t_8_cdec_sa__BitSet *, int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_dec2bin(long); /*proto*/ -static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int); /*proto*/ -static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *, int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *); /*proto*/ -static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *, int); /*proto*/ -static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *, int); /*proto*/ -static int __pyx_f_8_cdec_sa_sym_setindex(int, int); /*proto*/ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_new_trie_node(void); /*proto*/ -static struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_f_8_cdec_sa_new_trie_edge(int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_free_trie_node(struct __pyx_t_8_cdec_sa__Trie_Node *); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie_Edge *); /*proto*/ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_find(struct __pyx_t_8_cdec_sa__Trie_Node *, int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_trie_node_data_append(struct __pyx_t_8_cdec_sa__Trie_Node *, int); /*proto*/ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_insert(struct __pyx_t_8_cdec_sa__Trie_Node *, int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Trie_Node *, PyObject *, PyObject *, int); /*proto*/ -static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Trie_Edge *, PyObject *, PyObject *, int); /*proto*/ -static void __pyx_f_8_cdec_sa_assign_matching(struct __pyx_t_8_cdec_sa_Matching *, int *, int, int, int *); /*proto*/ -static int *__pyx_f_8_cdec_sa_append_combined_matching(int *, struct __pyx_t_8_cdec_sa_Matching *, struct __pyx_t_8_cdec_sa_Matching *, int, int, int *); /*proto*/ -static int *__pyx_f_8_cdec_sa_extend_arr(int *, int *, int *, int); /*proto*/ -static int __pyx_f_8_cdec_sa_median(int, int, int); /*proto*/ -static void __pyx_f_8_cdec_sa_find_comparable_matchings(int, int, int *, int, int, int *, int *); /*proto*/ -#define __Pyx_MODULE_NAME "_cdec_sa" -int __pyx_module_is_main__cdec_sa = 0; - -/* Implementation of '_cdec_sa' */ +/* Module declarations from '_sa' */ +static PyTypeObject *__pyx_ptype_3_sa_Phrase = 0; +static PyTypeObject *__pyx_ptype_3_sa_Rule = 0; +static PyTypeObject *__pyx_ptype_3_sa_FloatList = 0; +static PyTypeObject *__pyx_ptype_3_sa_IntList = 0; +static PyTypeObject *__pyx_ptype_3_sa_StringMap = 0; +static PyTypeObject *__pyx_ptype_3_sa_DataArray = 0; +static PyTypeObject *__pyx_ptype_3_sa_Alignment = 0; +static PyTypeObject *__pyx_ptype_3_sa_BiLex = 0; +static PyTypeObject *__pyx_ptype_3_sa_BitSetIterator = 0; +static PyTypeObject *__pyx_ptype_3_sa_BitSet = 0; +static PyTypeObject *__pyx_ptype_3_sa_VEBIterator = 0; +static PyTypeObject *__pyx_ptype_3_sa_VEB = 0; +static PyTypeObject *__pyx_ptype_3_sa_LCP = 0; +static PyTypeObject *__pyx_ptype_3_sa_Alphabet = 0; +static PyTypeObject *__pyx_ptype_3_sa_TrieMap = 0; +static PyTypeObject *__pyx_ptype_3_sa_Precomputation = 0; +static PyTypeObject *__pyx_ptype_3_sa_SuffixArray = 0; +static PyTypeObject *__pyx_ptype_3_sa_TrieNode = 0; +static PyTypeObject *__pyx_ptype_3_sa_ExtendedTrieNode = 0; +static PyTypeObject *__pyx_ptype_3_sa_TrieTable = 0; +static PyTypeObject *__pyx_ptype_3_sa_PhraseLocation = 0; +static PyTypeObject *__pyx_ptype_3_sa_Sampler = 0; +static PyTypeObject *__pyx_ptype_3_sa_HieroCachingRuleFactory = 0; +static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct__compute_stats = 0; +static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_1___iter__ = 0; +static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_2_input = 0; +static int __pyx_v_3_sa_MIN_BOTTOM_SIZE; +static int __pyx_v_3_sa_MIN_BOTTOM_BITS; +static int __pyx_v_3_sa_LOWER_MASK[32]; +static int __pyx_v_3_sa_INDEX_SHIFT; +static int __pyx_v_3_sa_INDEX_MASK; +static struct __pyx_obj_3_sa_Alphabet *__pyx_v_3_sa_ALPHABET = 0; +static int __pyx_v_3_sa_PRECOMPUTE; +static int __pyx_v_3_sa_MERGE; +static int __pyx_v_3_sa_BAEZA_YATES; +static int __pyx_v_3_sa_EPSILON; +static char *__pyx_f_3_sa_sym_tostring(int); /*proto*/ +static int __pyx_f_3_sa_sym_isvar(int); /*proto*/ +static int __pyx_f_3_sa_sym_getindex(int); /*proto*/ +static float __pyx_f_3_sa_monitor_cpu(void); /*proto*/ +static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int); /*proto*/ +static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *); /*proto*/ +static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *, int); /*proto*/ +static void __pyx_f_3_sa__init_lower_mask(void); /*proto*/ +static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void); /*proto*/ +static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *, int); /*proto*/ +static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *, int); /*proto*/ +static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *, int); /*proto*/ +static PyObject *__pyx_f_3_sa_dec2bin(long); /*proto*/ +static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int); /*proto*/ +static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *, int); /*proto*/ +static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *); /*proto*/ +static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *, int); /*proto*/ +static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *, int); /*proto*/ +static int __pyx_f_3_sa_sym_setindex(int, int); /*proto*/ +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void); /*proto*/ +static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int); /*proto*/ +static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *); /*proto*/ +static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *); /*proto*/ +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_sa__Trie_Node *, int); /*proto*/ +static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_Node *, int); /*proto*/ +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3_sa__Trie_Node *, int); /*proto*/ +static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *, PyObject *, PyObject *, int); /*proto*/ +static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *, PyObject *, PyObject *, int); /*proto*/ +static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *, int *, int, int, int *); /*proto*/ +static int *__pyx_f_3_sa_append_combined_matching(int *, struct __pyx_t_3_sa_Matching *, struct __pyx_t_3_sa_Matching *, int, int, int *); /*proto*/ +static int *__pyx_f_3_sa_extend_arr(int *, int *, int *, int); /*proto*/ +static int __pyx_f_3_sa_median(int, int, int); /*proto*/ +static void __pyx_f_3_sa_find_comparable_matchings(int, int, int *, int, int, int *, int *); /*proto*/ +#define __Pyx_MODULE_NAME "_sa" +int __pyx_module_is_main__sa = 0; + +/* Implementation of '_sa' */ static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_range; @@ -1843,187 +1930,186 @@ static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_cmp; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_sorted; -static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename); /* proto */ -static int __pyx_pf_8_cdec_sa_9FloatList___cinit__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len); /* proto */ -static void __pyx_pf_8_cdec_sa_9FloatList_2__dealloc__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_4__getitem__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static int __pyx_pf_8_cdec_sa_9FloatList_6__setitem__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_9FloatList_8__len__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_10append(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, float __pyx_v_val); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_12write(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_14read(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static int __pyx_pf_8_cdec_sa_7IntList___cinit__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_2__str__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_4index(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_6partition(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_8_doquicksort(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_10sort(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_12reset(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static void __pyx_pf_8_cdec_sa_7IntList_14__dealloc__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_16__getitem__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ -static int __pyx_pf_8_cdec_sa_7IntList_18__setitem__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_7IntList_20__len__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_22getSize(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_24append(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_val); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_26extend(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_28write(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_30read(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static int __pyx_pf_8_cdec_sa_9StringMap___cinit__(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self); /* proto */ -static void __pyx_pf_8_cdec_sa_9StringMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, int __pyx_v_use_sent_id); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_9DataArray_2__len__(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_4getSentId(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_6getSent(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_8getSentPos(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_10get_id(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_12get_word(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_18read_binary(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_20write_binary(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id); /* proto */ -static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_8read_binary(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_12write_binary(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_16alignment(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_from_text, PyObject *__pyx_v_from_data, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_earray, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_alignment); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_6get_e_id(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_8get_f_id(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_14get_score(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword, PyObject *__pyx_v_eword, PyObject *__pyx_v_col); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_16write_text(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_14BitSetIterator___next__(struct __pyx_obj_8_cdec_sa_BitSetIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_6BitSet___cinit__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static void __pyx_pf_8_cdec_sa_6BitSet_2__dealloc__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_4__iter__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_6insert(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_8findsucc(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_10__str__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_12min(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_14max(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_6BitSet_16__len__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_6BitSet_18__contains__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11VEBIterator___next__(struct __pyx_obj_8_cdec_sa_VEBIterator *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_3VEB___cinit__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, int __pyx_v_size); /* proto */ -static void __pyx_pf_8_cdec_sa_3VEB_2__dealloc__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_4__iter__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_6insert(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_8findsucc(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_3VEB_10__len__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_3VEB_12__contains__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static int __pyx_pf_8_cdec_sa_3LCP___cinit__(struct __pyx_obj_8_cdec_sa_LCP *__pyx_v_self, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sa); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_3LCP_2compute_stats(struct __pyx_obj_8_cdec_sa_LCP *__pyx_v_self, int __pyx_v_max_n); /* proto */ -static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self); /* proto */ -static void __pyx_pf_8_cdec_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_9terminals___get__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_2sym_tostring(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sym); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4sym_fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, int __pyx_v_terminal); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6sym_isvar(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sym); /* proto */ -static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words); /* proto */ -static void __pyx_pf_8_cdec_sa_6Phrase_2__dealloc__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_4__str__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_k); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_ci); /* proto */ +static PyObject *__pyx_pf_3_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename); /* proto */ +static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len); /* proto */ +static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static int __pyx_pf_3_sa_9FloatList_6__setitem__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_9FloatList_8__len__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, float __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_10sort(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_12reset(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static void __pyx_pf_3_sa_7IntList_14__dealloc__(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_16__getitem__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_pf_3_sa_7IntList_18__setitem__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_7IntList_20__len__(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_22getSize(struct __pyx_obj_3_sa_IntList *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_24append(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_val); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_26extend(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_28write(struct __pyx_obj_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_7IntList_30read(struct __pyx_obj_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *__pyx_v_self); /* proto */ +static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMap *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, int __pyx_v_use_sent_id); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_4getSentId(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_6getSent(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_8getSentPos(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_12get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_18read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_20write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_22write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f); /* proto */ +static PyObject *__pyx_pf_3_sa_9DataArray_24write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id); /* proto */ +static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_from_text, PyObject *__pyx_v_from_data, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_earray, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_alignment); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword, PyObject *__pyx_v_eword, PyObject *__pyx_v_col); /* proto */ +static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_BitSetIterator *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_6BitSet___cinit__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static void __pyx_pf_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_6insert(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_8findsucc(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_10__str__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_12min(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6BitSet_14max(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_6BitSet_16__len__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBIterator *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_3VEB___cinit__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, int __pyx_v_size); /* proto */ +static void __pyx_pf_3_sa_3VEB_2__dealloc__(struct __pyx_obj_3_sa_VEB *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_3VEB_10__len__(struct __pyx_obj_3_sa_VEB *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sa); /* proto */ +static PyObject *__pyx_pf_3_sa_3LCP_2compute_stats(struct __pyx_obj_3_sa_LCP *__pyx_v_self, int __pyx_v_max_n); /* proto */ +static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */ +static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_8Alphabet_9terminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_2sym_fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, int __pyx_v_terminal); /* proto */ +static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words); /* proto */ +static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_10arity(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_16clen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_k); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_ci); /* proto */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif -static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static Py_ssize_t __pyx_pf_8_cdec_sa_6Phrase_24__len__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_26__getitem__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_28__iter__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children); /* proto */ -static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, int __pyx_v_lhs, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_f, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_word_alignments); /* proto */ -static void __pyx_pf_8_cdec_sa_4Rule_2__dealloc__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ +static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_3_sa_6Phrase_24__len__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_26__getitem__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_28__iter__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children); /* proto */ +static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, int __pyx_v_lhs, struct __pyx_obj_3_sa_Phrase *__pyx_v_f, struct __pyx_obj_3_sa_Phrase *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_word_alignments); /* proto */ +static void __pyx_pf_3_sa_4Rule_2__dealloc__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static Py_hash_t __pyx_pf_3_sa_4Rule_4__hash__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_other); /* proto */ +static int __pyx_pf_3_sa_4Rule_6__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Rule *__pyx_v_other); /* proto */ #endif -static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_10fmerge(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_f); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_3lhs___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_4Rule_3lhs_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_1f___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_1e___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_15word_alignments___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_4__del__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_7TrieMap___cinit__(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, int __pyx_v_alphabet_size); /* proto */ -static void __pyx_pf_8_cdec_sa_7TrieMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ -static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_from_stats, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_precompute_rank, PyObject *__pyx_v_precompute_secondary_rank, PyObject *__pyx_v_max_length, PyObject *__pyx_v_max_nonterminals, PyObject *__pyx_v_train_max_initial_size, PyObject *__pyx_v_train_min_gap_size); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sarray); /* proto */ -static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_6getSent(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_14write_text(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */ -static int __pyx_pf_8_cdec_sa_8TrieNode___cinit__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_8TrieNode_8children___get__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_8TrieNode_8children_2__set__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_8TrieNode_8children_4__del__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_phrase, PyObject *__pyx_v_phrase_location, PyObject *__pyx_v_suffix_link); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_extended); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_8extended___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_5count___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_9TrieTable_5count_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_4root___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_9TrieTable_4root_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_8_cdec_sa_9TrieTable_4root_4__del__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self); /* proto */ -static int __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_self, int __pyx_v_sa_low, int __pyx_v_sa_high, int __pyx_v_arr_low, int __pyx_v_arr_high, PyObject *__pyx_v_arr, int __pyx_v_num_subpatterns); /* proto */ -static int __pyx_pf_8_cdec_sa_7Sampler___cinit__(struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_self, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_phrase_location); /* proto */ -static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_alignment, float __pyx_v_by_slack_factor, char *__pyx_v_category, PyObject *__pyx_v_max_chunks, unsigned int __pyx_v_max_initial_size, unsigned int __pyx_v_max_length, unsigned int __pyx_v_max_nonterminals, PyObject *__pyx_v_max_target_chunks, PyObject *__pyx_v_max_target_length, unsigned int __pyx_v_min_gap_size, PyObject *__pyx_v_precompute_file, unsigned int __pyx_v_precompute_secondary_rank, unsigned int __pyx_v_precompute_rank, int __pyx_v_require_aligned_terminal, int __pyx_v_require_aligned_chunks, unsigned int __pyx_v_train_max_initial_size, unsigned int __pyx_v_train_min_gap_size, int __pyx_v_tight_phrases, int __pyx_v_use_baeza_yates, int __pyx_v_use_collocations, int __pyx_v_use_index); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_sampler); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_phrase); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_frontier, PyObject *__pyx_v_res, PyObject *__pyx_v_fwords); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_skip, PyObject *__pyx_v_i, PyObject *__pyx_v_spanlen, PyObject *__pyx_v_pathlen, PyObject *__pyx_v_fwords, PyObject *__pyx_v_next_states, PyObject *__pyx_v_reachable_buffer); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist); /* proto */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_models); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_8__iadd__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Rule *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_10fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Phrase *__pyx_v_f); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_12arity(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_14__str__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_6scores___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_4Rule_6scores_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_3lhs___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_4Rule_3lhs_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_1f___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_1e___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_4Rule_15word_alignments___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_4Rule_15word_alignments_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_4Rule_15word_alignments_4__del__(struct __pyx_obj_3_sa_Rule *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, int __pyx_v_alphabet_size); /* proto */ +static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ +static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ +static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ +static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_from_stats, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_precompute_rank, PyObject *__pyx_v_precompute_secondary_rank, PyObject *__pyx_v_max_length, PyObject *__pyx_v_max_nonterminals, PyObject *__pyx_v_train_max_initial_size, PyObject *__pyx_v_train_min_gap_size); /* proto */ +static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray); /* proto */ +static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_4getSentId(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_6getSent(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_8getSentPos(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename); /* proto */ +static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */ +static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_8TrieNode_8children___get__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_8TrieNode_8children_4__del__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_phrase, PyObject *__pyx_v_phrase_location, PyObject *__pyx_v_suffix_link); /* proto */ +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_6phrase___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_extended); /* proto */ +static PyObject *__pyx_pf_3_sa_9TrieTable_8extended___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_3_sa_9TrieTable_5count___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_3_sa_9TrieTable_4root___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_9TrieTable_4root_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self); /* proto */ +static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_self, int __pyx_v_sa_low, int __pyx_v_sa_high, int __pyx_v_arr_low, int __pyx_v_arr_high, PyObject *__pyx_v_arr, int __pyx_v_num_subpatterns); /* proto */ +static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray); /* proto */ +static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *__pyx_v_self, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_phrase_location); /* proto */ +static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_Alignment *__pyx_v_alignment, float __pyx_v_by_slack_factor, char *__pyx_v_category, PyObject *__pyx_v_max_chunks, unsigned int __pyx_v_max_initial_size, unsigned int __pyx_v_max_length, unsigned int __pyx_v_max_nonterminals, PyObject *__pyx_v_max_target_chunks, PyObject *__pyx_v_max_target_length, unsigned int __pyx_v_min_gap_size, PyObject *__pyx_v_precompute_file, unsigned int __pyx_v_precompute_secondary_rank, unsigned int __pyx_v_precompute_rank, int __pyx_v_require_aligned_terminal, int __pyx_v_require_aligned_chunks, unsigned int __pyx_v_train_max_initial_size, unsigned int __pyx_v_train_min_gap_size, int __pyx_v_tight_phrases, int __pyx_v_use_baeza_yates, int __pyx_v_use_collocations, int __pyx_v_use_index); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_3_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_3_sa_Sampler *__pyx_v_sampler); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_phrase); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_frontier, PyObject *__pyx_v_res, PyObject *__pyx_v_fwords); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_skip, PyObject *__pyx_v_i, PyObject *__pyx_v_spanlen, PyObject *__pyx_v_pathlen, PyObject *__pyx_v_fwords, PyObject *__pyx_v_next_states, PyObject *__pyx_v_reachable_buffer); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist); /* proto */ +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_models); /* proto */ static char __pyx_k_1[] = ".gz"; static char __pyx_k_2[] = "Requested index %d of %d-length FloatList"; static char __pyx_k_3[] = "IntList["; @@ -2116,12 +2202,13 @@ static char __pyx_k_128[] = "Inside edges of following subphrase are not tight"; static char __pyx_k_129[] = "Subphrase [%d, %d] failed integrity check"; static char __pyx_k_130[] = "Didn't extract anything from [%d, %d] -> [%d, %d]"; static char __pyx_k_131[] = "Unable to extract basic phrase"; -static char __pyx_k_134[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/_cdec_sa.pyx"; +static char __pyx_k_134[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/_sa.pyx"; static char __pyx_k_135[] = "cdec.sa"; static char __pyx_k_139[] = "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi"; -static char __pyx_k_144[] = "*EPS*"; +static char __pyx_k_140[] = "*EPS*"; static char __pyx_k__gc[] = "gc"; static char __pyx_k__sa[] = "sa"; +static char __pyx_k___sa[] = "_sa"; static char __pyx_k__arr[] = "arr"; static char __pyx_k__cmp[] = "cmp"; static char __pyx_k__col[] = "col"; @@ -2133,7 +2220,6 @@ static char __pyx_k__low[] = "low"; static char __pyx_k__map[] = "map"; static char __pyx_k__pad[] = "pad"; static char __pyx_k__res[] = "res"; -static char __pyx_k__sym[] = "sym"; static char __pyx_k__zip[] = "zip"; static char __pyx_k__NULL[] = "NULL"; static char __pyx_k__dist[] = "dist"; @@ -2197,7 +2283,6 @@ static char __pyx_k__GzipFile[] = "GzipFile"; static char __pyx_k____exit__[] = "__exit__"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___cdec_sa[] = "_cdec_sa"; static char __pyx_k___columns[] = "_columns"; static char __pyx_k__arr_high[] = "arr_high"; static char __pyx_k__category[] = "category"; @@ -2231,7 +2316,6 @@ static char __pyx_k__iteritems[] = "iteritems"; static char __pyx_k__partition[] = "partition"; static char __pyx_k__reachable[] = "reachable"; static char __pyx_k__read_text[] = "read_text"; -static char __pyx_k__sym_isvar[] = "sym_isvar"; static char __pyx_k__use_index[] = "use_index"; static char __pyx_k__IndexError[] = "IndexError"; static char __pyx_k__ValueError[] = "ValueError"; @@ -2256,7 +2340,6 @@ static char __pyx_k__use_sent_id[] = "use_sent_id"; static char __pyx_k___doquicksort[] = "_doquicksort"; static char __pyx_k__gzip_or_text[] = "gzip_or_text"; static char __pyx_k__min_gap_size[] = "min_gap_size"; -static char __pyx_k__sym_tostring[] = "sym_tostring"; static char __pyx_k__StopIteration[] = "StopIteration"; static char __pyx_k__alphabet_size[] = "alphabet_size"; static char __pyx_k__tight_phrases[] = "tight_phrases"; @@ -2312,7 +2395,7 @@ static PyObject *__pyx_kp_s_134; static PyObject *__pyx_kp_s_135; static PyObject *__pyx_kp_s_139; static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_144; +static PyObject *__pyx_kp_s_140; static PyObject *__pyx_kp_s_18; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_22; @@ -2380,9 +2463,9 @@ static PyObject *__pyx_n_s____enter__; static PyObject *__pyx_n_s____exit__; static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___cdec_sa; static PyObject *__pyx_n_s___columns; static PyObject *__pyx_n_s___doquicksort; +static PyObject *__pyx_n_s___sa; static PyObject *__pyx_n_s__advance; static PyObject *__pyx_n_s__alignment; static PyObject *__pyx_n_s__alphabet_size; @@ -2508,10 +2591,7 @@ static PyObject *__pyx_n_s__stats; static PyObject *__pyx_n_s__stop; static PyObject *__pyx_n_s__string; static PyObject *__pyx_n_s__suffix_link; -static PyObject *__pyx_n_s__sym; static PyObject *__pyx_n_s__sym_fromstring; -static PyObject *__pyx_n_s__sym_isvar; -static PyObject *__pyx_n_s__sym_tostring; static PyObject *__pyx_n_s__terminal; static PyObject *__pyx_n_s__tight_phrases; static PyObject *__pyx_n_s__toMap; @@ -2589,14 +2669,10 @@ static PyObject *__pyx_k_tuple_120; static PyObject *__pyx_k_tuple_132; static PyObject *__pyx_k_tuple_136; static PyObject *__pyx_k_tuple_137; -static PyObject *__pyx_k_tuple_140; -static PyObject *__pyx_k_tuple_142; static PyObject *__pyx_k_codeobj_133; static PyObject *__pyx_k_codeobj_138; -static PyObject *__pyx_k_codeobj_141; -static PyObject *__pyx_k_codeobj_143; -/* "_cdec_sa.pyx":5 +/* "_sa.pyx":5 * import gzip * * cdef float monitor_cpu(): # <<<<<<<<<<<<<< @@ -2604,7 +2680,7 @@ static PyObject *__pyx_k_codeobj_143; * resource.getrusage(resource.RUSAGE_SELF).ru_stime) */ -static float __pyx_f_8_cdec_sa_monitor_cpu(void) { +static float __pyx_f_3_sa_monitor_cpu(void) { float __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2617,7 +2693,7 @@ static float __pyx_f_8_cdec_sa_monitor_cpu(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor_cpu", 0); - /* "_cdec_sa.pyx":6 + /* "_sa.pyx":6 * * cdef float monitor_cpu(): * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ # <<<<<<<<<<<<<< @@ -2647,7 +2723,7 @@ static float __pyx_f_8_cdec_sa_monitor_cpu(void) { __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "_cdec_sa.pyx":7 + /* "_sa.pyx":7 * cdef float monitor_cpu(): * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime) # <<<<<<<<<<<<<< @@ -2692,7 +2768,7 @@ static float __pyx_f_8_cdec_sa_monitor_cpu(void) { __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("_cdec_sa.monitor_cpu", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.monitor_cpu", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -2700,29 +2776,28 @@ static float __pyx_f_8_cdec_sa_monitor_cpu(void) { } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyMethodDef __pyx_mdef_8_cdec_sa_1gzip_or_text = {__Pyx_NAMESTR("gzip_or_text"), (PyCFunction)__pyx_pw_8_cdec_sa_1gzip_or_text, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_8_cdec_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyMethodDef __pyx_mdef_3_sa_1gzip_or_text = {__Pyx_NAMESTR("gzip_or_text"), (PyCFunction)__pyx_pw_3_sa_1gzip_or_text, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gzip_or_text (wrapper)", 0); - __pyx_self = __pyx_self; assert(__pyx_arg_filename); { __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.gzip_or_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.gzip_or_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_gzip_or_text(__pyx_self, ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_gzip_or_text(__pyx_self, ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "_cdec_sa.pyx":9 +/* "_sa.pyx":9 * resource.getrusage(resource.RUSAGE_SELF).ru_stime) * * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< @@ -2730,7 +2805,7 @@ static PyObject *__pyx_pw_8_cdec_sa_1gzip_or_text(PyObject *__pyx_self, PyObject * return gzip.GzipFile(filename) */ -static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2742,7 +2817,7 @@ static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gzip_or_text", 0); - /* "_cdec_sa.pyx":10 + /* "_sa.pyx":10 * * def gzip_or_text(char* filename): * if filename.endswith('.gz'): # <<<<<<<<<<<<<< @@ -2755,7 +2830,7 @@ static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_s __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "_cdec_sa.pyx":11 + /* "_sa.pyx":11 * def gzip_or_text(char* filename): * if filename.endswith('.gz'): * return gzip.GzipFile(filename) # <<<<<<<<<<<<<< @@ -2786,7 +2861,7 @@ static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_s } /*else*/ { - /* "_cdec_sa.pyx":13 + /* "_sa.pyx":13 * return gzip.GzipFile(filename) * else: * return open(filename) # <<<<<<<<<<<<<< @@ -2816,7 +2891,7 @@ static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_s __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.gzip_or_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.gzip_or_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2825,16 +2900,16 @@ static PyObject *__pyx_pf_8_cdec_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_s } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -2867,18 +2942,6 @@ static int __pyx_pw_8_cdec_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyOb if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[0]) { - } else { - __pyx_v_size = ((int)0); - } - if (values[1]) { - } else { - __pyx_v_increment = ((int)1); - } - if (values[2]) { - } else { - __pyx_v_initial_len = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -2908,11 +2971,11 @@ static int __pyx_pw_8_cdec_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyOb __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.FloatList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList___cinit__(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); + __pyx_r = __pyx_pf_3_sa_9FloatList___cinit__(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2925,7 +2988,7 @@ static int __pyx_pw_8_cdec_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyOb * size = initial_len */ -static int __pyx_pf_8_cdec_sa_9FloatList___cinit__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len) { +static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3004,11 +3067,11 @@ static int __pyx_pf_8_cdec_sa_9FloatList___cinit__(struct __pyx_obj_8_cdec_sa_Fl } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_9FloatList_2__dealloc__(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self)); + __pyx_pf_3_sa_9FloatList_2__dealloc__(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -3020,7 +3083,7 @@ static void __pyx_pw_8_cdec_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_9FloatList_2__dealloc__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self) { +static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); @@ -3037,12 +3100,12 @@ static void __pyx_pf_8_cdec_sa_9FloatList_2__dealloc__(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_4__getitem__(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_9FloatList_4__getitem__(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3055,7 +3118,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_5__getitem__(PyObject *__pyx_v_se * if i<0: */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_4__getitem__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_v_j = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3192,7 +3255,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_4__getitem__(struct __pyx_obj_8_c __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.FloatList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_j); @@ -3209,7 +3272,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_4__getitem__(struct __pyx_obj_8_c * if i<0: */ -static void __pyx_f_8_cdec_sa_9FloatList_set(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, int __pyx_v_i, float __pyx_v_v) { +static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, int __pyx_v_i, float __pyx_v_v) { int __pyx_v_j; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3321,18 +3384,18 @@ static void __pyx_f_8_cdec_sa_9FloatList_set(struct __pyx_obj_8_cdec_sa_FloatLis __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("_cdec_sa.FloatList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.FloatList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ -static int __pyx_pw_8_cdec_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { +static int __pyx_pw_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_6__setitem__(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); + __pyx_r = __pyx_pf_3_sa_9FloatList_6__setitem__(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3345,7 +3408,7 @@ static int __pyx_pw_8_cdec_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, Py * */ -static int __pyx_pf_8_cdec_sa_9FloatList_6__setitem__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { +static int __pyx_pf_3_sa_9FloatList_6__setitem__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3364,12 +3427,12 @@ static int __pyx_pf_8_cdec_sa_9FloatList_6__setitem__(struct __pyx_obj_8_cdec_sa */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_val); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.FloatList.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -3377,12 +3440,12 @@ static int __pyx_pf_8_cdec_sa_9FloatList_6__setitem__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_9FloatList_9__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_9FloatList_9__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_8__len__(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9FloatList_8__len__(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3395,7 +3458,7 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_9FloatList_9__len__(PyObject *__pyx_v_self) * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_9FloatList_8__len__(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_9FloatList_8__len__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); @@ -3417,8 +3480,8 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_9FloatList_8__len__(struct __pyx_obj_8_cdec } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { +static PyObject *__pyx_pw_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { float __pyx_v_val; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -3428,11 +3491,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_11append(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.FloatList.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.append", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_10append(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), ((float)__pyx_v_val)); + __pyx_r = __pyx_pf_3_sa_9FloatList_10append(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), ((float)__pyx_v_val)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3445,7 +3508,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_11append(PyObject *__pyx_v_self, * self.size = self.size + self.increment */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_10append(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, float __pyx_v_val) { +static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, float __pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3514,7 +3577,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_10append(struct __pyx_obj_8_cdec_ * fwrite(self.arr, sizeof(float), self.len, f) */ -static void __pyx_f_8_cdec_sa_9FloatList_write_handle(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, FILE *__pyx_v_f) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); @@ -3540,8 +3603,8 @@ static void __pyx_f_8_cdec_sa_9FloatList_write_handle(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -3551,11 +3614,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_13write(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.FloatList.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_12write(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9FloatList_12write(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3568,7 +3631,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_13write(PyObject *__pyx_v_self, P * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_12write(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3590,7 +3653,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_12write(struct __pyx_obj_8_cdec_s * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/float_list.pxi":64 * f = fopen(filename, "w") @@ -3615,7 +3678,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_12write(struct __pyx_obj_8_cdec_s * fread(&(self.len), sizeof(float), 1, f) */ -static void __pyx_f_8_cdec_sa_9FloatList_read_handle(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, FILE *__pyx_v_f) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); @@ -3668,8 +3731,8 @@ static void __pyx_f_8_cdec_sa_9FloatList_read_handle(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -3679,11 +3742,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_15read(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.FloatList.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.FloatList.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9FloatList_14read(((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9FloatList_14read(((struct __pyx_obj_3_sa_FloatList *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3696,7 +3759,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9FloatList_15read(PyObject *__pyx_v_self, Py * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_9FloatList_14read(struct __pyx_obj_8_cdec_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3717,7 +3780,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_14read(struct __pyx_obj_8_cdec_sa * self.read_handle(f) # <<<<<<<<<<<<<< * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/float_list.pxi":77 * f = fopen(filename, "r") @@ -3733,16 +3796,16 @@ static PyObject *__pyx_pf_8_cdec_sa_9FloatList_14read(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_size; int __pyx_v_increment; int __pyx_v_initial_len; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,&__pyx_n_s__increment,&__pyx_n_s__initial_len,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -3775,18 +3838,6 @@ static int __pyx_pw_8_cdec_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObje if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[0]) { - } else { - __pyx_v_size = ((int)0); - } - if (values[1]) { - } else { - __pyx_v_increment = ((int)1); - } - if (values[2]) { - } else { - __pyx_v_initial_len = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -3816,11 +3867,11 @@ static int __pyx_pw_8_cdec_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObje __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList___cinit__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); + __pyx_r = __pyx_pf_3_sa_7IntList___cinit__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), __pyx_v_size, __pyx_v_increment, __pyx_v_initial_len); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3833,7 +3884,7 @@ static int __pyx_pw_8_cdec_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObje * size = initial_len */ -static int __pyx_pf_8_cdec_sa_7IntList___cinit__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len) { +static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3912,12 +3963,12 @@ static int __pyx_pf_8_cdec_sa_7IntList___cinit__(struct __pyx_obj_8_cdec_sa_IntL } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_3__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_3__str__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_7IntList_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_3__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_2__str__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_7IntList_2__str__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3930,7 +3981,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_3__str__(PyObject *__pyx_v_self) { * ret = "IntList[" */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_2__str__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_v_ret = NULL; int __pyx_v_idx; PyObject *__pyx_r = NULL; @@ -4076,7 +4127,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_2__str__(struct __pyx_obj_8_cdec_sa __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.IntList.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); @@ -4086,12 +4137,12 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_2__str__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { +static PyObject *__pyx_pw_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_4index(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_val)); + __pyx_r = __pyx_pf_3_sa_7IntList_4index(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_val)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4104,7 +4155,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_5index(PyObject *__pyx_v_self, PyOb * for i in range(self.len): */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_4index(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_val) { +static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_val) { unsigned int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4180,7 +4231,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_4index(struct __pyx_obj_8_cdec_sa_I __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.IntList.index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4189,15 +4240,15 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_4index(struct __pyx_obj_8_cdec_sa_I } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("partition (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -4211,12 +4262,10 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_7partition(PyObject *__pyx_v_self, kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("partition", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -4237,11 +4286,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_7partition(PyObject *__pyx_v_self, __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("partition", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_6partition(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + __pyx_r = __pyx_pf_3_sa_7IntList_6partition(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4254,7 +4303,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_7partition(PyObject *__pyx_v_self, * bottom = start-1 */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_6partition(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { +static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { PyObject *__pyx_v_pivot = NULL; PyObject *__pyx_v_bottom = NULL; PyObject *__pyx_v_top = NULL; @@ -4556,7 +4605,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_6partition(struct __pyx_obj_8_cdec_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.IntList.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pivot); @@ -4568,15 +4617,15 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_6partition(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_end = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_doquicksort (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -4590,12 +4639,10 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_9_doquicksort(PyObject *__pyx_v_sel kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_doquicksort", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -4616,11 +4663,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_9_doquicksort(PyObject *__pyx_v_sel __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_doquicksort", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList._doquicksort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList._doquicksort", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_8_doquicksort(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); + __pyx_r = __pyx_pf_3_sa_7IntList_8_doquicksort(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), __pyx_v_start, __pyx_v_end); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4633,7 +4680,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_9_doquicksort(PyObject *__pyx_v_sel * split = self.partition(start,end) */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_8_doquicksort(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { +static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) { PyObject *__pyx_v_split = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -4755,7 +4802,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_8_doquicksort(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.IntList._doquicksort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList._doquicksort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_split); @@ -4765,12 +4812,12 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_8_doquicksort(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sort (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_10sort(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_7IntList_10sort(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4783,7 +4830,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTH * */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_10sort(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_7IntList_10sort(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4825,7 +4872,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_10sort(struct __pyx_obj_8_cdec_sa_I __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.IntList.sort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.sort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4834,12 +4881,12 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_10sort(struct __pyx_obj_8_cdec_sa_I } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_12reset(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_7IntList_12reset(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4852,7 +4899,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_13reset(PyObject *__pyx_v_self, CYT * */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_12reset(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_7IntList_12reset(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 0); @@ -4873,11 +4920,11 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_12reset(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_7IntList_14__dealloc__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_pf_3_sa_7IntList_14__dealloc__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -4889,7 +4936,7 @@ static void __pyx_pw_8_cdec_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_7IntList_14__dealloc__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static void __pyx_pf_3_sa_7IntList_14__dealloc__(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); @@ -4906,12 +4953,12 @@ static void __pyx_pf_8_cdec_sa_7IntList_14__dealloc__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { +static PyObject *__pyx_pw_3_sa_7IntList_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_16__getitem__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + __pyx_r = __pyx_pf_3_sa_7IntList_16__getitem__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_index)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4924,7 +4971,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_17__getitem__(PyObject *__pyx_v_sel * if isinstance(index, int): */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_16__getitem__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_index) { +static PyObject *__pyx_pf_3_sa_7IntList_16__getitem__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_index) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; @@ -5298,7 +5345,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_16__getitem__(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("_cdec_sa.IntList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -5315,7 +5362,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_16__getitem__(struct __pyx_obj_8_cd * if i<0: */ -static void __pyx_f_8_cdec_sa_7IntList_set(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_i, int __pyx_v_val) { +static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_i, int __pyx_v_val) { int __pyx_v_j; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -5427,18 +5474,18 @@ static void __pyx_f_8_cdec_sa_7IntList_set(struct __pyx_obj_8_cdec_sa_IntList *_ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("_cdec_sa.IntList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.IntList.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_7IntList_19__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ -static int __pyx_pw_8_cdec_sa_7IntList_19__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { +static int __pyx_pw_3_sa_7IntList_19__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val); /*proto*/ +static int __pyx_pw_3_sa_7IntList_19__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_18__setitem__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); + __pyx_r = __pyx_pf_3_sa_7IntList_18__setitem__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_val)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5451,7 +5498,7 @@ static int __pyx_pw_8_cdec_sa_7IntList_19__setitem__(PyObject *__pyx_v_self, PyO * */ -static int __pyx_pf_8_cdec_sa_7IntList_18__setitem__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { +static int __pyx_pf_3_sa_7IntList_18__setitem__(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_val) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -5470,12 +5517,12 @@ static int __pyx_pf_8_cdec_sa_7IntList_18__setitem__(struct __pyx_obj_8_cdec_sa_ */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_val); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->set(__pyx_v_self, __pyx_t_1, __pyx_t_2); __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5483,12 +5530,12 @@ static int __pyx_pf_8_cdec_sa_7IntList_18__setitem__(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_7IntList_21__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_7IntList_21__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_7IntList_21__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_7IntList_21__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_20__len__(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_7IntList_20__len__(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5501,7 +5548,7 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_7IntList_21__len__(PyObject *__pyx_v_self) * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_7IntList_20__len__(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_7IntList_20__len__(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); @@ -5523,12 +5570,12 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_7IntList_20__len__(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_23getSize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_23getSize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_7IntList_23getSize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_23getSize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_22getSize(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_7IntList_22getSize(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5541,7 +5588,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_23getSize(PyObject *__pyx_v_self, C * */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_22getSize(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_7IntList_22getSize(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5568,7 +5615,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_22getSize(struct __pyx_obj_8_cdec_s goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.IntList.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5577,8 +5624,8 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_22getSize(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_25append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_25append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { +static PyObject *__pyx_pw_3_sa_7IntList_25append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_25append(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) { int __pyx_v_val; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -5588,11 +5635,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_25append(PyObject *__pyx_v_self, Py } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.append", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_24append(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((int)__pyx_v_val)); + __pyx_r = __pyx_pf_3_sa_7IntList_24append(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((int)__pyx_v_val)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5605,7 +5652,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_25append(PyObject *__pyx_v_self, Py * */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_24append(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_val) { +static PyObject *__pyx_pf_3_sa_7IntList_24append(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append", 0); @@ -5617,7 +5664,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_24append(struct __pyx_obj_8_cdec_sa * * cdef void _append(self, int val): */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->_append(__pyx_v_self, __pyx_v_val); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_append(__pyx_v_self, __pyx_v_val); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); @@ -5633,7 +5680,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_24append(struct __pyx_obj_8_cdec_sa * self.size = self.size + self.increment */ -static void __pyx_f_8_cdec_sa_7IntList__append(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int __pyx_v_val) { +static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int __pyx_v_val) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_append", 0); @@ -5691,12 +5738,12 @@ static void __pyx_f_8_cdec_sa_7IntList__append(struct __pyx_obj_8_cdec_sa_IntLis } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_27extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_27extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { +static PyObject *__pyx_pw_3_sa_7IntList_27extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_27extend(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("extend (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_26extend(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + __pyx_r = __pyx_pf_3_sa_7IntList_26extend(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((PyObject *)__pyx_v_other)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5709,7 +5756,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_27extend(PyObject *__pyx_v_self, Py * */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_26extend(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, PyObject *__pyx_v_other) { +static PyObject *__pyx_pf_3_sa_7IntList_26extend(struct __pyx_obj_3_sa_IntList *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5725,17 +5772,17 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_26extend(struct __pyx_obj_8_cdec_sa * * cdef void _extend(self, IntList other): */ - if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_other; __Pyx_INCREF(__pyx_t_1); - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend(__pyx_v_self, ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.IntList.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -5751,7 +5798,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_26extend(struct __pyx_obj_8_cdec_sa * */ -static void __pyx_f_8_cdec_sa_7IntList__extend(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_other) { +static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v_self, struct __pyx_obj_3_sa_IntList *__pyx_v_other) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_extend", 0); @@ -5762,7 +5809,7 @@ static void __pyx_f_8_cdec_sa_7IntList__extend(struct __pyx_obj_8_cdec_sa_IntLis * * cdef void _extend_arr(self, int* other, int other_len): */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend_arr(__pyx_v_self, __pyx_v_other->arr, __pyx_v_other->len); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->_extend_arr(__pyx_v_self, __pyx_v_other->arr, __pyx_v_other->len); __Pyx_RefNannyFinishContext(); } @@ -5775,7 +5822,7 @@ static void __pyx_f_8_cdec_sa_7IntList__extend(struct __pyx_obj_8_cdec_sa_IntLis * self.size = self.len + other_len */ -static void __pyx_f_8_cdec_sa_7IntList__extend_arr(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, int *__pyx_v_other, int __pyx_v_other_len) { +static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__pyx_v_self, int *__pyx_v_other, int __pyx_v_other_len) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_extend_arr", 0); @@ -5840,7 +5887,7 @@ static void __pyx_f_8_cdec_sa_7IntList__extend_arr(struct __pyx_obj_8_cdec_sa_In * self.len = 0 */ -static void __pyx_f_8_cdec_sa_7IntList__clear(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self) { +static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_clear", 0); @@ -5891,7 +5938,7 @@ static void __pyx_f_8_cdec_sa_7IntList__clear(struct __pyx_obj_8_cdec_sa_IntList * fwrite(self.arr, sizeof(int), self.len, f) */ -static void __pyx_f_8_cdec_sa_7IntList_write_handle(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__pyx_v_self, FILE *__pyx_v_f) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_handle", 0); @@ -5917,8 +5964,8 @@ static void __pyx_f_8_cdec_sa_7IntList_write_handle(struct __pyx_obj_8_cdec_sa_I } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_29write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_29write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_7IntList_29write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_29write(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -5928,11 +5975,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_29write(PyObject *__pyx_v_self, PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_28write(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_7IntList_28write(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5945,7 +5992,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_29write(PyObject *__pyx_v_self, PyO * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_28write(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_7IntList_28write(struct __pyx_obj_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5967,7 +6014,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_28write(struct __pyx_obj_8_cdec_sa_ * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":164 * f = fopen(filename, "w") @@ -5992,7 +6039,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_28write(struct __pyx_obj_8_cdec_sa_ * fread(&(self.len), sizeof(int), 1, f) */ -static void __pyx_f_8_cdec_sa_7IntList_read_handle(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__pyx_v_self, FILE *__pyx_v_f) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_handle", 0); @@ -6045,8 +6092,8 @@ static void __pyx_f_8_cdec_sa_7IntList_read_handle(struct __pyx_obj_8_cdec_sa_In } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_31read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7IntList_31read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_7IntList_31read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_7IntList_31read(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -6056,11 +6103,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_31read(PyObject *__pyx_v_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.IntList.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.IntList.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7IntList_30read(((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_7IntList_30read(((struct __pyx_obj_3_sa_IntList *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6073,7 +6120,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7IntList_31read(PyObject *__pyx_v_self, PyOb * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_7IntList_30read(struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_7IntList_30read(struct __pyx_obj_3_sa_IntList *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6094,7 +6141,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_30read(struct __pyx_obj_8_cdec_sa_I * self.read_handle(f) # <<<<<<<<<<<<<< * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/int_list.pxi":177 * f = fopen(filename, "r") @@ -6110,15 +6157,15 @@ static PyObject *__pyx_pf_8_cdec_sa_7IntList_30read(struct __pyx_obj_8_cdec_sa_I } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - __pyx_r = __pyx_pf_8_cdec_sa_9StringMap___cinit__(((struct __pyx_obj_8_cdec_sa_StringMap *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9StringMap___cinit__(((struct __pyx_obj_3_sa_StringMap *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6131,7 +6178,7 @@ static int __pyx_pw_8_cdec_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyOb * */ -static int __pyx_pf_8_cdec_sa_9StringMap___cinit__(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self) { +static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); @@ -6151,11 +6198,11 @@ static int __pyx_pf_8_cdec_sa_9StringMap___cinit__(struct __pyx_obj_8_cdec_sa_St } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_9StringMap_2__dealloc__(((struct __pyx_obj_8_cdec_sa_StringMap *)__pyx_v_self)); + __pyx_pf_3_sa_9StringMap_2__dealloc__(((struct __pyx_obj_3_sa_StringMap *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -6167,7 +6214,7 @@ static void __pyx_pw_8_cdec_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_9StringMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self) { +static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMap *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); @@ -6191,7 +6238,7 @@ static void __pyx_pf_8_cdec_sa_9StringMap_2__dealloc__(struct __pyx_obj_8_cdec_s * */ -static char *__pyx_f_8_cdec_sa_9StringMap_word(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self, int __pyx_v_i) { +static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx_v_self, int __pyx_v_i) { char *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("word", 0); @@ -6219,7 +6266,7 @@ static char *__pyx_f_8_cdec_sa_9StringMap_word(struct __pyx_obj_8_cdec_sa_String * return stringmap_index(self.vocab, s) */ -static int __pyx_f_8_cdec_sa_9StringMap_index(struct __pyx_obj_8_cdec_sa_StringMap *__pyx_v_self, char *__pyx_v_s) { +static int __pyx_f_3_sa_9StringMap_index(struct __pyx_obj_3_sa_StringMap *__pyx_v_self, char *__pyx_v_s) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("index", 0); @@ -6239,16 +6286,16 @@ static int __pyx_f_8_cdec_sa_9StringMap_index(struct __pyx_obj_8_cdec_sa_StringM } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; int __pyx_v_use_sent_id; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__use_sent_id,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__use_sent_id,0}; PyObject* values[3] = {0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":17 @@ -6291,10 +6338,6 @@ static int __pyx_pw_8_cdec_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyOb if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[2]) { - } else { - __pyx_v_use_sent_id = ((int)0); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -6316,16 +6359,16 @@ static int __pyx_pw_8_cdec_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyOb __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray___cinit__(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text, __pyx_v_use_sent_id); + __pyx_r = __pyx_pf_3_sa_9DataArray___cinit__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text, __pyx_v_use_sent_id); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, int __pyx_v_use_sent_id) { +static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text, int __pyx_v_use_sent_id) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6382,12 +6425,12 @@ static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_Da * self.sent_id = IntList(1000,1000) * self.sent_index = IntList(1000,1000) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->data); __Pyx_DECREF(((PyObject *)__pyx_v_self->data)); - __pyx_v_self->data = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":21 @@ -6397,12 +6440,12 @@ static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_Da * self.sent_index = IntList(1000,1000) * self.use_sent_id = use_sent_id */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sent_id); __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_id)); - __pyx_v_self->sent_id = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":22 @@ -6412,12 +6455,12 @@ static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_Da * self.use_sent_id = use_sent_id * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sent_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_index)); - __pyx_v_self->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":23 @@ -6500,7 +6543,7 @@ static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_Da __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.DataArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -6508,12 +6551,12 @@ static int __pyx_pf_8_cdec_sa_9DataArray___cinit__(struct __pyx_obj_8_cdec_sa_Da } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_9DataArray_3__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_9DataArray_3__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_2__len__(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9DataArray_2__len__(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6526,7 +6569,7 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_9DataArray_3__len__(PyObject *__pyx_v_self) * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_9DataArray_2__len__(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataArray *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6554,7 +6597,7 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_9DataArray_2__len__(struct __pyx_obj_8_cdec goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.DataArray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -6562,12 +6605,12 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_9DataArray_2__len__(struct __pyx_obj_8_cdec } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_9DataArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSentId (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_4getSentId(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_9DataArray_4getSentId(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6580,7 +6623,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_5getSentId(PyObject *__pyx_v_self * */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_4getSentId(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_9DataArray_4getSentId(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -6609,7 +6652,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_4getSentId(struct __pyx_obj_8_cde goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.DataArray.getSentId", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.getSentId", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -6618,12 +6661,12 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_4getSentId(struct __pyx_obj_8_cde } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_9DataArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSent (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_6getSent(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_9DataArray_6getSent(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6636,7 +6679,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_7getSent(PyObject *__pyx_v_self, * sent = [] */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_6getSent(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_9DataArray_6getSent(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_v_start; int __pyx_v_stop; PyObject *__pyx_v_sent = NULL; @@ -6747,7 +6790,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_6getSent(struct __pyx_obj_8_cdec_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.DataArray.getSent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.getSent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sent); @@ -6758,12 +6801,12 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_6getSent(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { +static PyObject *__pyx_pw_3_sa_9DataArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSentPos (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_8getSentPos(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + __pyx_r = __pyx_pf_3_sa_9DataArray_8getSentPos(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6776,7 +6819,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_9getSentPos(PyObject *__pyx_v_sel * */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_8getSentPos(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) { +static PyObject *__pyx_pf_3_sa_9DataArray_8getSentPos(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_loc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -6810,7 +6853,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_8getSentPos(struct __pyx_obj_8_cd __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.DataArray.getSentPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.getSentPos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -6819,12 +6862,12 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_8getSentPos(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) { +static PyObject *__pyx_pw_3_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_11get_id(PyObject *__pyx_v_self, PyObject *__pyx_v_word) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_id (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_10get_id(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word)); + __pyx_r = __pyx_pf_3_sa_9DataArray_10get_id(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_word)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6837,7 +6880,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_11get_id(PyObject *__pyx_v_self, * self.word2id[word] = len(self.id2word) */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_10get_id(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) { +static PyObject *__pyx_pf_3_sa_9DataArray_10get_id(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_word) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -6908,7 +6951,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_10get_id(struct __pyx_obj_8_cdec_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.DataArray.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.get_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -6917,12 +6960,12 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_10get_id(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id) { +static PyObject *__pyx_pw_3_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_13get_word(PyObject *__pyx_v_self, PyObject *__pyx_v_id) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_word (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_12get_word(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_id)); + __pyx_r = __pyx_pf_3_sa_9DataArray_12get_word(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_id)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6935,7 +6978,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_13get_word(PyObject *__pyx_v_self * */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_12get_word(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id) { +static PyObject *__pyx_pf_3_sa_9DataArray_12get_word(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_id) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6962,7 +7005,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_12get_word(struct __pyx_obj_8_cde goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.DataArray.get_word", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.get_word", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -6971,8 +7014,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_12get_word(struct __pyx_obj_8_cde } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -6982,11 +7025,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_15write_text(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_14write_text(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9DataArray_14write_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6999,7 +7042,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_15write_text(PyObject *__pyx_v_se * for w_id in self.data: */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_w_id = NULL; PyObject *__pyx_r = NULL; @@ -7081,10 +7124,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -7201,7 +7252,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_c * if w_id > 1: */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_12, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_12); @@ -7281,7 +7332,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_c __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("_cdec_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -7292,8 +7343,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_14write_text(struct __pyx_obj_8_c } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -7303,11 +7354,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_17read_text(PyObject *__pyx_v_sel } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_16read_text(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9DataArray_16read_text(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7320,7 +7371,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_17read_text(PyObject *__pyx_v_sel * with gzip_or_text(filename) as fp: */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { int __pyx_v_word_count; PyObject *__pyx_v_fp = NULL; PyObject *__pyx_v_line_num = NULL; @@ -7419,10 +7470,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cd for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_3 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_3)) { @@ -7484,10 +7543,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cd for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_3 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_3)) { @@ -7651,7 +7718,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cd * self.sent_index.append(word_count) */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); @@ -7732,7 +7799,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_AddTraceback("_cdec_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fp); @@ -7745,8 +7812,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_16read_text(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_19read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_19read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9DataArray_19read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_19read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -7756,11 +7823,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_19read_binary(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_18read_binary(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9DataArray_18read_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7773,7 +7840,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_19read_binary(PyObject *__pyx_v_s * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_18read_binary(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9DataArray_18read_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -7795,7 +7862,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_18read_binary(struct __pyx_obj_8_ * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":85 * f = fopen(filename, "r") @@ -7820,7 +7887,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_18read_binary(struct __pyx_obj_8_ * cdef unsigned i */ -static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, FILE *__pyx_v_f) { int __pyx_v_num_words; int __pyx_v_word_len; CYTHON_UNUSED unsigned int __pyx_v_i; @@ -7844,7 +7911,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_ * self.sent_index.read_handle(f) * self.sent_id.read_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":93 * cdef bytes py_word @@ -7853,7 +7920,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_ * self.sent_id.read_handle(f) * fread(&(num_words), sizeof(int), 1, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":94 * self.data.read_handle(f) @@ -7862,7 +7929,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_ * fread(&(num_words), sizeof(int), 1, f) * for i in range(num_words): */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":95 * self.sent_index.read_handle(f) @@ -8001,7 +8068,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("_cdec_sa.DataArray.read_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.DataArray.read_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_word); __Pyx_RefNannyFinishContext(); @@ -8015,7 +8082,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_read_handle(struct __pyx_obj_8_cdec_sa_ * cdef int num_words */ -static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, FILE *__pyx_v_f) { +static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, FILE *__pyx_v_f) { int __pyx_v_word_len; int __pyx_v_num_words; char *__pyx_v_c_word; @@ -8038,7 +8105,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa * self.sent_index.write_handle(f) * self.sent_id.write_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":114 * cdef char* c_word @@ -8047,7 +8114,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa * self.sent_id.write_handle(f) * num_words = len(self.id2word) - 2 */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":115 * self.data.write_handle(f) @@ -8056,7 +8123,7 @@ static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa * num_words = len(self.id2word) - 2 * fwrite(&(num_words), sizeof(int), 1, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":116 * self.sent_index.write_handle(f) @@ -8101,10 +8168,18 @@ static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) { @@ -8163,15 +8238,15 @@ static void __pyx_f_8_cdec_sa_9DataArray_write_handle(struct __pyx_obj_8_cdec_sa __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("_cdec_sa.DataArray.write_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.DataArray.write_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_v_word); __Pyx_RefNannyFinishContext(); } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_21write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_21write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9DataArray_21write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_21write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -8181,11 +8256,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_21write_binary(PyObject *__pyx_v_ } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_20write_binary(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9DataArray_20write_binary(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8198,7 +8273,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_21write_binary(PyObject *__pyx_v_ * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_20write_binary(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9DataArray_20write_binary(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -8220,7 +8295,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_20write_binary(struct __pyx_obj_8 * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/data_array.pxi":128 * f = fopen(filename, "w") @@ -8238,12 +8313,12 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_20write_binary(struct __pyx_obj_8 } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_23write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_23write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { +static PyObject *__pyx_pw_3_sa_9DataArray_23write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_23write_enhanced_handle(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_enhanced_handle (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_f)); + __pyx_r = __pyx_pf_3_sa_9DataArray_22write_enhanced_handle(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((PyObject *)__pyx_v_f)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8256,7 +8331,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_23write_enhanced_handle(PyObject * f.write("%d " %i) */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f) { +static PyObject *__pyx_pf_3_sa_9DataArray_22write_enhanced_handle(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, PyObject *__pyx_v_f) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_word = NULL; PyObject *__pyx_r = NULL; @@ -8290,10 +8365,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -8365,10 +8448,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_1 = __pyx_t_3(__pyx_t_5); if (unlikely(!__pyx_t_1)) { @@ -8440,10 +8531,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_6); if (unlikely(!__pyx_t_5)) { @@ -8515,10 +8614,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_6 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_6)) { @@ -8590,7 +8697,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("_cdec_sa.DataArray.write_enhanced_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_enhanced_handle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); @@ -8601,8 +8708,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_22write_enhanced_handle(struct __ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_25write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9DataArray_25write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9DataArray_25write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9DataArray_25write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -8612,11 +8719,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_25write_enhanced(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9DataArray_24write_enhanced(((struct __pyx_obj_3_sa_DataArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8629,7 +8736,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9DataArray_25write_enhanced(PyObject *__pyx_ * self.write_enhanced_handle(self, f) */ -static PyObject *__pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9DataArray_24write_enhanced(struct __pyx_obj_3_sa_DataArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -8725,7 +8832,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(struct __pyx_obj * self.write_enhanced_handle(self, f) */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); @@ -8804,7 +8911,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(struct __pyx_obj __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("_cdec_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.DataArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -8821,7 +8928,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9DataArray_24write_enhanced(struct __pyx_obj * return i*65536 + j */ -static int __pyx_f_8_cdec_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) { +static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("link", 0); @@ -8843,13 +8950,13 @@ static int __pyx_f_8_cdec_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_link); /*proto*/ -static char __pyx_doc_8_cdec_sa_9Alignment_unlink[] = "De-integerizes an alignment link pair"; -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_link) { +static PyObject *__pyx_pw_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_link); /*proto*/ +static char __pyx_doc_3_sa_9Alignment_unlink[] = "De-integerizes an alignment link pair"; +static PyObject *__pyx_pw_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_link) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unlink (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_unlink(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_link)); + __pyx_r = __pyx_pf_3_sa_9Alignment_unlink(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_link)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8862,7 +8969,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_1unlink(PyObject *__pyx_v_self, P * return (link/65536, link%65536) */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link) { +static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_link) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -8903,7 +9010,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.Alignment.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -8919,7 +9026,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx * e[0] = link%65536 */ -static PyObject *__pyx_f_8_cdec_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, int __pyx_v_link, int *__pyx_v_f, int *__pyx_v_e) { +static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_link, int *__pyx_v_f, int *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_unlink", 0); @@ -8949,8 +9056,8 @@ static PyObject *__pyx_f_8_cdec_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id) { +static PyObject *__pyx_pw_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self, PyObject *__pyx_arg_sent_id) { int __pyx_v_sent_id; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -8960,11 +9067,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_3get_sent_links(PyObject *__pyx_v } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((int)__pyx_v_sent_id)); + __pyx_r = __pyx_pf_3_sa_9Alignment_2get_sent_links(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((int)__pyx_v_sent_id)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8977,8 +9084,8 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_3get_sent_links(PyObject *__pyx_v * cdef int* arr */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id) { - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_sent_links = 0; +static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id) { + struct __pyx_obj_3_sa_IntList *__pyx_v_sent_links = 0; int *__pyx_v_arr; int __pyx_v_arr_len; PyObject *__pyx_r = NULL; @@ -8996,9 +9103,9 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_ * arr = self._get_sent_links(sent_id, &arr_len) * sent_links._extend_arr(arr, arr_len*2) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sent_links = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_sent_links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":29 @@ -9008,7 +9115,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_ * sent_links._extend_arr(arr, arr_len*2) * free(arr) */ - __pyx_v_arr = ((struct __pyx_vtabstruct_8_cdec_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len)); + __pyx_v_arr = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":30 * sent_links = IntList() @@ -9017,7 +9124,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_ * free(arr) * return sent_links */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":31 * arr = self._get_sent_links(sent_id, &arr_len) @@ -9044,7 +9151,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Alignment.get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sent_links); @@ -9061,7 +9168,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_2get_sent_links(struct __pyx_obj_ * cdef int i, start, end */ -static int *__pyx_f_8_cdec_sa_9Alignment__get_sent_links(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id, int *__pyx_v_num_links) { +static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, int __pyx_v_sent_id, int *__pyx_v_num_links) { int *__pyx_v_sent_links; int __pyx_v_i; int __pyx_v_start; @@ -9128,7 +9235,7 @@ static int *__pyx_f_8_cdec_sa_9Alignment__get_sent_links(struct __pyx_obj_8_cdec * return sent_links * */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_unlink(__pyx_v_self, (__pyx_v_self->links->arr[(__pyx_v_start + __pyx_v_i)]), (__pyx_v_sent_links + (2 * __pyx_v_i)), ((__pyx_v_sent_links + (2 * __pyx_v_i)) + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_unlink(__pyx_v_self, (__pyx_v_self->links->arr[(__pyx_v_start + __pyx_v_i)]), (__pyx_v_sent_links + (2 * __pyx_v_i)), ((__pyx_v_sent_links + (2 * __pyx_v_i)) + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -9147,7 +9254,7 @@ static int *__pyx_f_8_cdec_sa_9Alignment__get_sent_links(struct __pyx_obj_8_cdec goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("_cdec_sa.Alignment._get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.Alignment._get_sent_links", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -9155,15 +9262,15 @@ static int *__pyx_f_8_cdec_sa_9Alignment__get_sent_links(struct __pyx_obj_8_cdec } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; PyObject* values[2] = {0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":45 @@ -9215,16 +9322,16 @@ static int __pyx_pw_8_cdec_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyOb __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text); + __pyx_r = __pyx_pf_3_sa_9Alignment_4__cinit__(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text) { +static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -9243,12 +9350,12 @@ static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_A * self.sent_index = IntList(1000,1000) * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->links); __Pyx_DECREF(((PyObject *)__pyx_v_self->links)); - __pyx_v_self->links = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":47 @@ -9258,12 +9365,12 @@ static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_A * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sent_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->sent_index)); - __pyx_v_self->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":48 @@ -9337,7 +9444,7 @@ static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_A __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.Alignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -9345,8 +9452,8 @@ static int __pyx_pf_8_cdec_sa_9Alignment_4__cinit__(struct __pyx_obj_8_cdec_sa_A } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -9356,11 +9463,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_7read_text(PyObject *__pyx_v_self } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_6read_text(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9Alignment_6read_text(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9373,7 +9480,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_7read_text(PyObject *__pyx_v_self * for line in f: */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_line = NULL; PyObject *__pyx_v_pairs = NULL; @@ -9465,10 +9572,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -9536,10 +9651,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_3 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_3)) { @@ -9580,27 +9703,33 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { PyObject* sequence = __pyx_t_12; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_14); @@ -9611,12 +9740,13 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_15 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -9636,7 +9766,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde */ __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_v_j); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_Alignment *)__pyx_v_self->__pyx_vtab)->link(__pyx_v_self, __pyx_t_16, __pyx_t_17)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->link(__pyx_v_self, __pyx_t_16, __pyx_t_17)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->links), __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); @@ -9685,7 +9815,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde * self.sent_index.append(len(self.links)) */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); @@ -9766,7 +9896,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_AddTraceback("_cdec_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -9781,8 +9911,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_6read_text(struct __pyx_obj_8_cde } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -9792,11 +9922,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_9read_binary(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_8read_binary(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9Alignment_8read_binary(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9809,7 +9939,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_9read_binary(PyObject *__pyx_v_se * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_8read_binary(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -9831,7 +9961,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_8read_binary(struct __pyx_obj_8_c * self.sent_index.read_handle(f) * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":67 * f = fopen(filename, "r") @@ -9840,7 +9970,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_8read_binary(struct __pyx_obj_8_c * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":68 * self.links.read_handle(f) @@ -9858,8 +9988,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_8read_binary(struct __pyx_obj_8_c } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -9869,11 +9999,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_11write_text(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_10write_text(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9Alignment_10write_text(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9886,7 +10016,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_11write_text(PyObject *__pyx_v_se * sent_num = 0 */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_sent_num = NULL; PyObject *__pyx_v_i = NULL; @@ -9983,10 +10113,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -10126,7 +10264,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_c * for i, link in enumerate(self.links): */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); @@ -10207,7 +10345,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_c __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("_cdec_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -10220,8 +10358,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_10write_text(struct __pyx_obj_8_c } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -10231,11 +10369,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_13write_binary(PyObject *__pyx_v_ } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_12write_binary(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9Alignment_12write_binary(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10248,7 +10386,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_13write_binary(PyObject *__pyx_v_ * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_12write_binary(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10270,7 +10408,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_12write_binary(struct __pyx_obj_8 * self.sent_index.write_handle(f) * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":84 * f = fopen(filename, "w") @@ -10279,7 +10417,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_12write_binary(struct __pyx_obj_8 * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/alignment.pxi":85 * self.links.write_handle(f) @@ -10297,8 +10435,8 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_12write_binary(struct __pyx_obj_8 } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -10308,11 +10446,11 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_15write_enhanced(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_9Alignment_14write_enhanced(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10325,7 +10463,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_15write_enhanced(PyObject *__pyx_ * sent_num = 1 */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; CYTHON_UNUSED long __pyx_v_sent_num; PyObject *__pyx_v_link = NULL; @@ -10417,10 +10555,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -10492,10 +10638,18 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -10567,7 +10721,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj * for link in self.links: */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_2); @@ -10646,7 +10800,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("_cdec_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -10658,13 +10812,13 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_14write_enhanced(struct __pyx_obj } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_17alignment(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static char __pyx_doc_8_cdec_sa_9Alignment_16alignment[] = "Return all (e,f) pairs for sentence i"; -static PyObject *__pyx_pw_8_cdec_sa_9Alignment_17alignment(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static char __pyx_doc_3_sa_9Alignment_16alignment[] = "Return all (e,f) pairs for sentence i"; +static PyObject *__pyx_pw_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("alignment (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9Alignment_16alignment(((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_9Alignment_16alignment(((struct __pyx_obj_3_sa_Alignment *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10677,7 +10831,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9Alignment_17alignment(PyObject *__pyx_v_sel * cdef int j, start, end */ -static PyObject *__pyx_pf_8_cdec_sa_9Alignment_16alignment(struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alignment *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_v_j; int __pyx_v_start; int __pyx_v_end; @@ -10779,7 +10933,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_16alignment(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.Alignment.alignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alignment.alignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -10796,9 +10950,9 @@ static PyObject *__pyx_pf_8_cdec_sa_9Alignment_16alignment(struct __pyx_obj_8_cd * n = <_node*> malloc(sizeof(_node)) */ -static struct __pyx_t_8_cdec_sa__node *__pyx_f_8_cdec_sa_new_node(int __pyx_v_key) { - struct __pyx_t_8_cdec_sa__node *__pyx_v_n; - struct __pyx_t_8_cdec_sa__node *__pyx_r; +static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) { + struct __pyx_t_3_sa__node *__pyx_v_n; + struct __pyx_t_3_sa__node *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_node", 0); @@ -10809,7 +10963,7 @@ static struct __pyx_t_8_cdec_sa__node *__pyx_f_8_cdec_sa_new_node(int __pyx_v_ke * n.smaller = NULL * n.bigger = NULL */ - __pyx_v_n = ((struct __pyx_t_8_cdec_sa__node *)malloc((sizeof(struct __pyx_t_8_cdec_sa__node)))); + __pyx_v_n = ((struct __pyx_t_3_sa__node *)malloc((sizeof(struct __pyx_t_3_sa__node)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":18 * cdef _node* n @@ -10871,7 +11025,7 @@ static struct __pyx_t_8_cdec_sa__node *__pyx_f_8_cdec_sa_new_node(int __pyx_v_ke * del_node(n.smaller) */ -static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *__pyx_v_n) { +static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -10898,7 +11052,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *__py * if n.bigger != NULL: * del_node(n.bigger) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_del_node(__pyx_v_n->smaller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_del_node(__pyx_v_n->smaller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3; @@ -10922,7 +11076,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *__py * free(n) * */ - __pyx_t_2 = __pyx_f_8_cdec_sa_del_node(__pyx_v_n->bigger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_del_node(__pyx_v_n->bigger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L4; @@ -10942,7 +11096,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *__py goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.del_node", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.del_node", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -10958,7 +11112,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_node(struct __pyx_t_8_cdec_sa__node *__py * return &n.val */ -static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, int __pyx_v_key) { +static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx_v_key) { int *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -11013,7 +11167,7 @@ static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, * return &(n.smaller.val) * return get_val(n.smaller, key) */ - __pyx_v_n->smaller = __pyx_f_8_cdec_sa_new_node(__pyx_v_key); + __pyx_v_n->smaller = __pyx_f_3_sa_new_node(__pyx_v_key); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":38 * if n.smaller == NULL: @@ -11035,7 +11189,7 @@ static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, * else: * if n.bigger == NULL: */ - __pyx_r = __pyx_f_8_cdec_sa_get_val(__pyx_v_n->smaller, __pyx_v_key); + __pyx_r = __pyx_f_3_sa_get_val(__pyx_v_n->smaller, __pyx_v_key); goto __pyx_L0; goto __pyx_L3; } @@ -11058,7 +11212,7 @@ static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, * return &(n.bigger.val) * return get_val(n.bigger, key) */ - __pyx_v_n->bigger = __pyx_f_8_cdec_sa_new_node(__pyx_v_key); + __pyx_v_n->bigger = __pyx_f_3_sa_new_node(__pyx_v_key); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":43 * if n.bigger == NULL: @@ -11080,7 +11234,7 @@ static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, * * */ - __pyx_r = __pyx_f_8_cdec_sa_get_val(__pyx_v_n->bigger, __pyx_v_key); + __pyx_r = __pyx_f_3_sa_get_val(__pyx_v_n->bigger, __pyx_v_key); goto __pyx_L0; } __pyx_L3:; @@ -11092,19 +11246,19 @@ static int *__pyx_f_8_cdec_sa_get_val(struct __pyx_t_8_cdec_sa__node *__pyx_v_n, } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_text = 0; PyObject *__pyx_v_from_data = 0; PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_earray = 0; PyObject *__pyx_v_fsarray = 0; PyObject *__pyx_v_alignment = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":54 @@ -11200,11 +11354,11 @@ static int __pyx_pw_8_cdec_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex___cinit__(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), __pyx_v_from_text, __pyx_v_from_data, __pyx_v_from_binary, __pyx_v_earray, __pyx_v_fsarray, __pyx_v_alignment); + __pyx_r = __pyx_pf_3_sa_5BiLex___cinit__(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), __pyx_v_from_text, __pyx_v_from_data, __pyx_v_from_binary, __pyx_v_earray, __pyx_v_fsarray, __pyx_v_alignment); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11217,7 +11371,7 @@ static int __pyx_pw_8_cdec_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject * self.id2eword = [] */ -static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_from_text, PyObject *__pyx_v_from_data, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_earray, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_alignment) { +static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_from_text, PyObject *__pyx_v_from_data, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_earray, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_alignment) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -11297,12 +11451,12 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * self.f_index = IntList() * self.col1 = FloatList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->e_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->e_index)); - __pyx_v_self->e_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":61 @@ -11312,12 +11466,12 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * self.col1 = FloatList() * self.col2 = FloatList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->f_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->f_index)); - __pyx_v_self->f_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":62 @@ -11327,12 +11481,12 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * self.col2 = FloatList() * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col1); __Pyx_DECREF(((PyObject *)__pyx_v_self->col1)); - __pyx_v_self->col1 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_1); + __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":63 @@ -11342,12 +11496,12 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col2); __Pyx_DECREF(((PyObject *)__pyx_v_self->col2)); - __pyx_v_self->col2 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_1); + __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":64 @@ -11399,16 +11553,16 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * else: * self.read_text(from_text) */ - if (!(likely(((__pyx_v_fsarray) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_fsarray, __pyx_ptype_8_cdec_sa_SuffixArray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_fsarray) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_fsarray, __pyx_ptype_3_sa_SuffixArray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_v_fsarray; __Pyx_INCREF(__pyx_t_4); - if (!(likely(((__pyx_v_earray) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_earray, __pyx_ptype_8_cdec_sa_DataArray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_earray) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_earray, __pyx_ptype_3_sa_DataArray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_v_earray; __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_v_alignment) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_alignment, __pyx_ptype_8_cdec_sa_Alignment))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_alignment) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_alignment, __pyx_ptype_3_sa_Alignment))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->compute_from_data(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_t_4), ((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_t_3), ((struct __pyx_obj_8_cdec_sa_Alignment *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->compute_from_data(__pyx_v_self, ((struct __pyx_obj_3_sa_SuffixArray *)__pyx_t_4), ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_3), ((struct __pyx_obj_3_sa_Alignment *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11447,7 +11601,7 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.BiLex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -11462,7 +11616,7 @@ static int __pyx_pf_8_cdec_sa_5BiLex___cinit__(struct __pyx_obj_8_cdec_sa_BiLex * cdef int *fsent, *esent, *alignment, *links, *ealigned, *faligned */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsa, struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_eda, struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_aa) { +static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsa, struct __pyx_obj_3_sa_DataArray *__pyx_v_eda, struct __pyx_obj_3_sa_Alignment *__pyx_v_aa) { int __pyx_v_sent_id; int __pyx_v_num_links; int __pyx_v_l; @@ -11480,7 +11634,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c int *__pyx_v_links; int *__pyx_v_ealigned; int *__pyx_v_faligned; - struct __pyx_t_8_cdec_sa__node **__pyx_v_dict; + struct __pyx_t_3_sa__node **__pyx_v_dict; int *__pyx_v_fmargin; int *__pyx_v_emargin; int *__pyx_v_count; @@ -11535,10 +11689,18 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -11597,10 +11759,18 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -11655,10 +11825,18 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -11717,10 +11895,18 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_5 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_5)) { @@ -11835,7 +12021,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * memset(dict, 0, V_F*sizeof(_node*)) * */ - __pyx_v_dict = ((struct __pyx_t_8_cdec_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_8_cdec_sa__node *))))); + __pyx_v_dict = ((struct __pyx_t_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *))))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":103 * @@ -11844,7 +12030,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * * num_sents = len(fsa.darray.sent_index) */ - memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_8_cdec_sa__node *)))); + memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":105 * memset(dict, 0, V_F*sizeof(_node*)) @@ -11954,7 +12140,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * * for l from 0 <= l < num_links: */ - __pyx_v_links = ((struct __pyx_vtabstruct_8_cdec_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links)); + __pyx_v_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":120 * links = aa._get_sent_links(sent_id, &num_links) @@ -12105,7 +12291,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * dict[f_i].val = 1 * num_pairs = num_pairs + 1 */ - (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_8_cdec_sa_new_node(__pyx_v_e_j); + (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":131 * if dict[f_i] == NULL: @@ -12135,7 +12321,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * if count[0] == 0: * num_pairs = num_pairs + 1 */ - __pyx_v_count = __pyx_f_8_cdec_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j); + __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":135 * else: @@ -12253,7 +12439,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * dict[f_i].val = 1 * num_pairs = num_pairs + 1 */ - (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_8_cdec_sa_new_node(__pyx_v_null_word); + (__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_null_word); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":148 * if dict[f_i] == NULL: @@ -12283,7 +12469,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * if count[0] == 0: * num_pairs = num_pairs + 1 */ - __pyx_v_count = __pyx_f_8_cdec_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word); + __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":152 * else: @@ -12386,7 +12572,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * dict[null_word].val = 1 * num_pairs = num_pairs + 1 */ - (__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_8_cdec_sa_new_node(__pyx_v_e_j); + (__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_3_sa_new_node(__pyx_v_e_j); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":162 * if dict[null_word] == NULL: @@ -12416,7 +12602,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * if count[0] == 0: * num_pairs = num_pairs + 1 */ - __pyx_v_count = __pyx_f_8_cdec_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j); + __pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":166 * else: @@ -12496,13 +12682,13 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GIVEREF(__pyx_t_13); __Pyx_GOTREF(__pyx_v_self->f_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->f_index)); - __pyx_v_self->f_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_13); + __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_13); __pyx_t_13 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":173 @@ -12518,13 +12704,13 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->e_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->e_index)); - __pyx_v_self->e_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_12); + __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":174 @@ -12540,13 +12726,13 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c __Pyx_GOTREF(__pyx_t_13); if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GIVEREF(__pyx_t_13); __Pyx_GOTREF(__pyx_v_self->col1); __Pyx_DECREF(((PyObject *)__pyx_v_self->col1)); - __pyx_v_self->col1 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_13); + __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_13); __pyx_t_13 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":175 @@ -12562,13 +12748,13 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->col2); __Pyx_DECREF(((PyObject *)__pyx_v_self->col2)); - __pyx_v_self->col2 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_12); + __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":177 @@ -12597,7 +12783,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * if dict[i] != NULL: * self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":181 * #self.f_index[i] = num_pairs @@ -12616,7 +12802,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * del_node(dict[i]) * free(fmargin) */ - __pyx_t_12 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, (__pyx_v_dict[__pyx_v_i]), (&__pyx_v_num_pairs), ((double)(__pyx_v_fmargin[__pyx_v_i])), __pyx_v_emargin); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, (__pyx_v_dict[__pyx_v_i]), (&__pyx_v_num_pairs), ((double)(__pyx_v_fmargin[__pyx_v_i])), __pyx_v_emargin); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -12627,7 +12813,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * free(fmargin) * free(emargin) */ - __pyx_t_12 = __pyx_f_8_cdec_sa_del_node((__pyx_v_dict[__pyx_v_i])); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_f_3_sa_del_node((__pyx_v_dict[__pyx_v_i])); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L30; @@ -12682,7 +12868,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("_cdec_sa.BiLex.compute_from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.compute_from_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_word); @@ -12701,7 +12887,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_compute_from_data(struct __pyx_obj_8_c * if n.smaller != NULL: */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, struct __pyx_t_8_cdec_sa__node *__pyx_v_n, int *__pyx_v_num_pairs, float __pyx_v_fmargin, int *__pyx_v_emargin) { +static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, struct __pyx_t_3_sa__node *__pyx_v_n, int *__pyx_v_num_pairs, float __pyx_v_fmargin, int *__pyx_v_emargin) { int __pyx_v_loc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -12729,7 +12915,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B * loc = num_pairs[0] * self.e_index.set(loc, n.key) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, __pyx_v_n->smaller, __pyx_v_num_pairs, __pyx_v_fmargin, __pyx_v_emargin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, __pyx_v_n->smaller, __pyx_v_num_pairs, __pyx_v_fmargin, __pyx_v_emargin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3; @@ -12752,7 +12938,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B * self.col1.set(loc, float(n.val)/fmargin) * self.col2.set(loc, float(n.val)/float(emargin[n.key])) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":196 * loc = num_pairs[0] @@ -12765,7 +12951,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B PyErr_Format(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin)); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":197 * self.e_index.set(loc, n.key) @@ -12778,7 +12964,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B PyErr_Format(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key])))); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key])))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":198 * self.col1.set(loc, float(n.val)/fmargin) @@ -12806,7 +12992,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B * * */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, __pyx_v_n->bigger, __pyx_v_num_pairs, __pyx_v_fmargin, __pyx_v_emargin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->_add_node(__pyx_v_self, __pyx_v_n->bigger, __pyx_v_num_pairs, __pyx_v_fmargin, __pyx_v_emargin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L4; @@ -12817,7 +13003,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BiLex._add_node", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex._add_node", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -12826,8 +13012,8 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex__add_node(struct __pyx_obj_8_cdec_sa_B } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -12837,11 +13023,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_2write_binary(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_5BiLex_2write_binary(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -12854,7 +13040,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -12881,7 +13067,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec * self.e_index.write_handle(f) * self.col1.write_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":207 * f = fopen(filename, "w") @@ -12890,7 +13076,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec * self.col1.write_handle(f) * self.col2.write_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":208 * self.f_index.write_handle(f) @@ -12899,7 +13085,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec * self.col2.write_handle(f) * self.write_wordlist(self.id2fword, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":209 * self.e_index.write_handle(f) @@ -12908,7 +13094,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec * self.write_wordlist(self.id2fword, f) * self.write_wordlist(self.id2eword, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":210 * self.col1.write_handle(f) @@ -12919,7 +13105,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec */ __pyx_t_1 = __pyx_v_self->id2fword; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->write_wordlist(__pyx_v_self, __pyx_t_1, __pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->write_wordlist(__pyx_v_self, __pyx_t_1, __pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12933,7 +13119,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec */ __pyx_t_2 = __pyx_v_self->id2eword; __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->write_wordlist(__pyx_v_self, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->write_wordlist(__pyx_v_self, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12952,7 +13138,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BiLex.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -12968,7 +13154,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_2write_binary(struct __pyx_obj_8_cdec * cdef int num_words */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_wordlist, FILE *__pyx_v_f) { +static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_wordlist, FILE *__pyx_v_f) { int __pyx_v_word_len; int __pyx_v_num_words; char *__pyx_v_c_word; @@ -13022,10 +13208,18 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -13085,7 +13279,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.BiLex.write_wordlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_wordlist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_word); @@ -13102,7 +13296,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __ * cdef int word_len */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_word2id, PyObject *__pyx_v_id2word, FILE *__pyx_v_f) { +static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_word2id, PyObject *__pyx_v_id2word, FILE *__pyx_v_f) { int __pyx_v_num_words; int __pyx_v_word_len; char *__pyx_v_c_word; @@ -13215,7 +13409,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __p goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BiLex.read_wordlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_wordlist", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_word); @@ -13225,8 +13419,8 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __p } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -13236,11 +13430,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_4read_binary(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_5BiLex_4read_binary(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13253,7 +13447,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13281,7 +13475,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ * self.e_index.read_handle(f) * self.col1.read_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":249 * f = fopen(filename, "r") @@ -13290,7 +13484,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ * self.col1.read_handle(f) * self.col2.read_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":250 * self.f_index.read_handle(f) @@ -13299,7 +13493,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ * self.col2.read_handle(f) * self.read_wordlist(self.fword2id, self.id2fword, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":251 * self.e_index.read_handle(f) @@ -13308,7 +13502,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ * self.read_wordlist(self.fword2id, self.id2fword, f) * self.read_wordlist(self.eword2id, self.id2eword, f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":252 * self.col1.read_handle(f) @@ -13321,7 +13515,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_v_self->id2fword; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->read_wordlist(__pyx_v_self, __pyx_t_1, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->read_wordlist(__pyx_v_self, __pyx_t_1, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 252; __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; @@ -13338,7 +13532,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_v_self->id2eword; __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->read_wordlist(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->read_wordlist(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13359,7 +13553,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.BiLex.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -13368,12 +13562,12 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_4read_binary(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword) { +static PyObject *__pyx_pw_3_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject *__pyx_v_eword) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_e_id (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_6get_e_id(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_eword)); + __pyx_r = __pyx_pf_3_sa_5BiLex_6get_e_id(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_eword)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13386,7 +13580,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyO * e_id = len(self.id2eword) */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_6get_e_id(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword) { +static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_eword) { PyObject *__pyx_v_e_id = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13465,7 +13659,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_6get_e_id(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BiLex.get_e_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.get_e_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e_id); @@ -13475,12 +13669,12 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_6get_e_id(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword) { +static PyObject *__pyx_pw_3_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject *__pyx_v_fword) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_f_id (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_8get_f_id(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_fword)); + __pyx_r = __pyx_pf_3_sa_5BiLex_8get_f_id(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((PyObject *)__pyx_v_fword)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13493,7 +13687,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyO * f_id = len(self.id2fword) */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_8get_f_id(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword) { +static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword) { PyObject *__pyx_v_f_id = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13572,7 +13766,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_8get_f_id(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BiLex.get_f_id", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.get_f_id", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f_id); @@ -13582,8 +13776,8 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_8get_f_id(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -13593,11 +13787,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_11read_text(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_10read_text(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_5BiLex_10read_text(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13610,14 +13804,14 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_11read_text(PyObject *__pyx_v_self, P * cdef IntList fcount */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; PyObject *__pyx_v_e_id = 0; PyObject *__pyx_v_f_id = 0; PyObject *__pyx_v_n_f = 0; PyObject *__pyx_v_N = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_fcount = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_fcount = 0; PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_line = NULL; PyObject *__pyx_v_fword = NULL; @@ -13664,9 +13858,9 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s * with gzip_or_text(filename) as f: * # first loop merely establishes size of array objects */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_fcount = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_fcount = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":278 @@ -13727,10 +13921,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) { @@ -13760,22 +13962,23 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -13785,28 +13988,36 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { + } else + { Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 2; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 3; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L18_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L19_unpacking_done; __pyx_L18_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L19_unpacking_done:; } @@ -13946,13 +14157,13 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_GOTREF(__pyx_t_12); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->f_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->f_index)); - __pyx_v_self->f_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_12); + __pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":292 @@ -14044,13 +14255,13 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->e_index); __Pyx_DECREF(((PyObject *)__pyx_v_self->e_index)); - __pyx_v_self->e_index = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_12); + __pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12); __pyx_t_12 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":298 @@ -14063,13 +14274,13 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col1); __Pyx_DECREF(((PyObject *)__pyx_v_self->col1)); - __pyx_v_self->col1 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_1); + __pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":299 @@ -14082,13 +14293,13 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_v_N) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_FloatList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->col2); __Pyx_DECREF(((PyObject *)__pyx_v_self->col2)); - __pyx_v_self->col2 = ((struct __pyx_obj_8_cdec_sa_FloatList *)__pyx_t_12); + __pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12); __pyx_t_12 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/bilex.pxi":302 @@ -14123,10 +14334,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; + #else + __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_12 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_12)) { @@ -14156,22 +14375,23 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -14181,28 +14401,36 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { + } else + { Py_ssize_t index = -1; + PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_2}; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 2; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 3; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L27_unpacking_done; __pyx_L26_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_14 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L27_unpacking_done:; } @@ -14358,7 +14586,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s * for line in f: */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); @@ -14488,7 +14716,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __pyx_t_24 = __Pyx_PyInt_AsInt(__pyx_v_j); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyObject *)__pyx_kp_s_42); __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_t_20, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_t_20, __pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14518,7 +14746,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("_cdec_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); @@ -14549,7 +14777,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_10read_text(struct __pyx_obj_8_cdec_s * cdef float ftmp */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex_swap(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) { +static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, int __pyx_v_i, int __pyx_v_j) { int __pyx_v_itmp; float __pyx_v_ftmp; PyObject *__pyx_r = NULL; @@ -14677,7 +14905,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_swap(struct __pyx_obj_8_cdec_sa_BiLex * */ -static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, PyObject *__pyx_v_pad) { +static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, PyObject *__pyx_v_pad) { int __pyx_v_pval; int __pyx_v_p; long __pyx_v_k; @@ -14791,7 +15019,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex * p = i * for k from i+1 <= k < j: */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, __pyx_v_i, __pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, __pyx_v_i, __pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14831,7 +15059,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex * self.swap(p, p+1) * p = p + 1 */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, (__pyx_v_p + 1), __pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, (__pyx_v_p + 1), __pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14842,7 +15070,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex * p = p + 1 * self.qsort(i,p, pad+" ") */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, __pyx_v_p, (__pyx_v_p + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->swap(__pyx_v_self, __pyx_v_p, (__pyx_v_p + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14868,7 +15096,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex */ __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_v_i, __pyx_v_p, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, __pyx_v_i, __pyx_v_p, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -14882,7 +15110,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex */ __pyx_t_4 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, (__pyx_v_p + 1), __pyx_v_j, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_BiLex *)__pyx_v_self->__pyx_vtab)->qsort(__pyx_v_self, (__pyx_v_p + 1), __pyx_v_j, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14892,7 +15120,7 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.BiLex.qsort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.qsort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -14901,8 +15129,8 @@ static PyObject *__pyx_f_8_cdec_sa_5BiLex_qsort(struct __pyx_obj_8_cdec_sa_BiLex } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -14912,11 +15140,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_5BiLex_12write_enhanced(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -14929,7 +15157,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_se * for i in self.f_index: */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_s1 = NULL; @@ -15016,10 +15244,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { @@ -15106,10 +15342,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -15123,21 +15367,22 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - } __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_11 = PyList_GET_ITEM(sequence, 2); @@ -15145,8 +15390,14 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); + #else + __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_12); @@ -15159,12 +15410,13 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_13 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __pyx_L21_unpacking_done:; } @@ -15248,10 +15500,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_11 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_11)) { @@ -15343,10 +15603,18 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_10 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_10)) { @@ -15438,7 +15706,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c * f.write("%d " % i) */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); @@ -15519,7 +15787,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("_cdec_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -15533,16 +15801,16 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_12write_enhanced(struct __pyx_obj_8_c } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fword = 0; PyObject *__pyx_v_eword = 0; PyObject *__pyx_v_col = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_score (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fword,&__pyx_n_s__eword,&__pyx_n_s__col,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -15557,18 +15825,15 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_15get_score(PyObject *__pyx_v_self, P kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fword)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eword)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -15591,11 +15856,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_15get_score(PyObject *__pyx_v_self, P __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_score", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.get_score", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.get_score", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_14get_score(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), __pyx_v_fword, __pyx_v_eword, __pyx_v_col); + __pyx_r = __pyx_pf_3_sa_5BiLex_14get_score(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), __pyx_v_fword, __pyx_v_eword, __pyx_v_col); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -15608,7 +15873,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_15get_score(PyObject *__pyx_v_self, P * */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_14get_score(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword, PyObject *__pyx_v_eword, PyObject *__pyx_v_col) { +static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, PyObject *__pyx_v_fword, PyObject *__pyx_v_eword, PyObject *__pyx_v_col) { PyObject *__pyx_v_e_id = 0; PyObject *__pyx_v_f_id = 0; PyObject *__pyx_v_low = 0; @@ -15928,7 +16193,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_14get_score(struct __pyx_obj_8_cdec_s __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.BiLex.get_score", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.get_score", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e_id); @@ -15943,9 +16208,9 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_14get_score(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static char __pyx_doc_8_cdec_sa_5BiLex_16write_text[] = "Note: does not guarantee writing the dictionary in the original order"; -static PyObject *__pyx_pw_8_cdec_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static char __pyx_doc_3_sa_5BiLex_16write_text[] = "Note: does not guarantee writing the dictionary in the original order"; +static PyObject *__pyx_pw_3_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -15955,11 +16220,11 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_17write_text(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_5BiLex_16write_text(((struct __pyx_obj_8_cdec_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_5BiLex_16write_text(((struct __pyx_obj_3_sa_BiLex *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -15972,7 +16237,7 @@ static PyObject *__pyx_pw_8_cdec_sa_5BiLex_17write_text(PyObject *__pyx_v_self, * cdef i, N, e_id, f_id */ -static PyObject *__pyx_pf_8_cdec_sa_5BiLex_16write_text(struct __pyx_obj_8_cdec_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_N = 0; PyObject *__pyx_v_e_id = 0; @@ -16230,7 +16495,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_16write_text(struct __pyx_obj_8_cdec_ * f_id = 0 */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_12, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_12); @@ -16309,7 +16574,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_16write_text(struct __pyx_obj_8_cdec_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("_cdec_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BiLex.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); @@ -16332,7 +16597,7 @@ static PyObject *__pyx_pf_8_cdec_sa_5BiLex_16write_text(struct __pyx_obj_8_cdec_ * cdef int mask = 0 */ -static void __pyx_f_8_cdec_sa__init_lower_mask(void) { +static void __pyx_f_3_sa__init_lower_mask(void) { unsigned int __pyx_v_i; int __pyx_v_mask; __Pyx_RefNannyDeclarations @@ -16356,7 +16621,7 @@ static void __pyx_f_8_cdec_sa__init_lower_mask(void) { * mask = (mask << 1) + 1 * LOWER_MASK[i] = mask */ - __pyx_t_1 = __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE; + __pyx_t_1 = __pyx_v_3_sa_MIN_BOTTOM_SIZE; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; @@ -16376,7 +16641,7 @@ static void __pyx_f_8_cdec_sa__init_lower_mask(void) { * * _init_lower_mask() */ - (__pyx_v_8_cdec_sa_LOWER_MASK[__pyx_v_i]) = __pyx_v_mask; + (__pyx_v_3_sa_LOWER_MASK[__pyx_v_i]) = __pyx_v_mask; } __Pyx_RefNannyFinishContext(); @@ -16390,9 +16655,9 @@ static void __pyx_f_8_cdec_sa__init_lower_mask(void) { * */ -static struct __pyx_t_8_cdec_sa__BitSet *__pyx_f_8_cdec_sa_new_BitSet(void) { - struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_b; - struct __pyx_t_8_cdec_sa__BitSet *__pyx_r; +static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) { + struct __pyx_t_3_sa__BitSet *__pyx_v_b; + struct __pyx_t_3_sa__BitSet *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_BitSet", 0); @@ -16403,7 +16668,7 @@ static struct __pyx_t_8_cdec_sa__BitSet *__pyx_f_8_cdec_sa_new_BitSet(void) { * b.bitset = 0 * b.min_val = -1 */ - __pyx_v_b = ((struct __pyx_t_8_cdec_sa__BitSet *)malloc((sizeof(struct __pyx_t_8_cdec_sa__BitSet)))); + __pyx_v_b = ((struct __pyx_t_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_3_sa__BitSet)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":41 * @@ -16465,7 +16730,7 @@ static struct __pyx_t_8_cdec_sa__BitSet *__pyx_f_8_cdec_sa_new_BitSet(void) { * cdef int low, high, mid */ -static int __pyx_f_8_cdec_sa_bitset_findsucc(struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_b, int __pyx_v_i) { +static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_v_i) { int __pyx_v_bitset; int __pyx_v_mask; int __pyx_v_low; @@ -16537,7 +16802,7 @@ static int __pyx_f_8_cdec_sa_bitset_findsucc(struct __pyx_t_8_cdec_sa__BitSet *_ * low = i+1 * high = b.max_val+1 */ - __pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_8_cdec_sa_LOWER_MASK[__pyx_v_i]))); + __pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_3_sa_LOWER_MASK[__pyx_v_i]))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":58 * @@ -16584,7 +16849,7 @@ static int __pyx_f_8_cdec_sa_bitset_findsucc(struct __pyx_t_8_cdec_sa__BitSet *_ * if bitset & mask == 0: * low = mid */ - __pyx_v_mask = (~((__pyx_v_8_cdec_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_8_cdec_sa_LOWER_MASK[(__pyx_v_mid - 1)]))); + __pyx_v_mask = (~((__pyx_v_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_mid - 1)]))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":63 * mid = (high + low)/2 @@ -16653,7 +16918,7 @@ static int __pyx_f_8_cdec_sa_bitset_findsucc(struct __pyx_t_8_cdec_sa__BitSet *_ * */ -static int __pyx_f_8_cdec_sa_bitset_insert(struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_b, int __pyx_v_i) { +static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_v_i) { int __pyx_v_val; int __pyx_r; __Pyx_RefNannyDeclarations @@ -16811,7 +17076,7 @@ static int __pyx_f_8_cdec_sa_bitset_insert(struct __pyx_t_8_cdec_sa__BitSet *__p * */ -static int __pyx_f_8_cdec_sa_bitset_contains(struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_b, int __pyx_v_i) { +static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b, int __pyx_v_i) { int __pyx_v_val; int __pyx_r; __Pyx_RefNannyDeclarations @@ -16869,12 +17134,12 @@ static int __pyx_f_8_cdec_sa_bitset_contains(struct __pyx_t_8_cdec_sa__BitSet *_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_14BitSetIterator___next__(((struct __pyx_obj_8_cdec_sa_BitSetIterator *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_14BitSetIterator___next__(((struct __pyx_obj_3_sa_BitSetIterator *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -16887,7 +17152,7 @@ static PyObject *__pyx_pw_8_cdec_sa_14BitSetIterator_1__next__(PyObject *__pyx_v * */ -static PyObject *__pyx_pf_8_cdec_sa_14BitSetIterator___next__(struct __pyx_obj_8_cdec_sa_BitSetIterator *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_BitSetIterator *__pyx_v_self) { int __pyx_v_ret_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -16940,7 +17205,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14BitSetIterator___next__(struct __pyx_obj_8 * return ret_val * */ - __pyx_v_self->next_val = __pyx_f_8_cdec_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val); + __pyx_v_self->next_val = __pyx_f_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":111 * ret_val = self.next_val @@ -16960,7 +17225,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14BitSetIterator___next__(struct __pyx_obj_8 goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BitSetIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSetIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -16969,15 +17234,15 @@ static PyObject *__pyx_pf_8_cdec_sa_14BitSetIterator___next__(struct __pyx_obj_8 } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet___cinit__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet___cinit__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -16990,7 +17255,7 @@ static int __pyx_pw_8_cdec_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObjec * */ -static int __pyx_pf_8_cdec_sa_6BitSet___cinit__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static int __pyx_pf_3_sa_6BitSet___cinit__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); @@ -17002,7 +17267,7 @@ static int __pyx_pf_8_cdec_sa_6BitSet___cinit__(struct __pyx_obj_8_cdec_sa_BitSe * * def __dealloc__(self): */ - __pyx_v_self->b = __pyx_f_8_cdec_sa_new_BitSet(); + __pyx_v_self->b = __pyx_f_3_sa_new_BitSet(); __pyx_r = 0; __Pyx_RefNannyFinishContext(); @@ -17010,11 +17275,11 @@ static int __pyx_pf_8_cdec_sa_6BitSet___cinit__(struct __pyx_obj_8_cdec_sa_BitSe } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_6BitSet_2__dealloc__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_pf_3_sa_6BitSet_2__dealloc__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -17026,7 +17291,7 @@ static void __pyx_pw_8_cdec_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_6BitSet_2__dealloc__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static void __pyx_pf_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); @@ -17043,12 +17308,12 @@ static void __pyx_pf_8_cdec_sa_6BitSet_2__dealloc__(struct __pyx_obj_8_cdec_sa_B } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_5__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_4__iter__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet_4__iter__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17061,8 +17326,8 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) { * it = BitSetIterator() */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_4__iter__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { - struct __pyx_obj_8_cdec_sa_BitSetIterator *__pyx_v_it = 0; +static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { + struct __pyx_obj_3_sa_BitSetIterator *__pyx_v_it = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17078,9 +17343,9 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_4__iter__(struct __pyx_obj_8_cdec_sa * it.b = self.b * it.next_val = self.b.min_val */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_BitSetIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_BitSetIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_it = ((struct __pyx_obj_8_cdec_sa_BitSetIterator *)__pyx_t_1); + __pyx_v_it = ((struct __pyx_obj_3_sa_BitSetIterator *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":131 @@ -17117,7 +17382,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_4__iter__(struct __pyx_obj_8_cdec_sa goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.BitSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_it); @@ -17127,12 +17392,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_4__iter__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_6insert(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6BitSet_6insert(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17145,7 +17410,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyOb * */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_6insert(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_6BitSet_6insert(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -17164,7 +17429,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_6insert(struct __pyx_obj_8_cdec_sa_B */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_bitset_insert(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_bitset_insert(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17174,7 +17439,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_6insert(struct __pyx_obj_8_cdec_sa_B goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BitSet.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17183,12 +17448,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_6insert(struct __pyx_obj_8_cdec_sa_B } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("findsucc (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_8findsucc(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6BitSet_8findsucc(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17201,7 +17466,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, Py * */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_8findsucc(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_6BitSet_8findsucc(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -17220,7 +17485,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_8findsucc(struct __pyx_obj_8_cdec_sa */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_bitset_findsucc(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17230,7 +17495,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_8findsucc(struct __pyx_obj_8_cdec_sa goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BitSet.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17239,12 +17504,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_8findsucc(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_11__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_10__str__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet_10__str__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17257,7 +17522,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_11__str__(PyObject *__pyx_v_self) { * */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_10__str__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6BitSet_10__str__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17276,7 +17541,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_10__str__(struct __pyx_obj_8_cdec_sa * def min(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_8_cdec_sa_dec2bin(__pyx_v_self->b->bitset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_3_sa_dec2bin(__pyx_v_self->b->bitset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); @@ -17342,7 +17607,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_10__str__(struct __pyx_obj_8_cdec_sa __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.BitSet.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17351,12 +17616,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_10__str__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("min (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_12min(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet_12min(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17369,7 +17634,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON * */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_12min(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6BitSet_12min(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17396,7 +17661,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_12min(struct __pyx_obj_8_cdec_sa_Bit goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.BitSet.min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.min", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17405,12 +17670,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_12min(struct __pyx_obj_8_cdec_sa_Bit } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("max (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_14max(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet_14max(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17423,7 +17688,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON * */ -static PyObject *__pyx_pf_8_cdec_sa_6BitSet_14max(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6BitSet_14max(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17450,7 +17715,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_14max(struct __pyx_obj_8_cdec_sa_Bit goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.BitSet.max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.max", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -17459,12 +17724,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6BitSet_14max(struct __pyx_obj_8_cdec_sa_Bit } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_6BitSet_17__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_16__len__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6BitSet_16__len__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17477,7 +17742,7 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_6BitSet_17__len__(PyObject *__pyx_v_self) { * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_6BitSet_16__len__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_6BitSet_16__len__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); @@ -17499,12 +17764,12 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_6BitSet_16__len__(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static int __pyx_pw_8_cdec_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static int __pyx_pw_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static int __pyx_pw_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6BitSet_18__contains__(((struct __pyx_obj_8_cdec_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6BitSet_18__contains__(((struct __pyx_obj_3_sa_BitSet *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17517,7 +17782,7 @@ static int __pyx_pw_8_cdec_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyO * */ -static int __pyx_pf_8_cdec_sa_6BitSet_18__contains__(struct __pyx_obj_8_cdec_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { +static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -17536,7 +17801,7 @@ static int __pyx_pf_8_cdec_sa_6BitSet_18__contains__(struct __pyx_obj_8_cdec_sa_ * */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_bitset_contains(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_bitset_contains(__pyx_v_self->b, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17547,7 +17812,7 @@ static int __pyx_pf_8_cdec_sa_6BitSet_18__contains__(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.BitSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.BitSet.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -17562,7 +17827,7 @@ static int __pyx_pf_8_cdec_sa_6BitSet_18__contains__(struct __pyx_obj_8_cdec_sa_ * cdef unsigned d */ -static PyObject *__pyx_f_8_cdec_sa_dec2bin(long __pyx_v_i) { +static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) { PyObject *__pyx_v_result = 0; CYTHON_UNUSED unsigned int __pyx_v_d; PyObject *__pyx_r = NULL; @@ -17593,7 +17858,7 @@ static PyObject *__pyx_f_8_cdec_sa_dec2bin(long __pyx_v_i) { * if i & LOWER_MASK[0] == 0: * result = "0"+result */ - __pyx_t_1 = __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE; + __pyx_t_1 = __pyx_v_3_sa_MIN_BOTTOM_SIZE; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_d = __pyx_t_2; @@ -17604,7 +17869,7 @@ static PyObject *__pyx_f_8_cdec_sa_dec2bin(long __pyx_v_i) { * result = "0"+result * else: */ - __pyx_t_3 = ((__pyx_v_i & (__pyx_v_8_cdec_sa_LOWER_MASK[0])) == 0); + __pyx_t_3 = ((__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[0])) == 0); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":162 @@ -17664,7 +17929,7 @@ static PyObject *__pyx_f_8_cdec_sa_dec2bin(long __pyx_v_i) { goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.dec2bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.dec2bin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -17681,10 +17946,10 @@ static PyObject *__pyx_f_8_cdec_sa_dec2bin(long __pyx_v_i) { * cdef int num_bits, num_top_bits, i */ -static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { - struct __pyx_t_8_cdec_sa__VEB *__pyx_v_veb; +static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) { + struct __pyx_t_3_sa__VEB *__pyx_v_veb; int __pyx_v_num_bits; - struct __pyx_t_8_cdec_sa__VEB *__pyx_r; + struct __pyx_t_3_sa__VEB *__pyx_r; __Pyx_RefNannyDeclarations double __pyx_t_1; double __pyx_t_2; @@ -17701,7 +17966,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * * num_bits = int(ceil(log(n) / log(2))) */ - __pyx_v_veb = ((struct __pyx_t_8_cdec_sa__VEB *)malloc((sizeof(struct __pyx_t_8_cdec_sa__VEB)))); + __pyx_v_veb = ((struct __pyx_t_3_sa__VEB *)malloc((sizeof(struct __pyx_t_3_sa__VEB)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":183 * veb = <_VEB*> malloc(sizeof(_VEB)) @@ -17734,7 +17999,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * veb.num_bottom_bits = MIN_BOTTOM_BITS * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 */ - __pyx_t_3 = (__pyx_v_veb->num_bottom_bits < __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_3 = (__pyx_v_veb->num_bottom_bits < __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":186 @@ -17744,7 +18009,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 * */ - __pyx_v_veb->num_bottom_bits = __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS; + __pyx_v_veb->num_bottom_bits = __pyx_v_3_sa_MIN_BOTTOM_BITS; goto __pyx_L3; } __pyx_L3:; @@ -17783,7 +18048,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * veb.top = new_VEB(veb.top_universe_size) * else: */ - __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":193 @@ -17793,7 +18058,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * else: * veb.top = new_BitSet() */ - __pyx_v_veb->top = __pyx_f_8_cdec_sa_new_VEB(__pyx_v_veb->top_universe_size); + __pyx_v_veb->top = __pyx_f_3_sa_new_VEB(__pyx_v_veb->top_universe_size); goto __pyx_L4; } /*else*/ { @@ -17805,7 +18070,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * * veb.max_val = -1 */ - __pyx_v_veb->top = __pyx_f_8_cdec_sa_new_BitSet(); + __pyx_v_veb->top = __pyx_f_3_sa_new_BitSet(); } __pyx_L4:; @@ -17849,7 +18114,7 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("_cdec_sa.new_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.new_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -17864,9 +18129,9 @@ static struct __pyx_t_8_cdec_sa__VEB *__pyx_f_8_cdec_sa_new_VEB(int __pyx_v_n) { * cdef _BitSet* subb */ -static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_veb, int __pyx_v_i) { - struct __pyx_t_8_cdec_sa__VEB *__pyx_v_subv; - struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_subb; +static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_v_i) { + struct __pyx_t_3_sa__VEB *__pyx_v_subv; + struct __pyx_t_3_sa__BitSet *__pyx_v_subb; int __pyx_v_a; int __pyx_v_b; int __pyx_v_tmp; @@ -17992,7 +18257,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * if veb.bottom[a] == NULL: * if veb.top_universe_size > MIN_BOTTOM_SIZE: */ - __pyx_v_b = (__pyx_v_i & (__pyx_v_8_cdec_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); + __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":220 * a = i >> veb.num_bottom_bits @@ -18011,7 +18276,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * subv = <_VEB*> veb.top * VEB_insert(subv, a) */ - __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":222 @@ -18021,7 +18286,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * VEB_insert(subv, a) * else: */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)__pyx_v_veb->top); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":223 * if veb.top_universe_size > MIN_BOTTOM_SIZE: @@ -18030,7 +18295,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * else: * subb = <_BitSet*> veb.top */ - __pyx_f_8_cdec_sa_VEB_insert(__pyx_v_subv, __pyx_v_a); + __pyx_f_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_a); goto __pyx_L6; } /*else*/ { @@ -18042,7 +18307,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * bitset_insert(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)__pyx_v_veb->top); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":226 * else: @@ -18051,7 +18316,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) */ - __pyx_f_8_cdec_sa_bitset_insert(__pyx_v_subb, __pyx_v_a); + __pyx_f_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_a); } __pyx_L6:; @@ -18062,7 +18327,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) * else: */ - __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":228 @@ -18072,7 +18337,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * else: * veb.bottom[a] = new_BitSet() */ - (__pyx_v_veb->bottom[__pyx_v_a]) = __pyx_f_8_cdec_sa_new_VEB((1 << __pyx_v_veb->num_bottom_bits)); + (__pyx_v_veb->bottom[__pyx_v_a]) = __pyx_f_3_sa_new_VEB((1 << __pyx_v_veb->num_bottom_bits)); goto __pyx_L7; } /*else*/ { @@ -18084,7 +18349,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[a] */ - (__pyx_v_veb->bottom[__pyx_v_a]) = __pyx_f_8_cdec_sa_new_BitSet(); + (__pyx_v_veb->bottom[__pyx_v_a]) = __pyx_f_3_sa_new_BitSet(); } __pyx_L7:; goto __pyx_L5; @@ -18098,7 +18363,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * subv = <_VEB*> veb.bottom[a] * if VEB_insert(subv, b) == 0: */ - __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":232 @@ -18108,7 +18373,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * if VEB_insert(subv, b) == 0: * return 0 */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":233 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: @@ -18117,7 +18382,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * return 0 * else: */ - __pyx_t_3 = (__pyx_f_8_cdec_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0); + __pyx_t_3 = (__pyx_f_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":234 @@ -18143,7 +18408,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * if bitset_insert(subb, b) == 0: * return 0 */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":237 * else: @@ -18152,7 +18417,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * return 0 * */ - __pyx_t_3 = (__pyx_f_8_cdec_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0); + __pyx_t_3 = (__pyx_f_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":238 @@ -18227,7 +18492,7 @@ static int __pyx_f_8_cdec_sa_VEB_insert(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_v * */ -static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_veb) { +static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -18245,7 +18510,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * i = (<_VEB*> veb.top).min_val * else: */ - __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":250 @@ -18255,7 +18520,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * else: * i = (<_BitSet*> veb.top).min_val */ - __pyx_v_i = ((struct __pyx_t_8_cdec_sa__VEB *)__pyx_v_veb->top)->min_val; + __pyx_v_i = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top)->min_val; goto __pyx_L3; } /*else*/ { @@ -18267,7 +18532,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * * while i != -1: */ - __pyx_v_i = ((struct __pyx_t_8_cdec_sa__BitSet *)__pyx_v_veb->top)->min_val; + __pyx_v_i = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top)->min_val; } __pyx_L3:; @@ -18289,7 +18554,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * del_VEB(<_VEB*> veb.bottom[i]) * else: */ - __pyx_t_1 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_1 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":256 @@ -18299,7 +18564,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * else: * free(<_BitSet*> veb.bottom[i]) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_del_VEB(((struct __pyx_t_8_cdec_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_del_VEB(((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L6; @@ -18313,7 +18578,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * * if veb.top_universe_size > MIN_BOTTOM_SIZE: */ - free(((struct __pyx_t_8_cdec_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_i]))); + free(((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_i]))); } __pyx_L6:; @@ -18324,7 +18589,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * i = VEB_findsucc(<_VEB*> veb.top, i) * else: */ - __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":261 @@ -18334,7 +18599,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * else: * i = bitset_findsucc(<_BitSet*> veb.top, i) */ - __pyx_v_i = __pyx_f_8_cdec_sa_VEB_findsucc(((struct __pyx_t_8_cdec_sa__VEB *)__pyx_v_veb->top), __pyx_v_i); + __pyx_v_i = __pyx_f_3_sa_VEB_findsucc(((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top), __pyx_v_i); goto __pyx_L7; } /*else*/ { @@ -18346,7 +18611,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * * if veb.top_universe_size > MIN_BOTTOM_SIZE: */ - __pyx_v_i = __pyx_f_8_cdec_sa_bitset_findsucc(((struct __pyx_t_8_cdec_sa__BitSet *)__pyx_v_veb->top), __pyx_v_i); + __pyx_v_i = __pyx_f_3_sa_bitset_findsucc(((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top), __pyx_v_i); } __pyx_L7:; } @@ -18358,7 +18623,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * del_VEB(<_VEB*> veb.top) * else: */ - __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":266 @@ -18368,7 +18633,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * else: * free(<_BitSet*> veb.top) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_del_VEB(((struct __pyx_t_8_cdec_sa__VEB *)__pyx_v_veb->top)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_del_VEB(((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L8; @@ -18382,7 +18647,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * free(veb.bottom) * free(veb) */ - free(((struct __pyx_t_8_cdec_sa__BitSet *)__pyx_v_veb->top)); + free(((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top)); } __pyx_L8:; @@ -18408,7 +18673,7 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.del_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.del_VEB", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -18424,9 +18689,9 @@ static PyObject *__pyx_f_8_cdec_sa_del_VEB(struct __pyx_t_8_cdec_sa__VEB *__pyx_ * cdef _BitSet* subb */ -static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_veb, int __pyx_v_i) { - struct __pyx_t_8_cdec_sa__VEB *__pyx_v_subv; - struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_subb; +static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_v_i) { + struct __pyx_t_3_sa__VEB *__pyx_v_subv; + struct __pyx_t_3_sa__BitSet *__pyx_v_subb; int __pyx_v_a; int __pyx_v_b; int __pyx_v_j; @@ -18507,7 +18772,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * found = 0 * if veb.bottom[a] != NULL: */ - __pyx_v_b = (__pyx_v_i & (__pyx_v_8_cdec_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); + __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":285 * a = i >> veb.num_bottom_bits @@ -18535,7 +18800,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * subv = <_VEB*> veb.bottom[a] * if subv.max_val > b: */ - __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":288 @@ -18545,7 +18810,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * if subv.max_val > b: * j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":289 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: @@ -18564,7 +18829,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * found = 1 * else: */ - __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_8_cdec_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b)); + __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":291 * if subv.max_val > b: @@ -18588,7 +18853,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * if subb.max_val > b: * j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":294 * else: @@ -18607,7 +18872,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * found = 1 * if found==0: */ - __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_8_cdec_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b)); + __pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":296 * if subb.max_val > b: @@ -18643,7 +18908,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * subv = <_VEB*> veb.top * c = VEB_findsucc(subv, a) */ - __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE); + __pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":299 @@ -18653,7 +18918,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * c = VEB_findsucc(subv, a) * else: */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)__pyx_v_veb->top); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":300 * if veb.top_universe_size > MIN_BOTTOM_SIZE: @@ -18662,7 +18927,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * else: * subb = <_BitSet*> veb.top */ - __pyx_v_c = __pyx_f_8_cdec_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_a); + __pyx_v_c = __pyx_f_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_a); goto __pyx_L10; } /*else*/ { @@ -18674,7 +18939,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * c = bitset_findsucc(subb, a) * if veb.num_bottom_bits > MIN_BOTTOM_BITS: */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)__pyx_v_veb->top); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":303 * else: @@ -18683,7 +18948,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * if veb.num_bottom_bits > MIN_BOTTOM_BITS: * subv = <_VEB*> veb.bottom[c] */ - __pyx_v_c = __pyx_f_8_cdec_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_a); + __pyx_v_c = __pyx_f_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_a); } __pyx_L10:; @@ -18694,7 +18959,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * subv = <_VEB*> veb.bottom[c] * j = (c << veb.num_bottom_bits) + subv.min_val */ - __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":305 @@ -18704,7 +18969,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * j = (c << veb.num_bottom_bits) + subv.min_val * else: */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c])); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":306 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: @@ -18725,7 +18990,7 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * j = (c << veb.num_bottom_bits) + subb.min_val * return j */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c])); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":309 * else: @@ -18765,9 +19030,9 @@ static int __pyx_f_8_cdec_sa_VEB_findsucc(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * cdef _BitSet* subb */ -static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v_veb, int __pyx_v_i) { - struct __pyx_t_8_cdec_sa__VEB *__pyx_v_subv; - struct __pyx_t_8_cdec_sa__BitSet *__pyx_v_subb; +static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __pyx_v_i) { + struct __pyx_t_3_sa__VEB *__pyx_v_subv; + struct __pyx_t_3_sa__BitSet *__pyx_v_subb; int __pyx_v_a; int __pyx_v_b; int __pyx_r; @@ -18877,7 +19142,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * if veb.bottom[a] == NULL: * return 0 */ - __pyx_v_b = (__pyx_v_i & (__pyx_v_8_cdec_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); + __pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":329 * a = i >> veb.num_bottom_bits @@ -18909,7 +19174,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * subv = <_VEB*> veb.bottom[a] * return VEB_contains(subv, b) */ - __pyx_t_2 = (__pyx_v_veb->num_bottom_bits > __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS); + __pyx_t_2 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS); if (__pyx_t_2) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":333 @@ -18919,7 +19184,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * return VEB_contains(subv, b) * else: */ - __pyx_v_subv = ((struct __pyx_t_8_cdec_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":334 * if veb.num_bottom_bits > MIN_BOTTOM_BITS: @@ -18928,7 +19193,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * else: * subb = <_BitSet*> veb.bottom[a] */ - __pyx_r = __pyx_f_8_cdec_sa_VEB_contains(__pyx_v_subv, __pyx_v_b); + __pyx_r = __pyx_f_3_sa_VEB_contains(__pyx_v_subv, __pyx_v_b); goto __pyx_L0; goto __pyx_L7; } @@ -18941,7 +19206,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * return bitset_contains(subb, b) * */ - __pyx_v_subb = ((struct __pyx_t_8_cdec_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); + __pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":337 * else: @@ -18950,7 +19215,7 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v * * */ - __pyx_r = __pyx_f_8_cdec_sa_bitset_contains(__pyx_v_subb, __pyx_v_b); + __pyx_r = __pyx_f_3_sa_bitset_contains(__pyx_v_subb, __pyx_v_b); goto __pyx_L0; } __pyx_L7:; @@ -18964,12 +19229,12 @@ static int __pyx_f_8_cdec_sa_VEB_contains(struct __pyx_t_8_cdec_sa__VEB *__pyx_v } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_11VEBIterator___next__(((struct __pyx_obj_8_cdec_sa_VEBIterator *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_11VEBIterator___next__(((struct __pyx_obj_3_sa_VEBIterator *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -18982,7 +19247,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11VEBIterator_1__next__(PyObject *__pyx_v_se * */ -static PyObject *__pyx_pf_8_cdec_sa_11VEBIterator___next__(struct __pyx_obj_8_cdec_sa_VEBIterator *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBIterator *__pyx_v_self) { int __pyx_v_ret_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -19035,7 +19300,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11VEBIterator___next__(struct __pyx_obj_8_cd * return ret_val * */ - __pyx_v_self->next_val = __pyx_f_8_cdec_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val); + __pyx_v_self->next_val = __pyx_f_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":351 * ret_val = self.next_val @@ -19055,7 +19320,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11VEBIterator___next__(struct __pyx_obj_8_cd goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.VEBIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEBIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -19064,14 +19329,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11VEBIterator___next__(struct __pyx_obj_8_cd } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_size; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -19084,8 +19349,7 @@ static int __pyx_pw_8_cdec_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject * kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -19102,11 +19366,11 @@ static int __pyx_pw_8_cdec_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject * __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.VEB.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_3VEB___cinit__(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self), __pyx_v_size); + __pyx_r = __pyx_pf_3_sa_3VEB___cinit__(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self), __pyx_v_size); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19119,7 +19383,7 @@ static int __pyx_pw_8_cdec_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject * * */ -static int __pyx_pf_8_cdec_sa_3VEB___cinit__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, int __pyx_v_size) { +static int __pyx_pf_3_sa_3VEB___cinit__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, int __pyx_v_size) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); @@ -19131,7 +19395,7 @@ static int __pyx_pf_8_cdec_sa_3VEB___cinit__(struct __pyx_obj_8_cdec_sa_VEB *__p * * def __dealloc__(self): */ - __pyx_v_self->veb = __pyx_f_8_cdec_sa_new_VEB(__pyx_v_size); + __pyx_v_self->veb = __pyx_f_3_sa_new_VEB(__pyx_v_size); __pyx_r = 0; __Pyx_RefNannyFinishContext(); @@ -19139,11 +19403,11 @@ static int __pyx_pf_8_cdec_sa_3VEB___cinit__(struct __pyx_obj_8_cdec_sa_VEB *__p } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_3VEB_2__dealloc__(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self)); + __pyx_pf_3_sa_3VEB_2__dealloc__(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -19155,7 +19419,7 @@ static void __pyx_pw_8_cdec_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_3VEB_2__dealloc__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self) { +static void __pyx_pf_3_sa_3VEB_2__dealloc__(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; @@ -19170,25 +19434,25 @@ static void __pyx_pf_8_cdec_sa_3VEB_2__dealloc__(struct __pyx_obj_8_cdec_sa_VEB * * def __iter__(self): */ - __pyx_t_1 = __pyx_f_8_cdec_sa_del_VEB(__pyx_v_self->veb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_3_sa_del_VEB(__pyx_v_self->veb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.VEB.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_5__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_3VEB_4__iter__(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_3VEB_4__iter__(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19201,8 +19465,8 @@ static PyObject *__pyx_pw_8_cdec_sa_3VEB_5__iter__(PyObject *__pyx_v_self) { * it = VEBIterator() */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_4__iter__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self) { - struct __pyx_obj_8_cdec_sa_VEBIterator *__pyx_v_it = 0; +static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { + struct __pyx_obj_3_sa_VEBIterator *__pyx_v_it = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19218,9 +19482,9 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_4__iter__(struct __pyx_obj_8_cdec_sa_VE * it.v = self.veb * it.next_val = self.veb.min_val */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_VEBIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEBIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_it = ((struct __pyx_obj_8_cdec_sa_VEBIterator *)__pyx_t_1); + __pyx_v_it = ((struct __pyx_obj_3_sa_VEBIterator *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":369 @@ -19257,7 +19521,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_4__iter__(struct __pyx_obj_8_cdec_sa_VE goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.VEB.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_it); @@ -19267,12 +19531,12 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_4__iter__(struct __pyx_obj_8_cdec_sa_VE } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_3VEB_6insert(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_3VEB_6insert(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19285,7 +19549,7 @@ static PyObject *__pyx_pw_8_cdec_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObjec * */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_6insert(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -19304,7 +19568,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_6insert(struct __pyx_obj_8_cdec_sa_VEB */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_VEB_insert(__pyx_v_self->veb, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_VEB_insert(__pyx_v_self->veb, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19314,7 +19578,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_6insert(struct __pyx_obj_8_cdec_sa_VEB goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.VEB.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -19330,7 +19594,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_6insert(struct __pyx_obj_8_cdec_sa_VEB * */ -static int __pyx_f_8_cdec_sa_3VEB__insert(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, int __pyx_v_i) { +static int __pyx_f_3_sa_3VEB__insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, int __pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_insert", 0); @@ -19342,7 +19606,7 @@ static int __pyx_f_8_cdec_sa_3VEB__insert(struct __pyx_obj_8_cdec_sa_VEB *__pyx_ * * def findsucc(self, i): */ - __pyx_r = __pyx_f_8_cdec_sa_VEB_insert(__pyx_v_self->veb, __pyx_v_i); + __pyx_r = __pyx_f_3_sa_VEB_insert(__pyx_v_self->veb, __pyx_v_i); goto __pyx_L0; __pyx_r = 0; @@ -19352,12 +19616,12 @@ static int __pyx_f_8_cdec_sa_3VEB__insert(struct __pyx_obj_8_cdec_sa_VEB *__pyx_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("findsucc (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_3VEB_8findsucc(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_3VEB_8findsucc(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19370,7 +19634,7 @@ static PyObject *__pyx_pw_8_cdec_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObj * */ -static PyObject *__pyx_pf_8_cdec_sa_3VEB_8findsucc(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -19389,7 +19653,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_8findsucc(struct __pyx_obj_8_cdec_sa_VE */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -19399,7 +19663,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_8findsucc(struct __pyx_obj_8_cdec_sa_VE goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.VEB.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.findsucc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -19415,7 +19679,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3VEB_8findsucc(struct __pyx_obj_8_cdec_sa_VE * */ -static int __pyx_f_8_cdec_sa_3VEB__first(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self) { +static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_first", 0); @@ -19444,7 +19708,7 @@ static int __pyx_f_8_cdec_sa_3VEB__first(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v * */ -static int __pyx_f_8_cdec_sa_3VEB__findsucc(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, int __pyx_v_i) { +static int __pyx_f_3_sa_3VEB__findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self, int __pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_findsucc", 0); @@ -19456,7 +19720,7 @@ static int __pyx_f_8_cdec_sa_3VEB__findsucc(struct __pyx_obj_8_cdec_sa_VEB *__py * * def __len__(self): */ - __pyx_r = __pyx_f_8_cdec_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_v_i); + __pyx_r = __pyx_f_3_sa_VEB_findsucc(__pyx_v_self->veb, __pyx_v_i); goto __pyx_L0; __pyx_r = 0; @@ -19466,12 +19730,12 @@ static int __pyx_f_8_cdec_sa_3VEB__findsucc(struct __pyx_obj_8_cdec_sa_VEB *__py } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_3VEB_11__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_3VEB_11__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_3VEB_11__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_3VEB_10__len__(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_3VEB_10__len__(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19484,7 +19748,7 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_3VEB_11__len__(PyObject *__pyx_v_self) { * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_3VEB_10__len__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_3VEB_10__len__(struct __pyx_obj_3_sa_VEB *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); @@ -19506,12 +19770,12 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_3VEB_10__len__(struct __pyx_obj_8_cdec_sa_V } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static int __pyx_pw_8_cdec_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static int __pyx_pw_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static int __pyx_pw_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_3VEB_12__contains__(((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_3VEB_12__contains__(((struct __pyx_obj_3_sa_VEB *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19523,7 +19787,7 @@ static int __pyx_pw_8_cdec_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObje * return VEB_contains(self.veb, i) */ -static int __pyx_pf_8_cdec_sa_3VEB_12__contains__(struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { +static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_self, PyObject *__pyx_v_i) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -19538,13 +19802,13 @@ static int __pyx_pf_8_cdec_sa_3VEB_12__contains__(struct __pyx_obj_8_cdec_sa_VEB * return VEB_contains(self.veb, i) # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_f_8_cdec_sa_VEB_contains(__pyx_v_self->veb, __pyx_t_1); + __pyx_r = __pyx_f_3_sa_VEB_contains(__pyx_v_self->veb, __pyx_t_1); goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.VEB.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.VEB.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -19552,14 +19816,14 @@ static int __pyx_pf_8_cdec_sa_3VEB_12__contains__(struct __pyx_obj_8_cdec_sa_VEB } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sa = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; +static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sa = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -19572,8 +19836,7 @@ static int __pyx_pw_8_cdec_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject * kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sa)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { @@ -19584,18 +19847,18 @@ static int __pyx_pw_8_cdec_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject * } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_sa = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)values[0]); + __pyx_v_sa = ((struct __pyx_obj_3_sa_SuffixArray *)values[0]); } 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[9]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.LCP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.LCP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sa), __pyx_ptype_8_cdec_sa_SuffixArray, 1, "sa", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_3LCP___cinit__(((struct __pyx_obj_8_cdec_sa_LCP *)__pyx_v_self), __pyx_v_sa); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sa), __pyx_ptype_3_sa_SuffixArray, 1, "sa", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_3LCP___cinit__(((struct __pyx_obj_3_sa_LCP *)__pyx_v_self), __pyx_v_sa); goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -19612,13 +19875,13 @@ static int __pyx_pw_8_cdec_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject * * cdef IntList rank */ -static int __pyx_pf_8_cdec_sa_3LCP___cinit__(struct __pyx_obj_8_cdec_sa_LCP *__pyx_v_self, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sa) { +static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sa) { int __pyx_v_i; int __pyx_v_k; int __pyx_v_j; int __pyx_v_h; int __pyx_v_n; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_rank = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_rank = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19685,13 +19948,13 @@ static int __pyx_pf_8_cdec_sa_3LCP___cinit__(struct __pyx_obj_8_cdec_sa_LCP *__p __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->lcp); __Pyx_DECREF(((PyObject *)__pyx_v_self->lcp)); - __pyx_v_self->lcp = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_2); + __pyx_v_self->lcp = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":18 @@ -19707,10 +19970,10 @@ static int __pyx_pf_8_cdec_sa_3LCP___cinit__(struct __pyx_obj_8_cdec_sa_LCP *__p __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_v_rank = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":19 @@ -19881,19 +20144,19 @@ static int __pyx_pf_8_cdec_sa_3LCP___cinit__(struct __pyx_obj_8_cdec_sa_LCP *__p __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.LCP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.LCP.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rank); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_3_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObject *__pyx_arg_max_n); /*proto*/ -static char __pyx_doc_8_cdec_sa_3LCP_2compute_stats[] = "Note: the output of this function is not exact. In\n particular, the frequency associated with each word is \n not guaranteed to be correct. This is due to a bit of\n laxness in the design; the function is intended only to\n obtain a list of the most frequent words; for this \n purpose it is perfectly fine"; -static PyObject *__pyx_pw_8_cdec_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObject *__pyx_arg_max_n) { +static PyObject *__pyx_pw_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObject *__pyx_arg_max_n); /*proto*/ +static char __pyx_doc_3_sa_3LCP_2compute_stats[] = "Note: the output of this function is not exact. In\n particular, the frequency associated with each word is \n not guaranteed to be correct. This is due to a bit of\n laxness in the design; the function is intended only to\n obtain a list of the most frequent words; for this \n purpose it is perfectly fine"; +static PyObject *__pyx_pw_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObject *__pyx_arg_max_n) { int __pyx_v_max_n; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations @@ -19903,11 +20166,11 @@ static PyObject *__pyx_pw_8_cdec_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.LCP.compute_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.LCP.compute_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_3LCP_2compute_stats(((struct __pyx_obj_8_cdec_sa_LCP *)__pyx_v_self), ((int)__pyx_v_max_n)); + __pyx_r = __pyx_pf_3_sa_3LCP_2compute_stats(((struct __pyx_obj_3_sa_LCP *)__pyx_v_self), ((int)__pyx_v_max_n)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -19920,15 +20183,15 @@ static PyObject *__pyx_pw_8_cdec_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, * particular, the frequency associated with each word is */ -static PyObject *__pyx_pf_8_cdec_sa_3LCP_2compute_stats(struct __pyx_obj_8_cdec_sa_LCP *__pyx_v_self, int __pyx_v_max_n) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *__pyx_cur_scope; +static PyObject *__pyx_pf_3_sa_3LCP_2compute_stats(struct __pyx_obj_3_sa_LCP *__pyx_v_self, int __pyx_v_max_n) { + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compute_stats", 0); - __pyx_cur_scope = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)__pyx_ptype_8_cdec_sa___pyx_scope_struct__compute_stats->tp_new(__pyx_ptype_8_cdec_sa___pyx_scope_struct__compute_stats, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)__pyx_ptype_3_sa___pyx_scope_struct__compute_stats->tp_new(__pyx_ptype_3_sa___pyx_scope_struct__compute_stats, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __Pyx_RefNannyFinishContext(); return NULL; @@ -19939,7 +20202,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3LCP_2compute_stats(struct __pyx_obj_8_cdec_ __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_max_n = __pyx_v_max_n; { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8_cdec_sa_3LCP_4generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_3LCP_4generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -19948,7 +20211,7 @@ static PyObject *__pyx_pf_8_cdec_sa_3LCP_2compute_stats(struct __pyx_obj_8_cdec_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.LCP.compute_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.LCP.compute_stats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); @@ -19957,9 +20220,9 @@ static PyObject *__pyx_pf_8_cdec_sa_3LCP_2compute_stats(struct __pyx_obj_8_cdec_ return __pyx_r; } -static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_3_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *__pyx_cur_scope = ((struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)__pyx_generator->closure); + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -20028,7 +20291,7 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_4 = PyList_Append(__pyx_cur_scope->__pyx_v_ngram_starts, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -20048,11 +20311,11 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":55 @@ -20069,11 +20332,11 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_t_1); + __pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":57 @@ -20171,7 +20434,7 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx * ngram_start = ngram_starts[n] * while ngram_start.arr[freq] > 0: */ - ((struct __pyx_vtabstruct_8_cdec_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq); + ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":67 * if freq > 1000: # arbitrary, but see note below @@ -20182,11 +20445,11 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx */ __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_starts), __pyx_cur_scope->__pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_start)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_start)); __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":68 @@ -20251,7 +20514,7 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx * for n from 0 <= n < max_n: * ngram_start = ngram_starts[n] */ - __pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_8_cdec_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i); + __pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":74 * while i != -1: @@ -20272,11 +20535,11 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx */ __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_starts), __pyx_cur_scope->__pyx_v_n, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_start)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_ngram_start)); __Pyx_GIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/lcp.pxi":76 @@ -20394,7 +20657,7 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx __pyx_cur_scope->__pyx_v_k = __pyx_t_6; __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (unlikely(PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = ((PyObject *)PyList_AsTuple(__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -20479,20 +20742,21 @@ static PyObject *__pyx_gb_8_cdec_sa_3LCP_4generator(__pyx_GeneratorObject *__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - __pyx_r = __pyx_pf_8_cdec_sa_8Alphabet___cinit__(((struct __pyx_obj_8_cdec_sa_Alphabet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8Alphabet___cinit__(((struct __pyx_obj_3_sa_Alphabet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -20505,7 +20769,7 @@ static int __pyx_pw_8_cdec_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObj * self.nonterminals = StringMap() */ -static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self) { +static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -20521,12 +20785,12 @@ static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alp * self.nonterminals = StringMap() * self.id2sym = {} */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->terminals); __Pyx_DECREF(((PyObject *)__pyx_v_self->terminals)); - __pyx_v_self->terminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)__pyx_t_1); + __pyx_v_self->terminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":14 @@ -20536,12 +20800,12 @@ static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alp * self.id2sym = {} * self.first_nonterminal = -1 */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->nonterminals); __Pyx_DECREF(((PyObject *)__pyx_v_self->nonterminals)); - __pyx_v_self->nonterminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)__pyx_t_1); + __pyx_v_self->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":15 @@ -20572,7 +20836,7 @@ static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alp goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Alphabet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Alphabet.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -20580,11 +20844,11 @@ static int __pyx_pf_8_cdec_sa_8Alphabet___cinit__(struct __pyx_obj_8_cdec_sa_Alp } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_8Alphabet_2__dealloc__(((struct __pyx_obj_8_cdec_sa_Alphabet *)__pyx_v_self)); + __pyx_pf_3_sa_8Alphabet_2__dealloc__(((struct __pyx_obj_3_sa_Alphabet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -20596,7 +20860,7 @@ static void __pyx_pw_8_cdec_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) { * */ -static void __pyx_pf_8_cdec_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self) { +static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); @@ -20611,7 +20875,7 @@ static void __pyx_pf_8_cdec_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx * */ -static int __pyx_f_8_cdec_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isvar", 0); @@ -20640,7 +20904,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_8_cd * */ -static int __pyx_f_8_cdec_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isword", 0); @@ -20669,7 +20933,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_8_c * */ -static int __pyx_f_8_cdec_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getindex", 0); @@ -20681,7 +20945,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_8 * * cdef int setindex(self, int sym, int ind): */ - __pyx_r = ((-__pyx_v_sym) & __pyx_v_8_cdec_sa_INDEX_MASK); + __pyx_r = ((-__pyx_v_sym) & __pyx_v_3_sa_INDEX_MASK); goto __pyx_L0; __pyx_r = 0; @@ -20698,7 +20962,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_8 * */ -static int __pyx_f_8_cdec_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym, int __pyx_v_ind) { +static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym, int __pyx_v_ind) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setindex", 0); @@ -20710,7 +20974,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_8 * * cdef int clearindex(self, int sym): */ - __pyx_r = (-(((-__pyx_v_sym) & (~__pyx_v_8_cdec_sa_INDEX_MASK)) | __pyx_v_ind)); + __pyx_r = (-(((-__pyx_v_sym) & (~__pyx_v_3_sa_INDEX_MASK)) | __pyx_v_ind)); goto __pyx_L0; __pyx_r = 0; @@ -20727,7 +20991,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_8 * */ -static int __pyx_f_8_cdec_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearindex", 0); @@ -20739,7 +21003,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj * * cdef int match(self, int sym1, int sym2): */ - __pyx_r = (-((-__pyx_v_sym) & (~__pyx_v_8_cdec_sa_INDEX_MASK))); + __pyx_r = (-((-__pyx_v_sym) & (~__pyx_v_3_sa_INDEX_MASK))); goto __pyx_L0; __pyx_r = 0; @@ -20756,7 +21020,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj * */ -static int __pyx_f_8_cdec_sa_8Alphabet_match(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym1, int __pyx_v_sym2) { +static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym1, int __pyx_v_sym2) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("match", 0); @@ -20768,7 +21032,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_match(struct __pyx_obj_8_cdec_sa_Alphabet * * cdef char* tocat(self, int sym): */ - __pyx_r = (((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym1) == ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym2)); + __pyx_r = (((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym1) == ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->clearindex(__pyx_v_self, __pyx_v_sym2)); goto __pyx_L0; __pyx_r = 0; @@ -20785,7 +21049,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_match(struct __pyx_obj_8_cdec_sa_Alphabet * */ -static char *__pyx_f_8_cdec_sa_8Alphabet_tocat(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { char *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tocat", 0); @@ -20797,7 +21061,7 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tocat(struct __pyx_obj_8_cdec_sa_Alphab * * cdef int fromcat(self, char *s): */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->word(__pyx_v_self->nonterminals, (((-__pyx_v_sym) >> __pyx_v_8_cdec_sa_INDEX_SHIFT) - 1)); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->word(__pyx_v_self->nonterminals, (((-__pyx_v_sym) >> __pyx_v_3_sa_INDEX_SHIFT) - 1)); goto __pyx_L0; __pyx_r = 0; @@ -20814,7 +21078,7 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tocat(struct __pyx_obj_8_cdec_sa_Alphab * i = self.nonterminals.index(s) */ -static int __pyx_f_8_cdec_sa_8Alphabet_fromcat(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, char *__pyx_v_s) { +static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, char *__pyx_v_s) { int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations @@ -20828,7 +21092,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromcat(struct __pyx_obj_8_cdec_sa_Alphab * if self.first_nonterminal == -1: * self.first_nonterminal = i */ - __pyx_v_i = ((struct __pyx_vtabstruct_8_cdec_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s); + __pyx_v_i = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":45 * cdef int i @@ -20881,7 +21145,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromcat(struct __pyx_obj_8_cdec_sa_Alphab * * cdef char* tostring(self, int sym): */ - __pyx_r = (-((__pyx_v_i + 1) << __pyx_v_8_cdec_sa_INDEX_SHIFT)); + __pyx_r = (-((__pyx_v_i + 1) << __pyx_v_3_sa_INDEX_SHIFT)); goto __pyx_L0; __pyx_r = 0; @@ -20898,7 +21162,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromcat(struct __pyx_obj_8_cdec_sa_Alphab * if self.isvar(sym): */ -static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { +static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, int __pyx_v_sym) { int __pyx_v_ind; char *__pyx_r; __Pyx_RefNannyDeclarations @@ -20920,7 +21184,7 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp * if sym in self.id2sym: * return self.id2sym[sym] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym); + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym); if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":54 @@ -20928,12 +21192,13 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp * if self.isvar(sym): * if sym in self.id2sym: # <<<<<<<<<<<<<< * return self.id2sym[sym] - * + * ind = self.getindex(sym) */ __pyx_t_2 = PyInt_FromLong(__pyx_v_sym); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = ((PyDict_Contains(((PyObject *)__pyx_v_self->id2sym), __pyx_t_2))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -20943,9 +21208,13 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp * if self.isvar(sym): * if sym in self.id2sym: * return self.id2sym[sym] # <<<<<<<<<<<<<< - * * ind = self.getindex(sym) + * if ind > 0: */ + if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -20956,17 +21225,17 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp } __pyx_L4:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":57 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":56 + * if sym in self.id2sym: * return self.id2sym[sym] - * * ind = self.getindex(sym) # <<<<<<<<<<<<<< * if ind > 0: * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) */ - __pyx_v_ind = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym); + __pyx_v_ind = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":58 - * + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":57 + * return self.id2sym[sym] * ind = self.getindex(sym) * if ind > 0: # <<<<<<<<<<<<<< * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) @@ -20975,18 +21244,18 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp __pyx_t_3 = (__pyx_v_ind > 0); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":59 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":58 * ind = self.getindex(sym) * if ind > 0: * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) # <<<<<<<<<<<<<< * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) */ - __pyx_t_2 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->tocat(__pyx_v_self, __pyx_v_sym)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->tocat(__pyx_v_self, __pyx_v_sym)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = PyInt_FromLong(__pyx_v_ind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_ind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); @@ -20994,42 +21263,54 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp __Pyx_GIVEREF(__pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_5), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_5), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L5; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":61 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":60 * self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) # <<<<<<<<<<<<<< * return self.id2sym[sym] - * + * else: */ - __pyx_t_5 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->tocat(__pyx_v_self, __pyx_v_sym)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_FromString(((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->tocat(__pyx_v_self, __pyx_v_sym)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_6), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, ((PyObject *)__pyx_t_6), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; } __pyx_L5:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":62 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":61 * else: * self.id2sym[sym] = "[%s]" % self.tocat(sym) * return self.id2sym[sym] # <<<<<<<<<<<<<< - * * else: + * return self.terminals.word(sym) */ - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(((PyObject *)__pyx_v_self->id2sym) == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->id2sym), __pyx_v_sym, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0; @@ -21037,14 +21318,14 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":65 - * + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":63 + * return self.id2sym[sym] * else: * return self.terminals.word(sym) # <<<<<<<<<<<<<< * * cdef int fromstring(self, char *s, bint terminal): */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->word(__pyx_v_self->terminals, __pyx_v_sym); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->word(__pyx_v_self->terminals, __pyx_v_sym); goto __pyx_L0; } __pyx_L3:; @@ -21055,14 +21336,14 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("_cdec_sa.Alphabet.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.Alphabet.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":67 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":65 * return self.terminals.word(sym) * * cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<< @@ -21070,7 +21351,7 @@ static char *__pyx_f_8_cdec_sa_8Alphabet_tostring(struct __pyx_obj_8_cdec_sa_Alp * cdef char *comma */ -static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self, char *__pyx_v_s, int __pyx_v_terminal) { +static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self, char *__pyx_v_s, int __pyx_v_terminal) { char *__pyx_v_comma; int __pyx_v_n; char *__pyx_v_sep; @@ -21090,7 +21371,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fromstring", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":71 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":69 * cdef char *comma * cdef int n * n = strlen(s) # <<<<<<<<<<<<<< @@ -21099,7 +21380,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ __pyx_v_n = strlen(__pyx_v_s); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":73 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":71 * n = strlen(s) * cdef char *sep * sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<< @@ -21108,7 +21389,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ __pyx_v_sep = strstr(__pyx_v_s, __pyx_k___SEP_); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":74 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":72 * cdef char *sep * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: # <<<<<<<<<<<<<< @@ -21136,7 +21417,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp } if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":75 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":73 * sep = strstr(s,"_SEP_") * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: # <<<<<<<<<<<<<< @@ -21145,36 +21426,36 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ if (__pyx_v_terminal) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":76 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":74 * if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: * if terminal: * s1 = "\\"+s # <<<<<<<<<<<<<< * return self.terminals.index(s1) * s[n-1] = c'\0' */ - __pyx_t_6 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_v_s1 = __pyx_t_7; __pyx_t_7 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":75 * if terminal: * s1 = "\\"+s * return self.terminals.index(s1) # <<<<<<<<<<<<<< * s[n-1] = c'\0' * s = s + 1 */ - __pyx_t_8 = PyBytes_AsString(__pyx_v_s1); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->index(__pyx_v_self->terminals, __pyx_t_8); + __pyx_t_8 = PyBytes_AsString(__pyx_v_s1); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->index(__pyx_v_self->terminals, __pyx_t_8); goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":78 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":76 * s1 = "\\"+s * return self.terminals.index(s1) * s[n-1] = c'\0' # <<<<<<<<<<<<<< @@ -21183,7 +21464,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ (__pyx_v_s[(__pyx_v_n - 1)]) = '\x00'; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":79 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":77 * return self.terminals.index(s1) * s[n-1] = c'\0' * s = s + 1 # <<<<<<<<<<<<<< @@ -21192,7 +21473,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ __pyx_v_s = (__pyx_v_s + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":80 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":78 * s[n-1] = c'\0' * s = s + 1 * comma = strrchr(s, c',') # <<<<<<<<<<<<<< @@ -21201,7 +21482,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ __pyx_v_comma = strrchr(__pyx_v_s, ','); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":81 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":79 * s = s + 1 * comma = strrchr(s, c',') * if comma != NULL: # <<<<<<<<<<<<<< @@ -21211,7 +21492,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp __pyx_t_2 = (__pyx_v_comma != NULL); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":82 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":80 * comma = strrchr(s, c',') * if comma != NULL: * comma[0] = c'\0' # <<<<<<<<<<<<<< @@ -21220,27 +21501,27 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp */ (__pyx_v_comma[0]) = '\x00'; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":83 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":81 * if comma != NULL: * comma[0] = c'\0' * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<< * else: * return self.fromcat(s) */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->setindex(__pyx_v_self, ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->fromcat(__pyx_v_self, __pyx_v_s), strtol((__pyx_v_comma + 1), NULL, 10)); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->setindex(__pyx_v_self, ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->fromcat(__pyx_v_self, __pyx_v_s), strtol((__pyx_v_comma + 1), NULL, 10)); goto __pyx_L0; goto __pyx_L5; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":85 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":83 * return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) * else: * return self.fromcat(s) # <<<<<<<<<<<<<< * else: * return self.terminals.index(s) */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->fromcat(__pyx_v_self, __pyx_v_s); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->fromcat(__pyx_v_self, __pyx_v_s); goto __pyx_L0; } __pyx_L5:; @@ -21248,14 +21529,14 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":87 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":85 * return self.fromcat(s) * else: * return self.terminals.index(s) # <<<<<<<<<<<<<< * * cdef Alphabet ALPHABET = Alphabet() */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->index(__pyx_v_self->terminals, __pyx_v_s); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->terminals->__pyx_vtab)->index(__pyx_v_self->terminals, __pyx_v_s); goto __pyx_L0; } __pyx_L3:; @@ -21265,7 +21546,7 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_WriteUnraisable("_cdec_sa.Alphabet.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.Alphabet.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s1); @@ -21274,12 +21555,12 @@ static int __pyx_f_8_cdec_sa_8Alphabet_fromstring(struct __pyx_obj_8_cdec_sa_Alp } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_8Alphabet_9terminals___get__(((struct __pyx_obj_8_cdec_sa_Alphabet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8Alphabet_9terminals___get__(((struct __pyx_obj_3_sa_Alphabet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -21292,7 +21573,7 @@ static PyObject *__pyx_pw_8_cdec_sa_8Alphabet_9terminals_1__get__(PyObject *__py * cdef dict id2sym */ -static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_9terminals___get__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_8Alphabet_9terminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -21309,17 +21590,17 @@ static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_9terminals___get__(struct __pyx_ob } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_8Alphabet_12nonterminals_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_8Alphabet_12nonterminals_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_8Alphabet_12nonterminals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_8Alphabet_12nonterminals_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_8Alphabet_12nonterminals___get__(((struct __pyx_obj_8_cdec_sa_Alphabet *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8Alphabet_12nonterminals___get__(((struct __pyx_obj_3_sa_Alphabet *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_8_cdec_sa_Alphabet *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -21335,84 +21616,162 @@ static PyObject *__pyx_pf_8_cdec_sa_8Alphabet_12nonterminals___get__(struct __py return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_3sym_tostring(PyObject *__pyx_self, PyObject *__pyx_arg_sym); /*proto*/ -static PyMethodDef __pyx_mdef_8_cdec_sa_3sym_tostring = {__Pyx_NAMESTR("sym_tostring"), (PyCFunction)__pyx_pw_8_cdec_sa_3sym_tostring, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_8_cdec_sa_3sym_tostring(PyObject *__pyx_self, PyObject *__pyx_arg_sym) { - int __pyx_v_sym; - PyObject *__pyx_r = 0; +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":89 + * cdef Alphabet ALPHABET = Alphabet() + * + * cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.tostring(sym) + * + */ + +static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) { + char *__pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("sym_tostring (wrapper)", 0); - __pyx_self = __pyx_self; - assert(__pyx_arg_sym); { - __pyx_v_sym = __Pyx_PyInt_AsInt(__pyx_arg_sym); if (unlikely((__pyx_v_sym == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.sym_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannySetupContext("sym_tostring", 0); + + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":90 + * + * cdef char* sym_tostring(int sym): + * return ALPHABET.tostring(sym) # <<<<<<<<<<<<<< + * + * cdef char* sym_tocat(int sym): + */ + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_3_sa_ALPHABET, __pyx_v_sym); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_2sym_tostring(__pyx_self, ((int)__pyx_v_sym)); + return __pyx_r; +} + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":92 + * return ALPHABET.tostring(sym) + * + * cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.tocat(sym) + * + */ + +static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) { + char *__pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sym_tocat", 0); + + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":93 + * + * cdef char* sym_tocat(int sym): + * return ALPHABET.tocat(sym) # <<<<<<<<<<<<<< + * + * cdef int sym_isvar(int sym): + */ + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->tocat(__pyx_v_3_sa_ALPHABET, __pyx_v_sym); + goto __pyx_L0; + + __pyx_r = 0; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":91 - * cdef Alphabet ALPHABET = Alphabet() +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":95 + * return ALPHABET.tocat(sym) * - * def sym_tostring(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.tostring(sym) + * cdef int sym_isvar(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.isvar(sym) * */ -static PyObject *__pyx_pf_8_cdec_sa_2sym_tostring(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sym) { - PyObject *__pyx_r = NULL; +static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) { + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sym_tostring", 0); + __Pyx_RefNannySetupContext("sym_isvar", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":96 * - * def sym_tostring(int sym): - * return ALPHABET.tostring(sym) # <<<<<<<<<<<<<< + * cdef int sym_isvar(int sym): + * return ALPHABET.isvar(sym) # <<<<<<<<<<<<<< * - * def sym_fromstring(bytes string, bint terminal): + * cdef int sym_getindex(int sym): */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_sym)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":98 + * return ALPHABET.isvar(sym) + * + * cdef int sym_getindex(int sym): # <<<<<<<<<<<<<< + * return ALPHABET.getindex(sym) + * + */ + +static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sym_getindex", 0); + + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":99 + * + * cdef int sym_getindex(int sym): + * return ALPHABET.getindex(sym) # <<<<<<<<<<<<<< + * + * cdef int sym_setindex(int sym, int id): + */ + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->getindex(__pyx_v_3_sa_ALPHABET, __pyx_v_sym); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.sym_tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":101 + * return ALPHABET.getindex(sym) + * + * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< + * return ALPHABET.setindex(sym, id) + * + */ + +static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sym_setindex", 0); + + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":102 + * + * cdef int sym_setindex(int sym, int id): + * return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<< + * + * def sym_fromstring(bytes string, bint terminal): + */ + __pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_3_sa_ALPHABET, __pyx_v_sym, __pyx_v_id); + goto __pyx_L0; + + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_5sym_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_8_cdec_sa_5sym_fromstring = {__Pyx_NAMESTR("sym_fromstring"), (PyCFunction)__pyx_pw_8_cdec_sa_5sym_fromstring, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_8_cdec_sa_5sym_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_3sym_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3_sa_3sym_fromstring = {__Pyx_NAMESTR("sym_fromstring"), (PyCFunction)__pyx_pw_3_sa_3sym_fromstring, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3_sa_3sym_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_string = 0; int __pyx_v_terminal; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__terminal,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sym_fromstring (wrapper)", 0); - __pyx_self = __pyx_self; { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__string,&__pyx_n_s__terminal,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21426,18 +21785,16 @@ static PyObject *__pyx_pw_8_cdec_sa_5sym_fromstring(PyObject *__pyx_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__string)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__terminal); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__terminal)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("sym_fromstring", 1, 2, 2, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sym_fromstring", 1, 2, 2, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sym_fromstring") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sym_fromstring") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -21446,18 +21803,18 @@ static PyObject *__pyx_pw_8_cdec_sa_5sym_fromstring(PyObject *__pyx_self, PyObje values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_string = ((PyObject*)values[0]); - __pyx_v_terminal = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_terminal = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sym_fromstring", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sym_fromstring", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.sym_fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.sym_fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_string), (&PyBytes_Type), 1, "string", 1))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_4sym_fromstring(__pyx_self, __pyx_v_string, __pyx_v_terminal); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_string), (&PyBytes_Type), 1, "string", 1))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_2sym_fromstring(__pyx_self, __pyx_v_string, __pyx_v_terminal); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -21466,15 +21823,14 @@ static PyObject *__pyx_pw_8_cdec_sa_5sym_fromstring(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":94 - * return ALPHABET.tostring(sym) +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":104 + * return ALPHABET.setindex(sym, id) * * def sym_fromstring(bytes string, bint terminal): # <<<<<<<<<<<<<< * return ALPHABET.fromstring(string, terminal) - * */ -static PyObject *__pyx_pf_8_cdec_sa_4sym_fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, int __pyx_v_terminal) { +static PyObject *__pyx_pf_3_sa_2sym_fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, int __pyx_v_terminal) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char *__pyx_t_1; @@ -21484,16 +21840,14 @@ static PyObject *__pyx_pf_8_cdec_sa_4sym_fromstring(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sym_fromstring", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":95 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":105 * * def sym_fromstring(bytes string, bint terminal): * return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<< - * - * def sym_isvar(int sym): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_string)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->fromstring(__pyx_v_8_cdec_sa_ALPHABET, __pyx_t_1, __pyx_v_terminal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_AsString(((PyObject *)__pyx_v_string)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->fromstring(__pyx_v_3_sa_ALPHABET, __pyx_t_1, __pyx_v_terminal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -21503,73 +21857,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4sym_fromstring(CYTHON_UNUSED PyObject *__py goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.sym_fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7sym_isvar(PyObject *__pyx_self, PyObject *__pyx_arg_sym); /*proto*/ -static PyMethodDef __pyx_mdef_8_cdec_sa_7sym_isvar = {__Pyx_NAMESTR("sym_isvar"), (PyCFunction)__pyx_pw_8_cdec_sa_7sym_isvar, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_8_cdec_sa_7sym_isvar(PyObject *__pyx_self, PyObject *__pyx_arg_sym) { - int __pyx_v_sym; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("sym_isvar (wrapper)", 0); - __pyx_self = __pyx_self; - assert(__pyx_arg_sym); { - __pyx_v_sym = __Pyx_PyInt_AsInt(__pyx_arg_sym); if (unlikely((__pyx_v_sym == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.sym_isvar", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_6sym_isvar(__pyx_self, ((int)__pyx_v_sym)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":97 - * return ALPHABET.fromstring(string, terminal) - * - * def sym_isvar(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.isvar(sym) - * - */ - -static PyObject *__pyx_pf_8_cdec_sa_6sym_isvar(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_sym) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sym_isvar", 0); - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":98 - * - * def sym_isvar(int sym): - * return ALPHABET.isvar(sym) # <<<<<<<<<<<<<< - * - * cdef int sym_setindex(int sym, int id): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_sym)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.sym_isvar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.sym_fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -21577,41 +21865,15 @@ static PyObject *__pyx_pf_8_cdec_sa_6sym_isvar(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":100 - * return ALPHABET.isvar(sym) - * - * cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<< - * return ALPHABET.setindex(sym, id) - */ - -static int __pyx_f_8_cdec_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("sym_setindex", 0); - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":101 - * - * cdef int sym_setindex(int sym, int id): - * return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<< - */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_sym, __pyx_v_id); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_words = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__words,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -21624,12 +21886,11 @@ static int __pyx_pw_8_cdec_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObjec kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__words)) != 0)) kw_args--; 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[7]; __pyx_lineno = 8; __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[7]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; @@ -21640,26 +21901,26 @@ static int __pyx_pw_8_cdec_sa_6Phrase_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[7]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Phrase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase___cinit__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), __pyx_v_words); + __pyx_r = __pyx_pf_3_sa_6Phrase___cinit__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), __pyx_v_words); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":8 - * cdef int n, *varpos, n_vars +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":6 + * cdef class Phrase: * * def __cinit__(self, words): # <<<<<<<<<<<<<< * cdef int i, j, n, n_vars * n_vars = 0 */ -static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words) { +static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_n; @@ -21675,7 +21936,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":10 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":8 * def __cinit__(self, words): * cdef int i, j, n, n_vars * n_vars = 0 # <<<<<<<<<<<<<< @@ -21684,17 +21945,17 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras */ __pyx_v_n_vars = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":11 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":9 * cdef int i, j, n, n_vars * n_vars = 0 * n = len(words) # <<<<<<<<<<<<<< * self.syms = <int *>malloc(n*sizeof(int)) * for i from 0 <= i < n: */ - __pyx_t_1 = PyObject_Length(__pyx_v_words); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_words); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n = __pyx_t_1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":12 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":10 * n_vars = 0 * n = len(words) * self.syms = <int *>malloc(n*sizeof(int)) # <<<<<<<<<<<<<< @@ -21703,42 +21964,42 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras */ __pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":13 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":11 * n = len(words) * self.syms = <int *>malloc(n*sizeof(int)) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * self.syms[i] = words[i] - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): */ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":14 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":12 * self.syms = <int *>malloc(n*sizeof(int)) * for i from 0 <= i < n: * self.syms[i] = words[i] # <<<<<<<<<<<<<< - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): * n_vars += 1 */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_words, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_words, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->syms[__pyx_v_i]) = __pyx_t_4; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":15 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":13 * for i from 0 <= i < n: * self.syms[i] = words[i] - * if ALPHABET.isvar(self.syms[i]): # <<<<<<<<<<<<<< + * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< * n_vars += 1 * self.n = n */ - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, (__pyx_v_self->syms[__pyx_v_i])); + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":16 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":14 * self.syms[i] = words[i] - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): * n_vars += 1 # <<<<<<<<<<<<<< * self.n = n * self.n_vars = n_vars @@ -21749,8 +22010,8 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras __pyx_L5:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":17 - * if ALPHABET.isvar(self.syms[i]): + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":15 + * if sym_isvar(self.syms[i]): * n_vars += 1 * self.n = n # <<<<<<<<<<<<<< * self.n_vars = n_vars @@ -21758,7 +22019,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras */ __pyx_v_self->n = __pyx_v_n; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":18 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":16 * n_vars += 1 * self.n = n * self.n_vars = n_vars # <<<<<<<<<<<<<< @@ -21767,7 +22028,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras */ __pyx_v_self->n_vars = __pyx_v_n_vars; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":19 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":17 * self.n = n * self.n_vars = n_vars * self.varpos = <int *>malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<< @@ -21776,46 +22037,46 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras */ __pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":20 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":18 * self.n_vars = n_vars * self.varpos = <int *>malloc(n_vars*sizeof(int)) * j = 0 # <<<<<<<<<<<<<< * for i from 0 <= i < n: - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): */ __pyx_v_j = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":21 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":19 * self.varpos = <int *>malloc(n_vars*sizeof(int)) * j = 0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): * self.varpos[j] = i */ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":22 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":20 * j = 0 * for i from 0 <= i < n: - * if ALPHABET.isvar(self.syms[i]): # <<<<<<<<<<<<<< + * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< * self.varpos[j] = i * j = j + 1 */ - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, (__pyx_v_self->syms[__pyx_v_i])); + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":23 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":21 * for i from 0 <= i < n: - * if ALPHABET.isvar(self.syms[i]): + * if sym_isvar(self.syms[i]): * self.varpos[j] = i # <<<<<<<<<<<<<< * j = j + 1 * */ (__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":24 - * if ALPHABET.isvar(self.syms[i]): + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":22 + * if sym_isvar(self.syms[i]): * self.varpos[j] = i * j = j + 1 # <<<<<<<<<<<<<< * @@ -21831,7 +22092,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.Phrase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -21839,15 +22100,15 @@ static int __pyx_pf_8_cdec_sa_6Phrase___cinit__(struct __pyx_obj_8_cdec_sa_Phras } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_6Phrase_2__dealloc__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_pf_3_sa_6Phrase_2__dealloc__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":26 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":24 * j = j + 1 * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -21855,11 +22116,11 @@ static void __pyx_pw_8_cdec_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) { * free(self.varpos) */ -static void __pyx_pf_8_cdec_sa_6Phrase_2__dealloc__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":27 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":25 * * def __dealloc__(self): * free(self.syms) # <<<<<<<<<<<<<< @@ -21868,7 +22129,7 @@ static void __pyx_pf_8_cdec_sa_6Phrase_2__dealloc__(struct __pyx_obj_8_cdec_sa_P */ free(__pyx_v_self->syms); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":28 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":26 * def __dealloc__(self): * free(self.syms) * free(self.varpos) # <<<<<<<<<<<<<< @@ -21881,17 +22142,17 @@ static void __pyx_pf_8_cdec_sa_6Phrase_2__dealloc__(struct __pyx_obj_8_cdec_sa_P } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_5__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_4__str__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_4__str__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":30 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":28 * free(self.varpos) * * def __str__(self): # <<<<<<<<<<<<<< @@ -21899,7 +22160,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_5__str__(PyObject *__pyx_v_self) { * cdef int i, s */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_4__str__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_strs = NULL; int __pyx_v_i; int __pyx_v_s; @@ -21915,66 +22176,66 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_4__str__(struct __pyx_obj_8_cdec_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":31 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":29 * * def __str__(self): * strs = [] # <<<<<<<<<<<<<< * cdef int i, s * for i from 0 <= i < self.n: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":33 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":31 * strs = [] * cdef int i, s * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< * s = self.syms[i] - * strs.append(ALPHABET.tostring(s)) + * strs.append(sym_tostring(s)) */ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":34 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":32 * cdef int i, s * for i from 0 <= i < self.n: * s = self.syms[i] # <<<<<<<<<<<<<< - * strs.append(ALPHABET.tostring(s)) + * strs.append(sym_tostring(s)) * return " ".join(strs) */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":35 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":33 * for i from 0 <= i < self.n: * s = self.syms[i] - * strs.append(ALPHABET.tostring(s)) # <<<<<<<<<<<<<< + * strs.append(sym_tostring(s)) # <<<<<<<<<<<<<< * return " ".join(strs) * */ - __pyx_t_1 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_v_s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyList_Append(__pyx_v_strs, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_Append(__pyx_v_strs, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":36 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":34 * s = self.syms[i] - * strs.append(ALPHABET.tostring(s)) + * strs.append(sym_tostring(s)) * return " ".join(strs) # <<<<<<<<<<<<<< * * def handle(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_strs)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_strs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_strs)); - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -21988,7 +22249,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_4__str__(struct __pyx_obj_8_cdec_sa_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.Phrase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_strs); @@ -21998,18 +22259,18 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_4__str__(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_8_cdec_sa_6Phrase_6handle[] = "return a hashable representation that normalizes the ordering\n of the nonterminal indices"; -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3_sa_6Phrase_6handle[] = "return a hashable representation that normalizes the ordering\n of the nonterminal indices"; +static PyObject *__pyx_pw_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("handle (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_6handle(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_6handle(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":38 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":36 * return " ".join(strs) * * def handle(self): # <<<<<<<<<<<<<< @@ -22017,7 +22278,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTH * of the nonterminal indices""" */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_v_norm = NULL; int __pyx_v_i; int __pyx_v_j; @@ -22033,19 +22294,19 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":41 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":39 * """return a hashable representation that normalizes the ordering * of the nonterminal indices""" * norm = [] # <<<<<<<<<<<<<< * cdef int i, j, s * i = 1 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":43 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":41 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -22054,7 +22315,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":44 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":42 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -22063,47 +22324,47 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P */ __pyx_v_j = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":45 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":43 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< * s = self.syms[j] - * if ALPHABET.isvar(s): + * if sym_isvar(s): */ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":46 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":44 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) + * if sym_isvar(s): + * s = sym_setindex(s,i) */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":47 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":45 * for j from 0 <= j < self.n: * s = self.syms[j] - * if ALPHABET.isvar(s): # <<<<<<<<<<<<<< - * s = ALPHABET.setindex(s,i) + * if sym_isvar(s): # <<<<<<<<<<<<<< + * s = sym_setindex(s,i) * i = i + 1 */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s); + __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":48 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":46 * s = self.syms[j] - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) # <<<<<<<<<<<<<< + * if sym_isvar(s): + * s = sym_setindex(s,i) # <<<<<<<<<<<<<< * i = i + 1 * norm.append(s) */ - __pyx_v_s = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s, __pyx_v_i); + __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":49 - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":47 + * if sym_isvar(s): + * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< * norm.append(s) * return tuple(norm) @@ -22113,20 +22374,20 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P } __pyx_L5:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":50 - * s = ALPHABET.setindex(s,i) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":48 + * s = sym_setindex(s,i) * i = i + 1 * norm.append(s) # <<<<<<<<<<<<<< * return tuple(norm) * */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyList_Append(__pyx_v_norm, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_norm, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":51 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":49 * i = i + 1 * norm.append(s) * return tuple(norm) # <<<<<<<<<<<<<< @@ -22134,7 +22395,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P * def strhandle(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_norm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_norm)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -22144,7 +22405,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Phrase.handle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.handle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_norm); @@ -22154,17 +22415,17 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_6handle(struct __pyx_obj_8_cdec_sa_P } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strhandle (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_8strhandle(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_8strhandle(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":53 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":51 * return tuple(norm) * * def strhandle(self): # <<<<<<<<<<<<<< @@ -22172,7 +22433,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, C * norm = [] */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { CYTHON_UNUSED PyObject *__pyx_v_strs = NULL; PyObject *__pyx_v_norm = NULL; int __pyx_v_i; @@ -22191,31 +22452,31 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strhandle", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":54 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":52 * * def strhandle(self): * strs = [] # <<<<<<<<<<<<<< * norm = [] * cdef int i, j, s */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_strs = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":55 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":53 * def strhandle(self): * strs = [] * norm = [] # <<<<<<<<<<<<<< * cdef int i, j, s * i = 1 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":57 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":55 * norm = [] * cdef int i, j, s * i = 1 # <<<<<<<<<<<<<< @@ -22224,7 +22485,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":58 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":56 * cdef int i, j, s * i = 1 * j = 0 # <<<<<<<<<<<<<< @@ -22233,49 +22494,49 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s */ __pyx_v_j = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":59 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":57 * i = 1 * j = 0 * for j from 0 <= j < self.n: # <<<<<<<<<<<<<< * s = self.syms[j] - * if ALPHABET.isvar(s): + * if sym_isvar(s): */ __pyx_t_2 = __pyx_v_self->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":60 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":58 * j = 0 * for j from 0 <= j < self.n: * s = self.syms[j] # <<<<<<<<<<<<<< - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) + * if sym_isvar(s): + * s = sym_setindex(s,i) */ __pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":61 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":59 * for j from 0 <= j < self.n: * s = self.syms[j] - * if ALPHABET.isvar(s): # <<<<<<<<<<<<<< - * s = ALPHABET.setindex(s,i) + * if sym_isvar(s): # <<<<<<<<<<<<<< + * s = sym_setindex(s,i) * i = i + 1 */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s); + __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":62 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":60 * s = self.syms[j] - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) # <<<<<<<<<<<<<< + * if sym_isvar(s): + * s = sym_setindex(s,i) # <<<<<<<<<<<<<< * i = i + 1 - * norm.append(ALPHABET.tostring(s)) + * norm.append(sym_tostring(s)) */ - __pyx_v_s = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->setindex(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s, __pyx_v_i); + __pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":63 - * if ALPHABET.isvar(s): - * s = ALPHABET.setindex(s,i) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":61 + * if sym_isvar(s): + * s = sym_setindex(s,i) * i = i + 1 # <<<<<<<<<<<<<< - * norm.append(ALPHABET.tostring(s)) + * norm.append(sym_tostring(s)) * return " ".join(norm) */ __pyx_v_i = (__pyx_v_i + 1); @@ -22283,35 +22544,35 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s } __pyx_L5:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":64 - * s = ALPHABET.setindex(s,i) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":62 + * s = sym_setindex(s,i) * i = i + 1 - * norm.append(ALPHABET.tostring(s)) # <<<<<<<<<<<<<< + * norm.append(sym_tostring(s)) # <<<<<<<<<<<<<< * return " ".join(norm) * */ - __pyx_t_1 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_v_s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_4 = PyList_Append(__pyx_v_norm, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_norm, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":65 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":63 * i = i + 1 - * norm.append(ALPHABET.tostring(s)) + * norm.append(sym_tostring(s)) * return " ".join(norm) # <<<<<<<<<<<<<< * * def arity(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_norm)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_norm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_norm)); - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -22325,7 +22586,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("_cdec_sa.Phrase.strhandle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.strhandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_strs); @@ -22336,17 +22597,17 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_8strhandle(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arity (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_10arity(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_10arity(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":67 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":65 * return " ".join(norm) * * def arity(self): # <<<<<<<<<<<<<< @@ -22354,7 +22615,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTH * */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_6Phrase_10arity(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -22363,7 +22624,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":68 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":66 * * def arity(self): * return self.n_vars # <<<<<<<<<<<<<< @@ -22371,7 +22632,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_P * def getvarpos(self, i): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22381,7 +22642,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Phrase.arity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.arity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -22390,17 +22651,17 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_10arity(struct __pyx_obj_8_cdec_sa_P } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getvarpos (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_12getvarpos(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6Phrase_12getvarpos(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":70 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":68 * return self.n_vars * * def getvarpos(self, i): # <<<<<<<<<<<<<< @@ -22408,7 +22669,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, * return self.varpos[i] */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -22420,28 +22681,28 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvarpos", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":71 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":69 * * def getvarpos(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.varpos[i] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":72 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":70 * def getvarpos(self, i): * if 0 <= i < self.n_vars: * return self.varpos[i] # <<<<<<<<<<<<<< @@ -22449,8 +22710,8 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ * raise IndexError */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromLong((__pyx_v_self->varpos[__pyx_t_4])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_self->varpos[__pyx_t_4])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22459,7 +22720,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":74 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":72 * return self.varpos[i] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -22467,7 +22728,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ * def getvar(self, i): */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); - {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; @@ -22476,7 +22737,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Phrase.getvarpos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.getvarpos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -22485,17 +22746,17 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_12getvarpos(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getvar (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_14getvar(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6Phrase_14getvar(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":76 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":74 * raise IndexError * * def getvar(self, i): # <<<<<<<<<<<<<< @@ -22503,7 +22764,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyO * return self.syms[self.varpos[i]] */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -22515,28 +22776,28 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getvar", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":75 * * def getvar(self, i): * if 0 <= i < self.n_vars: # <<<<<<<<<<<<<< * return self.syms[self.varpos[i]] * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_i, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_self->n_vars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_2, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":78 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":76 * def getvar(self, i): * if 0 <= i < self.n_vars: * return self.syms[self.varpos[i]] # <<<<<<<<<<<<<< @@ -22544,8 +22805,8 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ * raise IndexError */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyInt_FromLong((__pyx_v_self->syms[(__pyx_v_self->varpos[__pyx_t_4])])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_self->syms[(__pyx_v_self->varpos[__pyx_t_4])])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22554,7 +22815,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":80 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":78 * return self.syms[self.varpos[i]] * else: * raise IndexError # <<<<<<<<<<<<<< @@ -22562,7 +22823,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ * cdef int chunkpos(self, int k): */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); - {__pyx_filename = __pyx_f[7]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; @@ -22571,7 +22832,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Phrase.getvar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.getvar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -22579,7 +22840,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":82 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":80 * raise IndexError * * cdef int chunkpos(self, int k): # <<<<<<<<<<<<<< @@ -22587,13 +22848,13 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_14getvar(struct __pyx_obj_8_cdec_sa_ * return 0 */ -static int __pyx_f_8_cdec_sa_6Phrase_chunkpos(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, int __pyx_v_k) { +int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, int __pyx_v_k) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("chunkpos", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":83 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":81 * * cdef int chunkpos(self, int k): * if k == 0: # <<<<<<<<<<<<<< @@ -22603,7 +22864,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunkpos(struct __pyx_obj_8_cdec_sa_Phrase __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":84 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":82 * cdef int chunkpos(self, int k): * if k == 0: * return 0 # <<<<<<<<<<<<<< @@ -22616,7 +22877,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunkpos(struct __pyx_obj_8_cdec_sa_Phrase } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":86 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":84 * return 0 * else: * return self.varpos[k-1]+1 # <<<<<<<<<<<<<< @@ -22634,7 +22895,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunkpos(struct __pyx_obj_8_cdec_sa_Phrase return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":88 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":86 * return self.varpos[k-1]+1 * * cdef int chunklen(self, int k): # <<<<<<<<<<<<<< @@ -22642,13 +22903,13 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunkpos(struct __pyx_obj_8_cdec_sa_Phrase * return self.n */ -static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, int __pyx_v_k) { +int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, int __pyx_v_k) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("chunklen", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":89 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":87 * * cdef int chunklen(self, int k): * if self.n_vars == 0: # <<<<<<<<<<<<<< @@ -22658,7 +22919,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase __pyx_t_1 = (__pyx_v_self->n_vars == 0); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":90 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":88 * cdef int chunklen(self, int k): * if self.n_vars == 0: * return self.n # <<<<<<<<<<<<<< @@ -22670,7 +22931,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase goto __pyx_L3; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":91 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":89 * if self.n_vars == 0: * return self.n * elif k == 0: # <<<<<<<<<<<<<< @@ -22680,7 +22941,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase __pyx_t_1 = (__pyx_v_k == 0); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":90 * return self.n * elif k == 0: * return self.varpos[0] # <<<<<<<<<<<<<< @@ -22692,7 +22953,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase goto __pyx_L3; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":91 * elif k == 0: * return self.varpos[0] * elif k == self.n_vars: # <<<<<<<<<<<<<< @@ -22702,7 +22963,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase __pyx_t_1 = (__pyx_v_k == __pyx_v_self->n_vars); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":94 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":92 * return self.varpos[0] * elif k == self.n_vars: * return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -22715,7 +22976,7 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":96 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":94 * return self.n-self.varpos[k-1]-1 * else: * return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<< @@ -22734,17 +22995,17 @@ static int __pyx_f_8_cdec_sa_6Phrase_chunklen(struct __pyx_obj_8_cdec_sa_Phrase } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k) { +static PyObject *__pyx_pw_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *__pyx_v_k) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clen (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_16clen(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_k)); + __pyx_r = __pyx_pf_3_sa_6Phrase_16clen(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_k)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":98 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":96 * return self.varpos[k]-self.varpos[k-1]-1 * * def clen(self, k): # <<<<<<<<<<<<<< @@ -22752,7 +23013,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObj * */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_k) { +static PyObject *__pyx_pf_3_sa_6Phrase_16clen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_k) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -22762,7 +23023,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Ph int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clen", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":99 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":97 * * def clen(self, k): * return self.chunklen(k) # <<<<<<<<<<<<<< @@ -22770,8 +23031,8 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Ph * def getchunk(self, ci): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_k); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_k); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -22781,7 +23042,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Ph goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Phrase.clen", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.clen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -22790,17 +23051,17 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_16clen(struct __pyx_obj_8_cdec_sa_Ph } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci) { +static PyObject *__pyx_pw_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObject *__pyx_v_ci) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getchunk (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_18getchunk(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_ci)); + __pyx_r = __pyx_pf_3_sa_6Phrase_18getchunk(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_ci)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":101 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":99 * return self.chunklen(k) * * def getchunk(self, ci): # <<<<<<<<<<<<<< @@ -22808,7 +23069,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, P * start = self.chunkpos(ci) */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_ci) { +static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_ci) { int __pyx_v_start; int __pyx_v_stop; PyObject *__pyx_v_chunk = NULL; @@ -22823,39 +23084,39 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getchunk", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":103 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":101 * def getchunk(self, ci): * cdef int start, stop * start = self.chunkpos(ci) # <<<<<<<<<<<<<< * stop = start+self.chunklen(ci) * chunk = [] */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_start = ((struct __pyx_vtabstruct_8_cdec_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_start = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":104 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":102 * cdef int start, stop * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) # <<<<<<<<<<<<<< * chunk = [] * for i from start <= i < stop: */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_8_cdec_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":105 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":103 * start = self.chunkpos(ci) * stop = start+self.chunklen(ci) * chunk = [] # <<<<<<<<<<<<<< * for i from start <= i < stop: * chunk.append(self.syms[i]) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_chunk = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":106 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":104 * stop = start+self.chunklen(ci) * chunk = [] * for i from start <= i < stop: # <<<<<<<<<<<<<< @@ -22865,20 +23126,20 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_s __pyx_t_1 = __pyx_v_stop; for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":107 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":105 * chunk = [] * for i from start <= i < stop: * chunk.append(self.syms[i]) # <<<<<<<<<<<<<< * return chunk * */ - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_Append(__pyx_v_chunk, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_Append(__pyx_v_chunk, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":108 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":106 * for i from start <= i < stop: * chunk.append(self.syms[i]) * return chunk # <<<<<<<<<<<<<< @@ -22894,7 +23155,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_s goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Phrase.getchunk", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.getchunk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_chunk); @@ -22905,18 +23166,18 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_18getchunk(struct __pyx_obj_8_cdec_s /* Python wrapper */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pw_8_cdec_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static int __pyx_pw_8_cdec_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { +static int __pyx_pw_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static int __pyx_pw_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + __pyx_r = __pyx_pf_3_sa_6Phrase_20__cmp__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_other)); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":110 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":108 * return chunk * * def __cmp__(self, other): # <<<<<<<<<<<<<< @@ -22925,8 +23186,8 @@ static int __pyx_pw_8_cdec_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_other) { - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_otherp = 0; +static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_other) { + struct __pyx_obj_3_sa_Phrase *__pyx_v_otherp = 0; int __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations @@ -22939,18 +23200,18 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":113 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":111 * cdef Phrase otherp * cdef int i * otherp = other # <<<<<<<<<<<<<< * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: */ - if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8_cdec_sa_Phrase))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_other); - __pyx_v_otherp = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_other); + __pyx_v_otherp = ((struct __pyx_obj_3_sa_Phrase *)__pyx_v_other); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":114 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":112 * cdef int i * otherp = other * for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<< @@ -22967,7 +23228,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_t_1 = __pyx_t_3; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":115 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":113 * otherp = other * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<< @@ -22977,7 +23238,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":116 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":114 * for i from 0 <= i < min(self.n, otherp.n): * if self.syms[i] < otherp.syms[i]: * return -1 # <<<<<<<<<<<<<< @@ -22989,7 +23250,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras goto __pyx_L5; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":117 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":115 * if self.syms[i] < otherp.syms[i]: * return -1 * elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<< @@ -22999,7 +23260,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i])); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":118 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":116 * return -1 * elif self.syms[i] > otherp.syms[i]: * return 1 # <<<<<<<<<<<<<< @@ -23013,7 +23274,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_L5:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":119 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":117 * elif self.syms[i] > otherp.syms[i]: * return 1 * if self.n < otherp.n: # <<<<<<<<<<<<<< @@ -23023,7 +23284,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_t_4 = (__pyx_v_self->n < __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":120 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":118 * return 1 * if self.n < otherp.n: * return -1 # <<<<<<<<<<<<<< @@ -23035,7 +23296,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras goto __pyx_L6; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":121 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":119 * if self.n < otherp.n: * return -1 * elif self.n > otherp.n: # <<<<<<<<<<<<<< @@ -23045,7 +23306,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_t_4 = (__pyx_v_self->n > __pyx_v_otherp->n); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":122 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":120 * return -1 * elif self.n > otherp.n: * return 1 # <<<<<<<<<<<<<< @@ -23058,7 +23319,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":124 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":122 * return 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -23073,7 +23334,7 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.Phrase.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_otherp); @@ -23083,17 +23344,17 @@ static int __pyx_pf_8_cdec_sa_6Phrase_20__cmp__(struct __pyx_obj_8_cdec_sa_Phras #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* Python wrapper */ -static Py_hash_t __pyx_pw_8_cdec_sa_6Phrase_23__hash__(PyObject *__pyx_v_self); /*proto*/ -static Py_hash_t __pyx_pw_8_cdec_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { +static Py_hash_t __pyx_pw_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_22__hash__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_22__hash__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":126 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":124 * return 0 * * def __hash__(self): # <<<<<<<<<<<<<< @@ -23101,7 +23362,7 @@ static Py_hash_t __pyx_pw_8_cdec_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) { * cdef unsigned h */ -static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { int __pyx_v_i; unsigned int __pyx_v_h; Py_hash_t __pyx_r; @@ -23110,7 +23371,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s int __pyx_t_2; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":129 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":127 * cdef int i * cdef unsigned h * h = 0 # <<<<<<<<<<<<<< @@ -23119,7 +23380,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s */ __pyx_v_h = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":130 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":128 * cdef unsigned h * h = 0 * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< @@ -23129,7 +23390,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":131 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":129 * h = 0 * for i from 0 <= i < self.n: * if self.syms[i] > 0: # <<<<<<<<<<<<<< @@ -23139,7 +23400,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s __pyx_t_2 = ((__pyx_v_self->syms[__pyx_v_i]) > 0); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":132 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":130 * for i from 0 <= i < self.n: * if self.syms[i] > 0: * h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<< @@ -23151,7 +23412,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":134 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":132 * h = (h << 1) + self.syms[i] * else: * h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<< @@ -23163,7 +23424,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s __pyx_L5:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":135 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":133 * else: * h = (h << 1) + -self.syms[i] * return h # <<<<<<<<<<<<<< @@ -23181,17 +23442,17 @@ static Py_hash_t __pyx_pf_8_cdec_sa_6Phrase_22__hash__(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static Py_ssize_t __pyx_pw_8_cdec_sa_6Phrase_25__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_8_cdec_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pw_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_24__len__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_24__len__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":137 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":135 * return h * * def __len__(self): # <<<<<<<<<<<<<< @@ -23199,12 +23460,12 @@ static Py_ssize_t __pyx_pw_8_cdec_sa_6Phrase_25__len__(PyObject *__pyx_v_self) { * */ -static Py_ssize_t __pyx_pf_8_cdec_sa_6Phrase_24__len__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { +static Py_ssize_t __pyx_pf_3_sa_6Phrase_24__len__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":138 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":136 * * def __len__(self): * return self.n # <<<<<<<<<<<<<< @@ -23221,17 +23482,17 @@ static Py_ssize_t __pyx_pf_8_cdec_sa_6Phrase_24__len__(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_26__getitem__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_6Phrase_26__getitem__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":140 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":138 * return self.n * * def __getitem__(self, i): # <<<<<<<<<<<<<< @@ -23239,7 +23500,7 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self * */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_26__getitem__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_6Phrase_26__getitem__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -23249,7 +23510,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_26__getitem__(struct __pyx_obj_8_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":141 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":139 * * def __getitem__(self, i): * return self.syms[i] # <<<<<<<<<<<<<< @@ -23257,8 +23518,8 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_26__getitem__(struct __pyx_obj_8_cde * def __iter__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->syms[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_self->syms[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -23268,118 +23529,142 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_26__getitem__(struct __pyx_obj_8_cde goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Phrase.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_3_sa_6Phrase_30generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_29__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_28__iter__(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_6Phrase_28__iter__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":143 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":141 * return self.syms[i] * * def __iter__(self): # <<<<<<<<<<<<<< * cdef int i - * l = [] + * for i from 0 <= i < self.n: */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_28__iter__(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self) { - int __pyx_v_i; - PyObject *__pyx_v_l = NULL; +static PyObject *__pyx_pf_3_sa_6Phrase_28__iter__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); + __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)__pyx_ptype_3_sa___pyx_scope_struct_1___iter__->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); + { + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_6Phrase_30generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":145 - * def __iter__(self): - * cdef int i - * l = [] # <<<<<<<<<<<<<< - * for i from 0 <= i < self.n: - * l.append(self.syms[i]) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_l = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("_sa.Phrase.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_3_sa_6Phrase_30generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("None", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":146 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":143 + * def __iter__(self): * cdef int i - * l = [] * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< - * l.append(self.syms[i]) - * return iter(l) - */ - __pyx_t_2 = __pyx_v_self->n; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":147 - * l = [] - * for i from 0 <= i < self.n: - * l.append(self.syms[i]) # <<<<<<<<<<<<<< - * return iter(l) + * yield self.syms[i] * */ - __pyx_t_1 = PyInt_FromLong((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyList_Append(__pyx_v_l, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } + __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->n; + for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_1; __pyx_cur_scope->__pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":148 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":144 + * cdef int i * for i from 0 <= i < self.n: - * l.append(self.syms[i]) - * return iter(l) # <<<<<<<<<<<<<< + * yield self.syms[i] # <<<<<<<<<<<<<< * * def subst(self, start, children): */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_l)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_t_2 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_self->syms[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Phrase.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; - __Pyx_XDECREF(__pyx_v_l); - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF(__pyx_r); + __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); - return __pyx_r; + return NULL; } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_31subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_6Phrase_31subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_children = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subst (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__children,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -23393,18 +23678,16 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_31subst(PyObject *__pyx_v_self, PyOb kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__children)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subst") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subst") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -23417,26 +23700,26 @@ static PyObject *__pyx_pw_8_cdec_sa_6Phrase_31subst(PyObject *__pyx_v_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("subst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Phrase.subst", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.subst", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_6Phrase_30subst(((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_self), __pyx_v_start, __pyx_v_children); + __pyx_r = __pyx_pf_3_sa_6Phrase_31subst(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self), __pyx_v_start, __pyx_v_children); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":150 - * return iter(l) +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":146 + * yield self.syms[i] * * def subst(self, start, children): # <<<<<<<<<<<<<< * cdef int i * for i from 0 <= i < self.n: */ -static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children) { +static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_children) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -23451,37 +23734,37 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_P __Pyx_RefNannySetupContext("subst", 0); __Pyx_INCREF(__pyx_v_start); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":152 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":148 * def subst(self, start, children): * cdef int i * for i from 0 <= i < self.n: # <<<<<<<<<<<<<< - * if ALPHABET.isvar(self.syms[i]): - * start = start + children[ALPHABET.getindex(self.syms[i])-1] + * if sym_isvar(self.syms[i]): + * start = start + children[sym_getindex(self.syms[i])-1] */ __pyx_t_1 = __pyx_v_self->n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":153 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":149 * cdef int i * for i from 0 <= i < self.n: - * if ALPHABET.isvar(self.syms[i]): # <<<<<<<<<<<<<< - * start = start + children[ALPHABET.getindex(self.syms[i])-1] + * if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<< + * start = start + children[sym_getindex(self.syms[i])-1] * else: */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, (__pyx_v_self->syms[__pyx_v_i])); + __pyx_t_2 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i])); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":154 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":150 * for i from 0 <= i < self.n: - * if ALPHABET.isvar(self.syms[i]): - * start = start + children[ALPHABET.getindex(self.syms[i])-1] # <<<<<<<<<<<<<< + * if sym_isvar(self.syms[i]): + * start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<< * else: * start = start + (self.syms[i],) */ - __pyx_t_3 = (((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->getindex(__pyx_v_8_cdec_sa_ALPHABET, (__pyx_v_self->syms[__pyx_v_i])) - 1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_children, __pyx_t_3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__pyx_f_3_sa_sym_getindex((__pyx_v_self->syms[__pyx_v_i])) - 1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_children, __pyx_t_3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_v_start, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_start); @@ -23491,21 +23774,21 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_P } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":156 - * start = start + children[ALPHABET.getindex(self.syms[i])-1] + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":152 + * start = start + children[sym_getindex(self.syms[i])-1] * else: * start = start + (self.syms[i],) # <<<<<<<<<<<<<< * return start * */ - __pyx_t_5 = PyInt_FromLong((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_self->syms[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_start, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_v_start, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_start); @@ -23515,12 +23798,12 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_P __pyx_L5:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":157 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":153 * else: * start = start + (self.syms[i],) * return start # <<<<<<<<<<<<<< * - * cdef class Rule: + * property words: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_start); @@ -23532,7 +23815,7 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_P __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.Phrase.subst", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Phrase.subst", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); @@ -23542,21 +23825,136 @@ static PyObject *__pyx_pf_8_cdec_sa_6Phrase_30subst(struct __pyx_obj_8_cdec_sa_P } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_3_sa_6Phrase_5words___get__(((struct __pyx_obj_3_sa_Phrase *)__pyx_v_self)); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":156 + * + * property words: + * def __get__(self): # <<<<<<<<<<<<<< + * return [sym_tostring(w) for w in self if not sym_isvar(w)] + * + */ + +static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self) { + PyObject *__pyx_v_w = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":157 + * property words: + * def __get__(self): + * return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<< + * + * cdef class Rule: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(((PyObject *)__pyx_v_self)) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) { + __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #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[7]; __pyx_lineno = 157; __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[7]; __pyx_lineno = 157; __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[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF(__pyx_v_w); + __pyx_v_w = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_6)); + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(((PyObject *)__pyx_t_1)); + __pyx_r = ((PyObject *)__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("_sa.Phrase.words.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_w); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_lhs; - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_f = 0; - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_e = 0; + struct __pyx_obj_3_sa_Phrase *__pyx_v_f = 0; + struct __pyx_obj_3_sa_Phrase *__pyx_v_e = 0; PyObject *__pyx_v_scores = 0; PyObject *__pyx_v_word_alignments = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0}; PyObject* values[5] = {0,0,0,0,0}; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":167 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":162 * * def __cinit__(self, int lhs, Phrase f, Phrase e, * scores=None, word_alignments=None): # <<<<<<<<<<<<<< @@ -23580,20 +23978,17 @@ static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lhs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -23607,7 +24002,7 @@ static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __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[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -23620,23 +24015,23 @@ static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject default: goto __pyx_L5_argtuple_error; } } - __pyx_v_lhs = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_lhs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_f = ((struct __pyx_obj_8_cdec_sa_Phrase *)values[1]); - __pyx_v_e = ((struct __pyx_obj_8_cdec_sa_Phrase *)values[2]); + __pyx_v_lhs = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_lhs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)values[1]); + __pyx_v_e = ((struct __pyx_obj_3_sa_Phrase *)values[2]); __pyx_v_scores = values[3]; __pyx_v_word_alignments = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Rule.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8_cdec_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_8_cdec_sa_Phrase, 1, "e", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_4Rule___cinit__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_word_alignments); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_e), __pyx_ptype_3_sa_Phrase, 1, "e", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_4Rule___cinit__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_word_alignments); goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -23645,15 +24040,15 @@ static int __pyx_pw_8_cdec_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":166 - * cdef public word_alignments +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":161 + * cdef class Rule: * * def __cinit__(self, int lhs, Phrase f, Phrase e, # <<<<<<<<<<<<<< * scores=None, word_alignments=None): * cdef int i, n */ -static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, int __pyx_v_lhs, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_f, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_word_alignments) { +static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, int __pyx_v_lhs, struct __pyx_obj_3_sa_Phrase *__pyx_v_f, struct __pyx_obj_3_sa_Phrase *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_word_alignments) { int __pyx_v_i; int __pyx_v_n; int __pyx_r; @@ -23669,44 +24064,44 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":171 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":166 * cdef char *rest * - * if not ALPHABET.isvar(lhs): # <<<<<<<<<<<<<< + * if not sym_isvar(lhs): # <<<<<<<<<<<<<< * raise Exception('Invalid LHS symbol: %d' % lhs) * */ - __pyx_t_1 = (!((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->isvar(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_lhs)); + __pyx_t_1 = (!__pyx_f_3_sa_sym_isvar(__pyx_v_lhs)); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":172 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":167 * - * if not ALPHABET.isvar(lhs): + * if not sym_isvar(lhs): * raise Exception('Invalid LHS symbol: %d' % lhs) # <<<<<<<<<<<<<< * * self.lhs = lhs */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":174 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":169 * raise Exception('Invalid LHS symbol: %d' % lhs) * * self.lhs = lhs # <<<<<<<<<<<<<< @@ -23715,7 +24110,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ */ __pyx_v_self->lhs = __pyx_v_lhs; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":175 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":170 * * self.lhs = lhs * self.f = f # <<<<<<<<<<<<<< @@ -23728,7 +24123,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __Pyx_DECREF(((PyObject *)__pyx_v_self->f)); __pyx_v_self->f = __pyx_v_f; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":176 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":171 * self.lhs = lhs * self.f = f * self.e = e # <<<<<<<<<<<<<< @@ -23741,7 +24136,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __Pyx_DECREF(((PyObject *)__pyx_v_self->e)); __pyx_v_self->e = __pyx_v_e; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":178 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":173 * self.e = e * * self.word_alignments = word_alignments # <<<<<<<<<<<<<< @@ -23754,7 +24149,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __Pyx_DECREF(__pyx_v_self->word_alignments); __pyx_v_self->word_alignments = __pyx_v_word_alignments; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":179 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":174 * * self.word_alignments = word_alignments * if scores is None: # <<<<<<<<<<<<<< @@ -23764,7 +24159,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __pyx_t_1 = (__pyx_v_scores == Py_None); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":180 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":175 * self.word_alignments = word_alignments * if scores is None: * self.cscores = NULL # <<<<<<<<<<<<<< @@ -23773,7 +24168,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ */ __pyx_v_self->cscores = NULL; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":181 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":176 * if scores is None: * self.cscores = NULL * self.n_scores = 0 # <<<<<<<<<<<<<< @@ -23785,17 +24180,17 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":183 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":178 * self.n_scores = 0 * else: * n = len(scores) # <<<<<<<<<<<<<< * self.cscores = <float *>malloc(n*sizeof(float)) * self.n_scores = n */ - __pyx_t_4 = PyObject_Length(__pyx_v_scores); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Length(__pyx_v_scores); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n = __pyx_t_4; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":184 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":179 * else: * n = len(scores) * self.cscores = <float *>malloc(n*sizeof(float)) # <<<<<<<<<<<<<< @@ -23804,7 +24199,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ */ __pyx_v_self->cscores = ((float *)malloc((__pyx_v_n * (sizeof(float))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":185 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":180 * n = len(scores) * self.cscores = <float *>malloc(n*sizeof(float)) * self.n_scores = n # <<<<<<<<<<<<<< @@ -23813,7 +24208,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ */ __pyx_v_self->n_scores = __pyx_v_n; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":186 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":181 * self.cscores = <float *>malloc(n*sizeof(float)) * self.n_scores = n * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -23823,16 +24218,16 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":187 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":182 * self.n_scores = n * for i from 0 <= i < n: * self.cscores[i] = scores[i] # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_scores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_scores, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_self->cscores[__pyx_v_i]) = __pyx_t_6; } @@ -23844,7 +24239,7 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.Rule.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -23852,15 +24247,15 @@ static int __pyx_pf_8_cdec_sa_4Rule___cinit__(struct __pyx_obj_8_cdec_sa_Rule *_ } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_4Rule_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_4Rule_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_4Rule_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_4Rule_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_4Rule_2__dealloc__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_pf_3_sa_4Rule_2__dealloc__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":189 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":184 * self.cscores[i] = scores[i] * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23868,12 +24263,12 @@ static void __pyx_pw_8_cdec_sa_4Rule_3__dealloc__(PyObject *__pyx_v_self) { * free(self.cscores) */ -static void __pyx_pf_8_cdec_sa_4Rule_2__dealloc__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static void __pyx_pf_3_sa_4Rule_2__dealloc__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":190 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":185 * * def __dealloc__(self): * if self.cscores != NULL: # <<<<<<<<<<<<<< @@ -23883,7 +24278,7 @@ static void __pyx_pf_8_cdec_sa_4Rule_2__dealloc__(struct __pyx_obj_8_cdec_sa_Rul __pyx_t_1 = (__pyx_v_self->cscores != NULL); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":191 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":186 * def __dealloc__(self): * if self.cscores != NULL: * free(self.cscores) # <<<<<<<<<<<<<< @@ -23899,17 +24294,17 @@ static void __pyx_pf_8_cdec_sa_4Rule_2__dealloc__(struct __pyx_obj_8_cdec_sa_Rul } /* Python wrapper */ -static Py_hash_t __pyx_pw_8_cdec_sa_4Rule_5__hash__(PyObject *__pyx_v_self); /*proto*/ -static Py_hash_t __pyx_pw_8_cdec_sa_4Rule_5__hash__(PyObject *__pyx_v_self) { +static Py_hash_t __pyx_pw_3_sa_4Rule_5__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_3_sa_4Rule_5__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_4__hash__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_4__hash__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":193 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":188 * free(self.cscores) * * def __hash__(self): # <<<<<<<<<<<<<< @@ -23917,7 +24312,7 @@ static Py_hash_t __pyx_pw_8_cdec_sa_4Rule_5__hash__(PyObject *__pyx_v_self) { * */ -static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static Py_hash_t __pyx_pf_3_sa_4Rule_4__hash__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -23928,16 +24323,16 @@ static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_R int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hash__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":194 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":189 * * def __hash__(self): * return hash((self.lhs, self.f, self.e)) # <<<<<<<<<<<<<< * * def __cmp__(self, Rule other): */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -23948,7 +24343,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_R PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->e)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->e)); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_Hash(((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Hash(((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; goto __pyx_L0; @@ -23958,7 +24353,7 @@ static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_R __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Rule.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; @@ -23968,13 +24363,13 @@ static Py_hash_t __pyx_pf_8_cdec_sa_4Rule_4__hash__(struct __pyx_obj_8_cdec_sa_R /* Python wrapper */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pw_8_cdec_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { +static int __pyx_pw_3_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static int __pyx_pw_3_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_8_cdec_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_6__cmp__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_other)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_3_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_4Rule_6__cmp__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_3_sa_Rule *)__pyx_v_other)); goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -23984,7 +24379,7 @@ static int __pyx_pw_8_cdec_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *_ } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":196 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":191 * return hash((self.lhs, self.f, self.e)) * * def __cmp__(self, Rule other): # <<<<<<<<<<<<<< @@ -23993,7 +24388,7 @@ static int __pyx_pw_8_cdec_sa_4Rule_7__cmp__(PyObject *__pyx_v_self, PyObject *_ */ #if PY_MAJOR_VERSION < 3 -static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_other) { +static int __pyx_pf_3_sa_4Rule_6__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Rule *__pyx_v_other) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24005,16 +24400,16 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cmp__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":197 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":192 * * def __cmp__(self, Rule other): * return cmp((self.lhs, self.f, self.e, self.word_alignments), (other.lhs, other.f, other.e, self.word_alignments)) # <<<<<<<<<<<<<< * * def __iadd__(self, Rule other): */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -24028,9 +24423,9 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_self->word_alignments); __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_other->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __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); @@ -24044,7 +24439,7 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->word_alignments); __Pyx_GIVEREF(__pyx_v_self->word_alignments); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); @@ -24052,10 +24447,10 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0; @@ -24066,7 +24461,7 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.Rule.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -24075,13 +24470,13 @@ static int __pyx_pf_8_cdec_sa_4Rule_6__cmp__(struct __pyx_obj_8_cdec_sa_Rule *__ #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { +static PyObject *__pyx_pw_3_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_8_cdec_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_8__iadd__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_other)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_3_sa_Rule, 1, "other", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_4Rule_8__iadd__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_3_sa_Rule *)__pyx_v_other)); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -24090,7 +24485,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":199 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":194 * return cmp((self.lhs, self.f, self.e, self.word_alignments), (other.lhs, other.f, other.e, self.word_alignments)) * * def __iadd__(self, Rule other): # <<<<<<<<<<<<<< @@ -24098,7 +24493,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_9__iadd__(PyObject *__pyx_v_self, PyOb * raise ValueError */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_other) { +static PyObject *__pyx_pf_3_sa_4Rule_8__iadd__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Rule *__pyx_v_other) { long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -24109,7 +24504,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iadd__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":200 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":195 * * def __iadd__(self, Rule other): * if self.n_scores != other.n_scores: # <<<<<<<<<<<<<< @@ -24119,7 +24514,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R __pyx_t_1 = (__pyx_v_self->n_scores != __pyx_v_other->n_scores); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":201 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":196 * def __iadd__(self, Rule other): * if self.n_scores != other.n_scores: * raise ValueError # <<<<<<<<<<<<<< @@ -24127,12 +24522,12 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R * self.cscores[i] = self.cscores[i] + other.cscores[i] */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); - {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":202 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":197 * if self.n_scores != other.n_scores: * raise ValueError * for i from 0 <= i < self.n_scores: # <<<<<<<<<<<<<< @@ -24142,7 +24537,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R __pyx_t_2 = __pyx_v_self->n_scores; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":203 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":198 * raise ValueError * for i from 0 <= i < self.n_scores: * self.cscores[i] = self.cscores[i] + other.cscores[i] # <<<<<<<<<<<<<< @@ -24152,7 +24547,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R (__pyx_v_self->cscores[__pyx_v_i]) = ((__pyx_v_self->cscores[__pyx_v_i]) + (__pyx_v_other->cscores[__pyx_v_i])); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":204 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":199 * for i from 0 <= i < self.n_scores: * self.cscores[i] = self.cscores[i] + other.cscores[i] * return self # <<<<<<<<<<<<<< @@ -24167,7 +24562,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.Rule.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -24176,13 +24571,13 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_8__iadd__(struct __pyx_obj_8_cdec_sa_R } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { +static PyObject *__pyx_pw_3_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fmerge (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8_cdec_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_10fmerge(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_v_f)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_3_sa_Phrase, 1, "f", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_4Rule_10fmerge(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((struct __pyx_obj_3_sa_Phrase *)__pyx_v_f)); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -24191,7 +24586,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":206 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":201 * return self * * def fmerge(self, Phrase f): # <<<<<<<<<<<<<< @@ -24199,7 +24594,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_11fmerge(PyObject *__pyx_v_self, PyObj * self.f = f */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_10fmerge(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_f) { +static PyObject *__pyx_pf_3_sa_4Rule_10fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v_self, struct __pyx_obj_3_sa_Phrase *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24209,20 +24604,20 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_10fmerge(struct __pyx_obj_8_cdec_sa_Ru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fmerge", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":207 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":202 * * def fmerge(self, Phrase f): * if self.f == f: # <<<<<<<<<<<<<< * self.f = f * */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self->f), ((PyObject *)__pyx_v_f), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":208 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":203 * def fmerge(self, Phrase f): * if self.f == f: * self.f = f # <<<<<<<<<<<<<< @@ -24242,7 +24637,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_10fmerge(struct __pyx_obj_8_cdec_sa_Ru goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Rule.fmerge", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.fmerge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -24251,17 +24646,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_10fmerge(struct __pyx_obj_8_cdec_sa_Ru } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_13arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_13arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_4Rule_13arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_13arity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("arity (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_12arity(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_12arity(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":210 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":205 * self.f = f * * def arity(self): # <<<<<<<<<<<<<< @@ -24269,7 +24664,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_13arity(PyObject *__pyx_v_self, CYTHON * */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_12arity(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24279,7 +24674,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rul int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arity", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":211 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":206 * * def arity(self): * return self.f.arity() # <<<<<<<<<<<<<< @@ -24287,9 +24682,9 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rul * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->f), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->f), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 206; __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[7]; __pyx_lineno = 211; __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[7]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -24301,7 +24696,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rul __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Rule.arity", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.arity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -24310,17 +24705,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_12arity(struct __pyx_obj_8_cdec_sa_Rul } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_15__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_15__str__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_15__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_15__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_14__str__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_14__str__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":213 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":208 * return self.f.arity() * * def __str__(self): # <<<<<<<<<<<<<< @@ -24328,7 +24723,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_15__str__(PyObject *__pyx_v_self) { * for i from 0 <= i < self.n_scores: */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_14__str__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_v_scorestrs = NULL; long __pyx_v_i; PyObject *__pyx_v_fields = NULL; @@ -24350,86 +24745,86 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":214 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":209 * * def __str__(self): * scorestrs = [] # <<<<<<<<<<<<<< * for i from 0 <= i < self.n_scores: * scorestrs.append(str(self.cscores[i])) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_scorestrs = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":215 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":210 * def __str__(self): * scorestrs = [] * for i from 0 <= i < self.n_scores: # <<<<<<<<<<<<<< * scorestrs.append(str(self.cscores[i])) - * fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] */ __pyx_t_2 = __pyx_v_self->n_scores; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":216 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":211 * scorestrs = [] * for i from 0 <= i < self.n_scores: * scorestrs.append(str(self.cscores[i])) # <<<<<<<<<<<<<< - * fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] * if self.word_alignments is not None: */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->cscores[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->cscores[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = PyList_Append(__pyx_v_scorestrs, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_scorestrs, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":217 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":212 * for i from 0 <= i < self.n_scores: * scorestrs.append(str(self.cscores[i])) - * fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] # <<<<<<<<<<<<<< + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] # <<<<<<<<<<<<<< * if self.word_alignments is not None: * alignstr = [] */ - __pyx_t_1 = PyBytes_FromString(((struct __pyx_vtabstruct_8_cdec_sa_Alphabet *)__pyx_v_8_cdec_sa_ALPHABET->__pyx_vtab)->tostring(__pyx_v_8_cdec_sa_ALPHABET, __pyx_v_self->lhs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_v_self->lhs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->f)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->f)); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __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[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->e)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->e)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->e)); - __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_scorestrs)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_scorestrs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_scorestrs)); - __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); @@ -24446,9 +24841,9 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R __pyx_v_fields = __pyx_t_7; __pyx_t_7 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":218 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":213 * scorestrs.append(str(self.cscores[i])) - * fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] * if self.word_alignments is not None: # <<<<<<<<<<<<<< * alignstr = [] * for i from 0 <= i < len(self.word_alignments): @@ -24456,19 +24851,19 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R __pyx_t_9 = (__pyx_v_self->word_alignments != Py_None); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":219 - * fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":214 + * fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] * if self.word_alignments is not None: * alignstr = [] # <<<<<<<<<<<<<< * for i from 0 <= i < len(self.word_alignments): * alignstr.append("%d-%d" % (self.word_alignments[i]/65536, self.word_alignments[i]%65536)) */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_v_alignstr = __pyx_t_7; __pyx_t_7 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":220 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":215 * if self.word_alignments is not None: * alignstr = [] * for i from 0 <= i < len(self.word_alignments): # <<<<<<<<<<<<<< @@ -24477,28 +24872,28 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R */ __pyx_t_7 = __pyx_v_self->word_alignments; __Pyx_INCREF(__pyx_t_7); - __pyx_t_10 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":221 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":216 * alignstr = [] * for i from 0 <= i < len(self.word_alignments): * alignstr.append("%d-%d" % (self.word_alignments[i]/65536, self.word_alignments[i]%65536)) # <<<<<<<<<<<<<< * #for s,t in self.word_alignments: * #alignstr.append("%d-%d" % (s,t)) */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->word_alignments, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->word_alignments, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_65536); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_65536); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->word_alignments, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->word_alignments, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyNumber_Remainder(__pyx_t_7, __pyx_int_65536); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Remainder(__pyx_t_7, __pyx_int_65536); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); @@ -24506,38 +24901,38 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R __Pyx_GIVEREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_4 = PyList_Append(__pyx_v_alignstr, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_alignstr, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":224 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":219 * #for s,t in self.word_alignments: * #alignstr.append("%d-%d" % (s,t)) * fields.append(" ".join(alignstr)) # <<<<<<<<<<<<<< * * return " ||| ".join(fields) */ - __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_64), __pyx_n_s__join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_alignstr)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_alignstr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_alignstr)); - __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_4 = PyList_Append(__pyx_v_fields, __pyx_t_8); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_Append(__pyx_v_fields, __pyx_t_8); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L5; } __pyx_L5:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":226 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":221 * fields.append(" ".join(alignstr)) * * return " ||| ".join(fields) # <<<<<<<<<<<<<< @@ -24545,14 +24940,14 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R * property scores: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_fields)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_fields)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fields)); - __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -24569,7 +24964,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("_cdec_sa.Rule.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_scorestrs); @@ -24581,17 +24976,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_14__str__(struct __pyx_obj_8_cdec_sa_R } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_6scores_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_6scores_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_6scores_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_6scores_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_6scores___get__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_6scores___get__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":229 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":224 * * property scores: * def __get__(self): # <<<<<<<<<<<<<< @@ -24599,7 +24994,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_6scores_1__get__(PyObject *__pyx_v_sel * for i from 0 <= i < self.n_scores: */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_6scores___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_v_s = NULL; long __pyx_v_i; PyObject *__pyx_r = NULL; @@ -24611,14 +25006,14 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":230 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":225 * property scores: * def __get__(self): * s = [None]*self.n_scores # <<<<<<<<<<<<<< * for i from 0 <= i < self.n_scores: * s[i] = self.cscores[i] */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->n_scores<0) ? 0:__pyx_v_self->n_scores)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->n_scores<0) ? 0:__pyx_v_self->n_scores)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_self->n_scores; __pyx_temp++) { @@ -24630,7 +25025,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cde __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":231 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":226 * def __get__(self): * s = [None]*self.n_scores * for i from 0 <= i < self.n_scores: # <<<<<<<<<<<<<< @@ -24640,20 +25035,20 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cde __pyx_t_2 = __pyx_v_self->n_scores; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":232 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":227 * s = [None]*self.n_scores * for i from 0 <= i < self.n_scores: * s[i] = self.cscores[i] # <<<<<<<<<<<<<< * return s * */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->cscores[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->cscores[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_SetItemInt(((PyObject *)__pyx_v_s), __pyx_v_i, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(((PyObject *)__pyx_v_s), __pyx_v_i, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":233 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":228 * for i from 0 <= i < self.n_scores: * s[i] = self.cscores[i] * return s # <<<<<<<<<<<<<< @@ -24669,7 +25064,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cde goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Rule.scores.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.scores.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); @@ -24679,17 +25074,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_6scores___get__(struct __pyx_obj_8_cde } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_4Rule_6scores_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_6scores_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s) { +static int __pyx_pw_3_sa_4Rule_6scores_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/ +static int __pyx_pw_3_sa_4Rule_6scores_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_s) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_s)); + __pyx_r = __pyx_pf_3_sa_4Rule_6scores_2__set__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_s)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":235 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":230 * return s * * def __set__(self, s): # <<<<<<<<<<<<<< @@ -24697,7 +25092,7 @@ static int __pyx_pw_8_cdec_sa_4Rule_6scores_3__set__(PyObject *__pyx_v_self, PyO * free(self.cscores) */ -static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_s) { +static int __pyx_pf_3_sa_4Rule_6scores_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_s) { long __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations @@ -24711,7 +25106,7 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":236 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":231 * * def __set__(self, s): * if self.cscores != NULL: # <<<<<<<<<<<<<< @@ -24721,7 +25116,7 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ __pyx_t_1 = (__pyx_v_self->cscores != NULL); if (__pyx_t_1) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":237 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":232 * def __set__(self, s): * if self.cscores != NULL: * free(self.cscores) # <<<<<<<<<<<<<< @@ -24733,27 +25128,27 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ } __pyx_L3:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":238 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":233 * if self.cscores != NULL: * free(self.cscores) * self.cscores = <float *>malloc(len(s)*sizeof(float)) # <<<<<<<<<<<<<< * self.n_scores = len(s) * for i from 0 <= i < self.n_scores: */ - __pyx_t_2 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->cscores = ((float *)malloc((__pyx_t_2 * (sizeof(float))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":239 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":234 * free(self.cscores) * self.cscores = <float *>malloc(len(s)*sizeof(float)) * self.n_scores = len(s) # <<<<<<<<<<<<<< * for i from 0 <= i < self.n_scores: * self.cscores[i] = s[i] */ - __pyx_t_2 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_scores = __pyx_t_2; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":240 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":235 * self.cscores = <float *>malloc(len(s)*sizeof(float)) * self.n_scores = len(s) * for i from 0 <= i < self.n_scores: # <<<<<<<<<<<<<< @@ -24762,14 +25157,14 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ __pyx_t_3 = __pyx_v_self->n_scores; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":241 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":236 * self.n_scores = len(s) * for i from 0 <= i < self.n_scores: * self.cscores[i] = s[i] # <<<<<<<<<<<<<< */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_s, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_s, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_self->cscores[__pyx_v_i]) = __pyx_t_5; } @@ -24778,7 +25173,7 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.Rule.scores.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.scores.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -24786,17 +25181,17 @@ static int __pyx_pf_8_cdec_sa_4Rule_6scores_2__set__(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_3lhs_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_3lhs_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_3lhs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_3lhs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_3lhs___get__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_3lhs___get__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":160 +/* "_sa.pxd":8 * * cdef class Rule: * cdef public int lhs # <<<<<<<<<<<<<< @@ -24804,7 +25199,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_3lhs_1__get__(PyObject *__pyx_v_self) * cdef float *cscores */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_3lhs___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_3lhs___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24813,7 +25208,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_3lhs___get__(struct __pyx_obj_8_cdec_s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_self->lhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24823,7 +25218,7 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_3lhs___get__(struct __pyx_obj_8_cdec_s goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Rule.lhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.lhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -24832,17 +25227,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_3lhs___get__(struct __pyx_obj_8_cdec_s } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_4Rule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_4Rule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_4Rule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_3lhs_2__set__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_4Rule_3lhs_2__set__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_4Rule_3lhs_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_4Rule_3lhs_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -24850,13 +25245,13 @@ static int __pyx_pf_8_cdec_sa_4Rule_3lhs_2__set__(struct __pyx_obj_8_cdec_sa_Rul const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->lhs = __pyx_t_1; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.Rule.lhs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Rule.lhs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -24864,17 +25259,17 @@ static int __pyx_pf_8_cdec_sa_4Rule_3lhs_2__set__(struct __pyx_obj_8_cdec_sa_Rul } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_1f___get__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_1f___get__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":161 +/* "_sa.pxd":9 * cdef class Rule: * cdef public int lhs * cdef readonly Phrase f, e # <<<<<<<<<<<<<< @@ -24882,7 +25277,7 @@ static PyObject *__pyx_pw_8_cdec_sa_4Rule_1f_1__get__(PyObject *__pyx_v_self) { * cdef int n_scores */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_1f___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_1f___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -24899,17 +25294,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_1f___get__(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_1e_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_1e_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_1e_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_1e_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_1e___get__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_1e___get__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_8_cdec_sa_4Rule_1e___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_1e___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -24926,25 +25321,25 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_1e___get__(struct __pyx_obj_8_cdec_sa_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_15word_alignments_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_4Rule_15word_alignments_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_4Rule_15word_alignments_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_4Rule_15word_alignments_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_15word_alignments___get__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_15word_alignments___get__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rule.pxi":164 +/* "_sa.pxd":12 * cdef float *cscores * cdef int n_scores * cdef public word_alignments # <<<<<<<<<<<<<< * - * def __cinit__(self, int lhs, Phrase f, Phrase e, + * cdef char* sym_tostring(int sym) */ -static PyObject *__pyx_pf_8_cdec_sa_4Rule_15word_alignments___get__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_4Rule_15word_alignments___get__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -24961,17 +25356,17 @@ static PyObject *__pyx_pf_8_cdec_sa_4Rule_15word_alignments___get__(struct __pyx } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_4Rule_15word_alignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_15word_alignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_4Rule_15word_alignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_4Rule_15word_alignments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_15word_alignments_2__set__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_4Rule_15word_alignments_2__set__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_2__set__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_4Rule_15word_alignments_2__set__(struct __pyx_obj_3_sa_Rule *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -24987,17 +25382,17 @@ static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_2__set__(struct __pyx_obj_ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_4Rule_15word_alignments_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_4Rule_15word_alignments_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_4Rule_15word_alignments_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_4Rule_15word_alignments_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_4Rule_15word_alignments_4__del__(((struct __pyx_obj_8_cdec_sa_Rule *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_4Rule_15word_alignments_4__del__(((struct __pyx_obj_3_sa_Rule *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_4__del__(struct __pyx_obj_8_cdec_sa_Rule *__pyx_v_self) { +static int __pyx_pf_3_sa_4Rule_15word_alignments_4__del__(struct __pyx_obj_3_sa_Rule *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -25020,9 +25415,9 @@ static int __pyx_pf_8_cdec_sa_4Rule_15word_alignments_4__del__(struct __pyx_obj_ * node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) */ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_new_trie_node(void) { - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_r; +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) { + struct __pyx_t_3_sa__Trie_Node *__pyx_v_node; + struct __pyx_t_3_sa__Trie_Node *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_node", 0); @@ -25033,7 +25428,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_new_trie_node(void * node.root = NULL * node.arr_len = 0 */ - __pyx_v_node = ((struct __pyx_t_8_cdec_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_8_cdec_sa__Trie_Node)))); + __pyx_v_node = ((struct __pyx_t_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Node)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":24 * cdef _Trie_Node* node @@ -25086,9 +25481,9 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_new_trie_node(void * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) */ -static struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_f_8_cdec_sa_new_trie_edge(int __pyx_v_val) { - struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_v_edge; - struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_r; +static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_val) { + struct __pyx_t_3_sa__Trie_Edge *__pyx_v_edge; + struct __pyx_t_3_sa__Trie_Edge *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("new_trie_edge", 0); @@ -25099,7 +25494,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_f_8_cdec_sa_new_trie_edge(int * edge.node = new_trie_node() * edge.bigger = NULL */ - __pyx_v_edge = ((struct __pyx_t_8_cdec_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_8_cdec_sa__Trie_Edge)))); + __pyx_v_edge = ((struct __pyx_t_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Edge)))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":32 * cdef _Trie_Edge* edge @@ -25108,7 +25503,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_f_8_cdec_sa_new_trie_edge(int * edge.bigger = NULL * edge.smaller = NULL */ - __pyx_v_edge->node = __pyx_f_8_cdec_sa_new_trie_node(); + __pyx_v_edge->node = __pyx_f_3_sa_new_trie_node(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":33 * edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) @@ -25161,7 +25556,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_f_8_cdec_sa_new_trie_edge(int * free_trie_edge(node.root) */ -static PyObject *__pyx_f_8_cdec_sa_free_trie_node(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node) { +static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -25188,7 +25583,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_node(struct __pyx_t_8_cdec_sa__Trie * free(node.arr) * */ - __pyx_t_2 = __pyx_f_8_cdec_sa_free_trie_edge(__pyx_v_node->root); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_free_trie_edge(__pyx_v_node->root); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -25208,7 +25603,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_node(struct __pyx_t_8_cdec_sa__Trie goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.free_trie_node", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.free_trie_node", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -25224,7 +25619,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_node(struct __pyx_t_8_cdec_sa__Trie * free_trie_node(edge.node) */ -static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_v_edge) { +static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__pyx_v_edge) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -25251,7 +25646,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie * free_trie_edge(edge.bigger) * free_trie_edge(edge.smaller) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_free_trie_node(__pyx_v_edge->node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_free_trie_node(__pyx_v_edge->node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -25262,7 +25657,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie * free_trie_edge(edge.smaller) * */ - __pyx_t_2 = __pyx_f_8_cdec_sa_free_trie_edge(__pyx_v_edge->bigger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_free_trie_edge(__pyx_v_edge->bigger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -25273,7 +25668,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie * * cdef _Trie_Node* trie_find(_Trie_Node* node, int val): */ - __pyx_t_2 = __pyx_f_8_cdec_sa_free_trie_edge(__pyx_v_edge->smaller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_free_trie_edge(__pyx_v_edge->smaller); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3; @@ -25284,7 +25679,7 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.free_trie_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.free_trie_edge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -25300,9 +25695,9 @@ static PyObject *__pyx_f_8_cdec_sa_free_trie_edge(struct __pyx_t_8_cdec_sa__Trie * cur = node.root */ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_find(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { - struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_v_cur; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_r; +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { + struct __pyx_t_3_sa__Trie_Edge *__pyx_v_cur; + struct __pyx_t_3_sa__Trie_Node *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -25428,7 +25823,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_find(struct _ * new_len = node.arr_len + 1 */ -static PyObject *__pyx_f_8_cdec_sa_trie_node_data_append(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { +static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { int __pyx_v_new_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -25484,7 +25879,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_data_append(struct __pyx_t_8_cdec_s * new_len = node.arr_len + num_vals */ -static PyObject *__pyx_f_8_cdec_sa_trie_node_data_extend(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node, int *__pyx_v_vals, int __pyx_v_num_vals) { +static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node, int *__pyx_v_vals, int __pyx_v_num_vals) { int __pyx_v_new_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -25540,9 +25935,9 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_data_extend(struct __pyx_t_8_cdec_s * cur = &node.root */ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_insert(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { - struct __pyx_t_8_cdec_sa__Trie_Edge **__pyx_v_cur; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_r; +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node, int __pyx_v_val) { + struct __pyx_t_3_sa__Trie_Edge **__pyx_v_cur; + struct __pyx_t_3_sa__Trie_Node *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -25636,7 +26031,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_insert(struct * return cur[0].node * */ - (__pyx_v_cur[0]) = __pyx_f_8_cdec_sa_new_trie_edge(__pyx_v_val); + (__pyx_v_cur[0]) = __pyx_f_3_sa_new_trie_edge(__pyx_v_val); goto __pyx_L6; } __pyx_L6:; @@ -25665,8 +26060,8 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_trie_insert(struct * */ -static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node, PyObject *__pyx_v_result, PyObject *__pyx_v_prefix, int __pyx_v_include_zeros) { - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr = 0; +static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *__pyx_v_node, PyObject *__pyx_v_result, PyObject *__pyx_v_prefix, int __pyx_v_include_zeros) { + struct __pyx_obj_3_sa_IntList *__pyx_v_arr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -25699,9 +26094,9 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Tr * free(arr.arr) * arr.arr = <int*> malloc(node.arr_len * sizeof(int)) */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_v_arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":94 @@ -25756,7 +26151,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Tr * trie_edge_to_map(node.root, result, prefix, include_zeros) * */ - if (PyObject_SetItem(__pyx_v_result, __pyx_v_prefix, ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_result, __pyx_v_prefix, ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; @@ -25768,7 +26163,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Tr * * cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_edge_to_map(__pyx_v_node->root, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_edge_to_map(__pyx_v_node->root, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -25776,7 +26171,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Tr goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.trie_node_to_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.trie_node_to_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_arr); @@ -25793,7 +26188,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_node_to_map(struct __pyx_t_8_cdec_sa__Tr * trie_edge_to_map(edge.smaller, result, prefix, include_zeros) */ -static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Trie_Edge *__pyx_v_edge, PyObject *__pyx_v_result, PyObject *__pyx_v_prefix, int __pyx_v_include_zeros) { +static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *__pyx_v_edge, PyObject *__pyx_v_result, PyObject *__pyx_v_prefix, int __pyx_v_include_zeros) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -25822,7 +26217,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr * trie_edge_to_map(edge.bigger, result, prefix, include_zeros) * prefix = prefix + (edge.val,) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_trie_edge_to_map(__pyx_v_edge->smaller, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_trie_edge_to_map(__pyx_v_edge->smaller, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -25833,7 +26228,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr * prefix = prefix + (edge.val,) * trie_node_to_map(edge.node, result, prefix, include_zeros) */ - __pyx_t_2 = __pyx_f_8_cdec_sa_trie_edge_to_map(__pyx_v_edge->bigger, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_trie_edge_to_map(__pyx_v_edge->bigger, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -25844,14 +26239,14 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr * trie_node_to_map(edge.node, result, prefix, include_zeros) * */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_edge->val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_edge->val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 106; __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 = PyNumber_Add(__pyx_v_prefix, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_prefix, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_prefix); @@ -25865,7 +26260,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr * * cdef class TrieMap: */ - __pyx_t_2 = __pyx_f_8_cdec_sa_trie_node_to_map(__pyx_v_edge->node, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_trie_node_to_map(__pyx_v_edge->node, __pyx_v_result, __pyx_v_prefix, __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3; @@ -25877,7 +26272,7 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.trie_edge_to_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.trie_edge_to_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); @@ -25887,14 +26282,14 @@ static PyObject *__pyx_f_8_cdec_sa_trie_edge_to_map(struct __pyx_t_8_cdec_sa__Tr } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_alphabet_size; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alphabet_size,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -25907,29 +26302,28 @@ static int __pyx_pw_8_cdec_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alphabet_size)) != 0)) kw_args--; 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[11]; __pyx_lineno = 114; __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[12]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_alphabet_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_alphabet_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_alphabet_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_alphabet_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } 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[11]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.TrieMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_7TrieMap___cinit__(((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_v_self), __pyx_v_alphabet_size); + __pyx_r = __pyx_pf_3_sa_7TrieMap___cinit__(((struct __pyx_obj_3_sa_TrieMap *)__pyx_v_self), __pyx_v_alphabet_size); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -25942,7 +26336,7 @@ static int __pyx_pw_8_cdec_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObje * self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) */ -static int __pyx_pf_8_cdec_sa_7TrieMap___cinit__(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, int __pyx_v_alphabet_size) { +static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, int __pyx_v_alphabet_size) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); @@ -25963,7 +26357,7 @@ static int __pyx_pf_8_cdec_sa_7TrieMap___cinit__(struct __pyx_obj_8_cdec_sa_Trie * memset(self.root, 0, self.V * sizeof(_Trie_Node*)) * */ - __pyx_v_self->root = ((struct __pyx_t_8_cdec_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_8_cdec_sa__Trie_Node *))))); + __pyx_v_self->root = ((struct __pyx_t_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_3_sa__Trie_Node *))))); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":117 * self.V = alphabet_size @@ -25972,7 +26366,7 @@ static int __pyx_pf_8_cdec_sa_7TrieMap___cinit__(struct __pyx_obj_8_cdec_sa_Trie * * */ - memset(__pyx_v_self->root, 0, (__pyx_v_self->V * (sizeof(struct __pyx_t_8_cdec_sa__Trie_Node *)))); + memset(__pyx_v_self->root, 0, (__pyx_v_self->V * (sizeof(struct __pyx_t_3_sa__Trie_Node *)))); __pyx_r = 0; __Pyx_RefNannyFinishContext(); @@ -25980,11 +26374,11 @@ static int __pyx_pf_8_cdec_sa_7TrieMap___cinit__(struct __pyx_obj_8_cdec_sa_Trie } /* Python wrapper */ -static void __pyx_pw_8_cdec_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_8_cdec_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_8_cdec_sa_7TrieMap_2__dealloc__(((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_v_self)); + __pyx_pf_3_sa_7TrieMap_2__dealloc__(((struct __pyx_obj_3_sa_TrieMap *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); } @@ -25996,7 +26390,7 @@ static void __pyx_pw_8_cdec_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) { * for i from 0 <= i < self.V: */ -static void __pyx_pf_8_cdec_sa_7TrieMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self) { +static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self) { int __pyx_v_i; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -26034,7 +26428,7 @@ static void __pyx_pf_8_cdec_sa_7TrieMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_ * free(self.root) * */ - __pyx_t_3 = __pyx_f_8_cdec_sa_free_trie_node((__pyx_v_self->root[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_free_trie_node((__pyx_v_self->root[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5; @@ -26054,18 +26448,18 @@ static void __pyx_pf_8_cdec_sa_7TrieMap_2__dealloc__(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.TrieMap.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieMap.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pw_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ +static PyObject *__pyx_pw_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insert (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7TrieMap_4insert(((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + __pyx_r = __pyx_pf_3_sa_7TrieMap_4insert(((struct __pyx_obj_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -26078,7 +26472,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyO * cdef int i, l */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { int *__pyx_v_p; int __pyx_v_i; int __pyx_v_l; @@ -26100,7 +26494,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_ * p = <int*> malloc(l*sizeof(int)) * for i from 0 <= i < l: */ - __pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_l = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":132 @@ -26129,9 +26523,9 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_ * self._insert(p,l) * free(p) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } @@ -26143,7 +26537,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_ * free(p) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l); + ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":136 * p[i] = pattern[i] @@ -26158,7 +26552,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.TrieMap.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieMap.insert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26174,10 +26568,10 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_4insert(struct __pyx_obj_8_cdec_sa_ * cdef _Trie_Node* node */ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__insert(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, int *__pyx_v_pattern, int __pyx_v_pattern_len) { +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, int *__pyx_v_pattern, int __pyx_v_pattern_len) { int __pyx_v_i; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_r; + struct __pyx_t_3_sa__Trie_Node *__pyx_v_node; + struct __pyx_t_3_sa__Trie_Node *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -26200,7 +26594,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__insert(s * node = self.root[pattern[0]] * for i from 1 <= i < pattern_len: */ - (__pyx_v_self->root[(__pyx_v_pattern[0])]) = __pyx_f_8_cdec_sa_new_trie_node(); + (__pyx_v_self->root[(__pyx_v_pattern[0])]) = __pyx_f_3_sa_new_trie_node(); goto __pyx_L3; } __pyx_L3:; @@ -26231,7 +26625,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__insert(s * return node * */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":147 @@ -26251,12 +26645,12 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__insert(s } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pw_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ +static PyObject *__pyx_pw_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7TrieMap_6contains(((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + __pyx_r = __pyx_pf_3_sa_7TrieMap_6contains(((struct __pyx_obj_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -26269,11 +26663,11 @@ static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_7contains(PyObject *__pyx_v_self, P * cdef int i, l */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_pattern) { int *__pyx_v_p; int __pyx_v_i; int __pyx_v_l; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node; + struct __pyx_t_3_sa__Trie_Node *__pyx_v_node; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -26293,7 +26687,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * p = <int*> malloc(l*sizeof(int)) * for i from 0 <= i < l: */ - __pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_l = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":154 @@ -26322,9 +26716,9 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * node = self._contains(p,l) * free(p) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pattern, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_4; } @@ -26336,7 +26730,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * free(p) * if node == NULL: */ - __pyx_v_node = ((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l); + __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":158 * p[i] = pattern[i] @@ -26365,7 +26759,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * return True */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -26382,7 +26776,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -26394,7 +26788,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.TrieMap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieMap.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26410,10 +26804,10 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_6contains(struct __pyx_obj_8_cdec_s * cdef _Trie_Node* node */ -static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__contains(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, int *__pyx_v_pattern, int __pyx_v_pattern_len) { +static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, int *__pyx_v_pattern, int __pyx_v_pattern_len) { int __pyx_v_i; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_r; + struct __pyx_t_3_sa__Trie_Node *__pyx_v_node; + struct __pyx_t_3_sa__Trie_Node *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -26462,7 +26856,7 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__contains * i = i+1 * return node */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); + __pyx_v_node = __pyx_f_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":171 * while node != NULL and i < pattern_len: @@ -26491,12 +26885,12 @@ static struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_f_8_cdec_sa_7TrieMap__contains } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) { +static PyObject *__pyx_pw_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/ +static PyObject *__pyx_pw_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toMap (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_7TrieMap_8toMap(((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_flag)); + __pyx_r = __pyx_pf_3_sa_7TrieMap_8toMap(((struct __pyx_obj_3_sa_TrieMap *)__pyx_v_self), ((PyObject *)__pyx_v_flag)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -26509,7 +26903,7 @@ static PyObject *__pyx_pw_8_cdec_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyOb * */ -static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_flag) { +static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__pyx_v_self, PyObject *__pyx_v_flag) { int __pyx_v_i; int __pyx_v_include_zeros; PyObject *__pyx_v_result = NULL; @@ -26531,7 +26925,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_T * include_zeros=1 * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":178 @@ -26564,7 +26958,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_T * for i from 0 <= i < self.V: * if self.root[i] != NULL: */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; @@ -26596,14 +26990,14 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_T * return result * */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; __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); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_f_8_cdec_sa_trie_node_to_map((__pyx_v_self->root[__pyx_v_i]), ((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_4), __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __pyx_f_3_sa_trie_node_to_map((__pyx_v_self->root[__pyx_v_i]), ((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_4), __pyx_v_include_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -26629,7 +27023,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_T __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.TrieMap.toMap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieMap.toMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -26639,8 +27033,8 @@ static PyObject *__pyx_pf_8_cdec_sa_7TrieMap_8toMap(struct __pyx_obj_8_cdec_sa_T } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fsarray = 0; PyObject *__pyx_v_from_stats = 0; PyObject *__pyx_v_from_binary = 0; @@ -26650,11 +27044,11 @@ static int __pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self PyObject *__pyx_v_max_nonterminals = 0; PyObject *__pyx_v_train_max_initial_size = 0; PyObject *__pyx_v_train_min_gap_size = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_68,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_69,&__pyx_n_s__train_min_gap_size,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_68,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_69,&__pyx_n_s__train_min_gap_size,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":200 @@ -26738,7 +27132,7 @@ static int __pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 200; __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[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -26767,18 +27161,18 @@ static int __pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Precomputation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_14Precomputation___cinit__(((struct __pyx_obj_8_cdec_sa_Precomputation *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_from_stats, __pyx_v_from_binary, __pyx_v_precompute_rank, __pyx_v_precompute_secondary_rank, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size); + __pyx_r = __pyx_pf_3_sa_14Precomputation___cinit__(((struct __pyx_obj_3_sa_Precomputation *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_from_stats, __pyx_v_from_binary, __pyx_v_precompute_rank, __pyx_v_precompute_secondary_rank, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_from_stats, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_precompute_rank, PyObject *__pyx_v_precompute_secondary_rank, PyObject *__pyx_v_max_length, PyObject *__pyx_v_max_nonterminals, PyObject *__pyx_v_train_max_initial_size, PyObject *__pyx_v_train_min_gap_size) { +static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_fsarray, PyObject *__pyx_v_from_stats, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_precompute_rank, PyObject *__pyx_v_precompute_secondary_rank, PyObject *__pyx_v_max_length, PyObject *__pyx_v_max_nonterminals, PyObject *__pyx_v_train_max_initial_size, PyObject *__pyx_v_train_min_gap_size) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -26798,7 +27192,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.precompute_secondary_rank = precompute_secondary_rank * self.max_length = max_length */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->precompute_rank = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":205 @@ -26808,7 +27202,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.max_length = max_length * self.max_nonterminals = max_nonterminals */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_secondary_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_secondary_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->precompute_secondary_rank = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":206 @@ -26818,7 +27212,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.max_nonterminals = max_nonterminals * self.train_max_initial_size = train_max_initial_size */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_length = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":207 @@ -26828,7 +27222,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.train_max_initial_size = train_max_initial_size * self.train_min_gap_size = train_min_gap_size */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_nonterminals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_nonterminals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_nonterminals = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":208 @@ -26838,7 +27232,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.train_min_gap_size = train_min_gap_size * if from_binary: */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_max_initial_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_max_initial_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->train_max_initial_size = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":209 @@ -26848,7 +27242,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_min_gap_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_min_gap_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->train_min_gap_size = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":210 @@ -26858,7 +27252,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.read_binary(from_binary) * elif from_stats: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":211 @@ -26868,14 +27262,14 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * elif from_stats: * self.precompute(from_stats, fsarray) */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_from_binary); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_from_binary); __Pyx_GIVEREF(__pyx_v_from_binary); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -26890,7 +27284,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * self.precompute(from_stats, fsarray) * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_stats); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_stats); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":213 @@ -26900,9 +27294,9 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec * * */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_from_stats); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_from_stats); @@ -26910,7 +27304,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec __Pyx_INCREF(__pyx_v_fsarray); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_fsarray); __Pyx_GIVEREF(__pyx_v_fsarray); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -26925,7 +27319,7 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.Precomputation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -26933,22 +27327,22 @@ static int __pyx_pf_8_cdec_sa_14Precomputation___cinit__(struct __pyx_obj_8_cdec } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Precomputation.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_14Precomputation_2read_binary(((struct __pyx_obj_8_cdec_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_14Precomputation_2read_binary(((struct __pyx_obj_3_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -26961,7 +27355,7 @@ static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_3read_binary(PyObject *__py * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -27041,7 +27435,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_o * self.precomputed_collocations = self.read_map(f) * fclose(f) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->read_map(__pyx_v_self, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->read_map(__pyx_v_self, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->precomputed_index); @@ -27056,7 +27450,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_o * fclose(f) * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->read_map(__pyx_v_self, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->read_map(__pyx_v_self, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->precomputed_collocations); @@ -27077,7 +27471,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_o goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Precomputation.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -27086,22 +27480,22 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_2read_binary(struct __pyx_o } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Precomputation.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_14Precomputation_4write_binary(((struct __pyx_obj_8_cdec_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_14Precomputation_4write_binary(((struct __pyx_obj_3_sa_Precomputation *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -27114,7 +27508,7 @@ static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_5write_binary(PyObject *__p * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -27197,7 +27591,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_ */ __pyx_t_1 = __pyx_v_self->precomputed_index; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->write_map(__pyx_v_self, __pyx_t_1, __pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->write_map(__pyx_v_self, __pyx_t_1, __pyx_v_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27211,7 +27605,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_ */ __pyx_t_2 = __pyx_v_self->precomputed_collocations; __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->write_map(__pyx_v_self, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Precomputation *)__pyx_v_self->__pyx_vtab)->write_map(__pyx_v_self, __pyx_t_2, __pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -27230,7 +27624,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.Precomputation.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -27246,10 +27640,10 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_4write_binary(struct __pyx_ * cdef IntList arr */ -static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_m, FILE *__pyx_v_f) { +static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_m, FILE *__pyx_v_f) { int __pyx_v_i; int __pyx_v_N; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_arr = 0; PyObject *__pyx_v_pattern = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_v_word_id = NULL; @@ -27257,15 +27651,13 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *(*__pyx_t_4)(PyObject *); + Py_ssize_t __pyx_t_3; + int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - Py_ssize_t __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -27278,7 +27670,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * fwrite(&(N), sizeof(int), 1, f) * for pattern, val in m.iteritems(): */ - __pyx_t_1 = PyObject_Length(__pyx_v_m); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(__pyx_v_m); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":249 @@ -27297,80 +27689,22 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * N = len(pattern) * fwrite(&(N), sizeof(int), 1, f) */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_m, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_1 = 0; + if (unlikely(__pyx_v_m == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[12]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else { - __pyx_t_3 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __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[11]; __pyx_lineno = 250; __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; - index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - 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[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L6_unpacking_done:; - } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_m, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_1, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF(__pyx_v_pattern); __pyx_v_pattern = __pyx_t_5; __pyx_t_5 = 0; @@ -27385,8 +27719,8 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * fwrite(&(N), sizeof(int), 1, f) * for word_id in pattern: */ - __pyx_t_9 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_N = __pyx_t_9; + __pyx_t_8 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_N = __pyx_t_8; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":252 * for pattern, val in m.iteritems(): @@ -27405,34 +27739,42 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * fwrite(&(i), sizeof(int), 1, f) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_3 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; - __pyx_t_10 = NULL; + __pyx_t_6 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; + __pyx_t_9 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; } for (;;) { - if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; - } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_6 = __pyx_t_10(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { + __pyx_t_5 = __pyx_t_9(__pyx_t_6); + if (unlikely(!__pyx_t_5)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_word_id = __pyx_t_5; + __pyx_t_5 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":254 * fwrite(&(N), sizeof(int), 1, f) @@ -27441,8 +27783,8 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * fwrite(&(i), sizeof(int), 1, f) * arr = val */ - __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_i = __pyx_t_11; + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_i = __pyx_t_7; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":255 * for word_id in pattern: @@ -27453,7 +27795,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru */ fwrite((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":256 * i = word_id @@ -27462,10 +27804,10 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * arr.write_handle(f) * */ - if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_val); __Pyx_XDECREF(((PyObject *)__pyx_v_arr)); - __pyx_v_arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_val); + __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_val); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":257 * fwrite(&(i), sizeof(int), 1, f) @@ -27474,7 +27816,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_arr->__pyx_vtab)->write_handle(__pyx_v_arr, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->write_handle(__pyx_v_arr, __pyx_v_f); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -27482,11 +27824,9 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("_cdec_sa.Precomputation.write_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.write_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_arr); @@ -27506,13 +27846,13 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_write_map(CYTHON_UNUSED stru * cdef IntList arr */ -static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, FILE *__pyx_v_f) { +static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, FILE *__pyx_v_f) { int __pyx_v_i; CYTHON_UNUSED int __pyx_v_j; CYTHON_UNUSED int __pyx_v_k; int __pyx_v_word_id; int __pyx_v_N; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_arr = 0; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_r = NULL; @@ -27533,7 +27873,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc * fread(&(N), sizeof(int), 1, f) * for j from 0 <= j < N: */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_m = __pyx_t_1; __pyx_t_1 = 0; @@ -27603,14 +27943,14 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc * arr = IntList() * arr.read_handle(f) */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_word_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_word_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_key), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_key), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_key)); @@ -27625,10 +27965,10 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc * arr.read_handle(f) * m[key] = arr */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(((PyObject *)__pyx_v_arr)); - __pyx_v_arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":273 @@ -27638,7 +27978,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc * m[key] = arr * return m */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":274 * arr = IntList() @@ -27647,7 +27987,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc * return m * */ - if (PyDict_SetItem(((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":275 @@ -27667,7 +28007,7 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.Precomputation.read_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.read_map", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_arr); @@ -27679,15 +28019,15 @@ static PyObject *__pyx_f_8_cdec_sa_14Precomputation_read_map(CYTHON_UNUSED struc } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stats = 0; - struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sarray = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; + struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__stats,&__pyx_n_s__sarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -27701,18 +28041,16 @@ static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_7precompute(PyObject *__pyx kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stats)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sarray)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("precompute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("precompute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "precompute") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "precompute") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -27721,18 +28059,18 @@ static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_7precompute(PyObject *__pyx values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_stats = values[0]; - __pyx_v_sarray = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)values[1]); + __pyx_v_sarray = ((struct __pyx_obj_3_sa_SuffixArray *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("precompute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("precompute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Precomputation.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sarray), __pyx_ptype_8_cdec_sa_SuffixArray, 1, "sarray", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_14Precomputation_6precompute(((struct __pyx_obj_8_cdec_sa_Precomputation *)__pyx_v_self), __pyx_v_stats, __pyx_v_sarray); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sarray), __pyx_ptype_3_sa_SuffixArray, 1, "sarray", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_14Precomputation_6precompute(((struct __pyx_obj_3_sa_Precomputation *)__pyx_v_self), __pyx_v_stats, __pyx_v_sarray); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -27749,7 +28087,7 @@ static PyObject *__pyx_pw_8_cdec_sa_14Precomputation_7precompute(PyObject *__pyx * cdef DataArray darray = sarray.darray */ -static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_sarray) { +static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_sa_Precomputation *__pyx_v_self, PyObject *__pyx_v_stats, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_sarray) { int __pyx_v_i; int __pyx_v_l; int __pyx_v_N; @@ -27766,15 +28104,15 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob int __pyx_v_is_super; int __pyx_v_sent_count; int __pyx_v_max_rank; - struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_darray = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_data = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_queue = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_cost_by_rank = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_count_by_rank = 0; - struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_frequent_patterns = 0; - struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_super_frequent_patterns = 0; - struct __pyx_obj_8_cdec_sa_TrieMap *__pyx_v_collocations = 0; - struct __pyx_t_8_cdec_sa__Trie_Node *__pyx_v_node; + struct __pyx_obj_3_sa_DataArray *__pyx_v_darray = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_data = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_queue = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_cost_by_rank = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_count_by_rank = 0; + struct __pyx_obj_3_sa_TrieMap *__pyx_v_frequent_patterns = 0; + struct __pyx_obj_3_sa_TrieMap *__pyx_v_super_frequent_patterns = 0; + struct __pyx_obj_3_sa_TrieMap *__pyx_v_collocations = 0; + struct __pyx_t_3_sa__Trie_Node *__pyx_v_node; PyObject *__pyx_v_I_set = NULL; PyObject *__pyx_v_J_set = NULL; PyObject *__pyx_v_J2_set = NULL; @@ -27855,19 +28193,19 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob */ __pyx_t_1 = __pyx_v_darray->id2word; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_frequent_patterns = ((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_t_1); + __pyx_v_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":288 @@ -27879,19 +28217,19 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob */ __pyx_t_1 = __pyx_v_darray->id2word; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_super_frequent_patterns = ((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_t_1); + __pyx_v_super_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":289 @@ -27903,19 +28241,19 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob */ __pyx_t_1 = __pyx_v_darray->id2word; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 289; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieMap)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_collocations = ((struct __pyx_obj_8_cdec_sa_TrieMap *)__pyx_t_1); + __pyx_v_collocations = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":291 @@ -27925,7 +28263,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * J_set = set() * J2_set = set() */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_I_set = __pyx_t_1; __pyx_t_1 = 0; @@ -27937,7 +28275,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * J2_set = set() * IJ_set = set() */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_J_set = __pyx_t_1; __pyx_t_1 = 0; @@ -27949,7 +28287,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * IJ_set = set() * pattern_rank = {} */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_J2_set = __pyx_t_1; __pyx_t_1 = 0; @@ -27961,7 +28299,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * pattern_rank = {} * */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_IJ_set = __pyx_t_1; __pyx_t_1 = 0; @@ -27973,7 +28311,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * logger.info("Precomputing frequent intersections") */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_pattern_rank = __pyx_t_1; __pyx_t_1 = 0; @@ -27985,12 +28323,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * cdef float start_time = monitor_cpu() * */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -28002,7 +28340,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * max_pattern_len = 0 */ - __pyx_v_start_time = __pyx_f_8_cdec_sa_monitor_cpu(); + __pyx_v_start_time = __pyx_f_3_sa_monitor_cpu(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":300 * cdef float start_time = monitor_cpu() @@ -28026,23 +28364,31 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __pyx_t_3 = __pyx_v_stats; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_stats); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_stats); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_5 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_5)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -28050,21 +28396,22 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); @@ -28072,10 +28419,16 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -28085,14 +28438,15 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_GOTREF(__pyx_t_7); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF(__pyx_v__); @@ -28107,7 +28461,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_rank); __pyx_v_rank = __pyx_t_1; - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; @@ -28120,12 +28474,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * break * max_pattern_len = max(max_pattern_len, len(phrase)) */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_5, Py_GE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_5, Py_GE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_11) { @@ -28148,7 +28502,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * frequent_patterns.insert(phrase) * I_set.add(phrase) */ - __pyx_t_12 = PyObject_Length(__pyx_v_phrase); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Length(__pyx_v_phrase); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __pyx_v_max_pattern_len; if ((__pyx_t_12 > __pyx_t_13)) { __pyx_t_14 = __pyx_t_12; @@ -28164,14 +28518,14 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * I_set.add(phrase) * pattern_rank[phrase] = rank */ - __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_phrase); __Pyx_GIVEREF(__pyx_v_phrase); - __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; @@ -28184,7 +28538,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * pattern_rank[phrase] = rank * if rank < self.precompute_secondary_rank: */ - __pyx_t_15 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":307 * frequent_patterns.insert(phrase) @@ -28193,7 +28547,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if rank < self.precompute_secondary_rank: * super_frequent_patterns.insert(phrase) */ - if (PyDict_SetItem(((PyObject *)__pyx_v_pattern_rank), __pyx_v_phrase, __pyx_v_rank) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(((PyObject *)__pyx_v_pattern_rank), __pyx_v_phrase, __pyx_v_rank) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":308 * I_set.add(phrase) @@ -28202,12 +28556,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * super_frequent_patterns.insert(phrase) * J_set.add(phrase) */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromLong(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_7, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_7, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_11) { @@ -28218,14 +28572,14 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * J_set.add(phrase) * */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_phrase); __Pyx_GIVEREF(__pyx_v_phrase); - __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -28238,7 +28592,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * queue = IntList(increment=1000) */ - __pyx_t_15 = PySet_Add(__pyx_v_J_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_J_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -28254,13 +28608,13 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * logger.info(" Computing inverted indexes...") */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__increment), __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__increment), __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_queue = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_v_queue = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":314 @@ -28270,12 +28624,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * N = len(data) * for i from 0 <= i < N: */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 314; __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_3); __pyx_t_3 = 0; @@ -28287,7 +28641,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for i from 0 <= i < N: * sa_word_id = data.arr[i] */ - __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_2; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":316 @@ -28326,7 +28680,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * else: * for l from 1 <= l <= max_pattern_len: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, -1); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, -1); goto __pyx_L11; } /*else*/ { @@ -28348,7 +28702,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if node == NULL: * break */ - __pyx_v_node = ((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l); + __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":323 * for l from 1 <= l <= max_pattern_len: @@ -28379,7 +28733,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * queue._append(l) * trie_node_data_append(node, i) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":326 * break @@ -28388,7 +28742,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":327 * queue._append(i) @@ -28397,7 +28751,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * logger.info(" Computing collocations...") */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -28413,12 +28767,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * N = len(queue) * ptr1 = 0 */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 329; __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_3); __pyx_t_3 = 0; @@ -28430,7 +28784,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * ptr1 = 0 * sent_count = 0 */ - __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_queue)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_queue)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_2; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":331 @@ -28601,7 +28955,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: */ - __pyx_v_node = ((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); + __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":347 * l1+l2+1 <= self.max_length): @@ -28610,7 +28964,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, -1); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":348 * node = collocations._insert(data.arr+i1, l1) @@ -28629,7 +28983,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":350 @@ -28639,7 +28993,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i2) * if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28650,7 +29004,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: * if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28661,7 +29015,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: * is_super = 1 */ - __pyx_t_11 = (((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL); + __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL); if (__pyx_t_11) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":353 @@ -28671,7 +29025,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * is_super = 1 * else: */ - __pyx_t_11 = (((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL); + __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL); if (__pyx_t_11) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":354 @@ -28809,7 +29163,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * node = trie_insert(node, -1) */ if (!__pyx_v_is_super) { - __pyx_t_11 = (((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i3), __pyx_v_l3) != NULL); + __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i3), __pyx_v_l3) != NULL); __pyx_t_19 = __pyx_t_11; } else { __pyx_t_19 = __pyx_v_is_super; @@ -28823,7 +29177,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * node = trie_insert(node, -1) * for i from i2 <= i < i2+l2: */ - __pyx_v_node = ((struct __pyx_vtabstruct_8_cdec_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); + __pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":368 * if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: @@ -28832,7 +29186,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for i from i2 <= i < i2+l2: * node = trie_insert(node, data.arr[i]) */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, -1); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":369 * node = collocations._insert(data.arr+i1, l1) @@ -28851,7 +29205,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * node = trie_insert(node, -1) * for i from i3 <= i < i3+l3: */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":371 @@ -28861,7 +29215,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for i from i3 <= i < i3+l3: * node = trie_insert(node, data.arr[i]) */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, -1); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":372 * node = trie_insert(node, data.arr[i]) @@ -28880,7 +29234,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i1) * trie_node_data_append(node, i2) */ - __pyx_v_node = __pyx_f_8_cdec_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); + __pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i])); } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":374 @@ -28890,7 +29244,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i2) * trie_node_data_append(node, i3) */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28901,7 +29255,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * trie_node_data_append(node, i3) * ptr3 = ptr3 + 2 */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -28912,7 +29266,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * ptr3 = ptr3 + 2 * ptr2 = ptr2 + 2 */ - __pyx_t_3 = __pyx_f_8_cdec_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L30; @@ -28988,14 +29342,14 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * ptr1 = ptr1 + 1 * */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__pyx_v_sent_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_sent_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_kp_s_76)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_76)); @@ -29003,7 +29357,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __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_8)); __pyx_t_8 = 0; @@ -29031,16 +29385,16 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * self.precomputed_index = frequent_patterns.toMap(True) * */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_collocations), __pyx_n_s__toMap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_collocations), __pyx_n_s__toMap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -29057,16 +29411,16 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * x = 0 */ - __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__toMap); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__toMap); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 387; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -29093,7 +29447,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for pattern2 in J_set: * if len(pattern1) + len(pattern2) + 1 < self.max_length: */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { @@ -29102,7 +29456,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29119,7 +29473,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if len(pattern1) + len(pattern2) + 1 < self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; for (;;) { @@ -29128,7 +29482,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29145,8 +29499,8 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * combined_pattern = pattern1 + (-1,) + pattern2 * J2_set.add(combined_pattern) */ - __pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (((__pyx_t_2 + __pyx_t_14) + 1) < __pyx_v_self->max_length); if (__pyx_t_19) { @@ -29157,9 +29511,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * J2_set.add(combined_pattern) * */ - __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_77)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_77)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_v_combined_pattern); @@ -29173,7 +29527,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * for pattern1 in I_set: */ - __pyx_t_15 = PySet_Add(__pyx_v_J2_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_J2_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L40; } __pyx_L40:; @@ -29189,7 +29543,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for pattern2 in I_set: * x = x+1 */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { @@ -29198,7 +29552,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29215,7 +29569,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * x = x+1 * if len(pattern1) + len(pattern2) + 1 <= self.max_length: */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; for (;;) { @@ -29224,7 +29578,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29241,7 +29595,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if len(pattern1) + len(pattern2) + 1 <= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 */ - __pyx_t_7 = PyNumber_Add(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_7; @@ -29254,8 +29608,8 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) */ - __pyx_t_14 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (((__pyx_t_14 + __pyx_t_2) + 1) <= __pyx_v_self->max_length); if (__pyx_t_19) { @@ -29266,9 +29620,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * IJ_set.add(combined_pattern) * */ - __pyx_t_7 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_78)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_78)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_v_combined_pattern); @@ -29282,7 +29636,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * for pattern1 in I_set: */ - __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L45; } __pyx_L45:; @@ -29298,7 +29652,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for pattern2 in J2_set: * x = x+2 */ - __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; for (;;) { @@ -29307,7 +29661,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29324,7 +29678,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * x = x+2 * if len(pattern1) + len(pattern2) + 1<= self.max_length: */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J2_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J2_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; for (;;) { @@ -29333,7 +29687,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -29350,7 +29704,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if len(pattern1) + len(pattern2) + 1<= self.max_length: * combined_pattern = pattern1 + (-1,) + pattern2 */ - __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_8; @@ -29363,8 +29717,8 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * combined_pattern = pattern1 + (-1,) + pattern2 * IJ_set.add(combined_pattern) */ - __pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (((__pyx_t_2 + __pyx_t_14) + 1) <= __pyx_v_self->max_length); if (__pyx_t_19) { @@ -29375,9 +29729,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 */ - __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_79)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_79)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_v_combined_pattern); @@ -29391,7 +29745,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * combined_pattern = pattern2 + (-1,) + pattern1 * IJ_set.add(combined_pattern) */ - __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":409 * combined_pattern = pattern1 + (-1,) + pattern2 @@ -29400,9 +29754,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * IJ_set.add(combined_pattern) * */ - __pyx_t_7 = PyNumber_Add(__pyx_v_pattern2, ((PyObject *)__pyx_k_tuple_80)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_pattern2, ((PyObject *)__pyx_k_tuple_80)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_combined_pattern); @@ -29416,7 +29770,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * N = len(pattern_rank) */ - __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L50; } __pyx_L50:; @@ -29432,7 +29786,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * cost_by_rank = IntList(initial_len=N) * count_by_rank = IntList(initial_len=N) */ - __pyx_t_14 = PyDict_Size(((PyObject *)__pyx_v_pattern_rank)); + __pyx_t_14 = PyDict_Size(((PyObject *)__pyx_v_pattern_rank)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_N = __pyx_t_14; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":413 @@ -29442,16 +29796,16 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * count_by_rank = IntList(initial_len=N) * for pattern, arr in self.precomputed_collocations.iteritems(): */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_cost_by_rank = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_v_cost_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":414 @@ -29461,16 +29815,16 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for pattern, arr in self.precomputed_collocations.iteritems(): * if pattern not in IJ_set: */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_count_by_rank = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_count_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":415 @@ -29480,86 +29834,28 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if pattern not in IJ_set: * s = "" */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_14 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_14 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + __pyx_t_14 = 0; + if (unlikely(__pyx_v_self->precomputed_collocations == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { - if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { - if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; - } else { - __pyx_t_3 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; - index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L53_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_7)) goto __pyx_L53_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L54_unpacking_done; - __pyx_L53_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L54_unpacking_done:; - } + __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_self->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_2), (&__pyx_t_13)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + while (1) { + __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_14, &__pyx_t_3, &__pyx_t_8, NULL, __pyx_t_13); + if (unlikely(__pyx_t_16 == 0)) break; + if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_pattern = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_arr = __pyx_t_8; + __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":416 * count_by_rank = IntList(initial_len=N) @@ -29568,7 +29864,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * s = "" * for word_id in pattern: */ - __pyx_t_19 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_IJ_set), __pyx_v_pattern))); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_v_IJ_set), __pyx_v_pattern))); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_19) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":417 @@ -29590,34 +29886,42 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * s = s + "X " */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_3 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0; - __pyx_t_20 = NULL; + __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; + __pyx_t_4 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; } for (;;) { - if (!__pyx_t_20 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; - } else if (!__pyx_t_20 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_7 = __pyx_t_20(__pyx_t_3); - if (unlikely(!__pyx_t_7)) { + __pyx_t_3 = __pyx_t_4(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_word_id = __pyx_t_3; + __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":419 * s = "" @@ -29626,10 +29930,10 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * s = s + "X " * else: */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_19) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":420 @@ -29639,12 +29943,12 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * else: * s = s + darray.id2word[word_id] + " " */ - __pyx_t_7 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_81)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_81)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L58; + __pyx_v_s = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L56; } /*else*/ { @@ -29655,21 +29959,21 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) * else: */ - __pyx_t_7 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_v_s, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Add(__pyx_v_s, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_s = __pyx_t_3; + __pyx_t_3 = 0; } - __pyx_L58:; + __pyx_L56:; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":423 * else: @@ -29678,25 +29982,25 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * else: * chunk = () */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_kp_s_82)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_82)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_82)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_82)); __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_s); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L55; + goto __pyx_L53; } /*else*/ { @@ -29739,34 +30043,42 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * max_rank = max(max_rank, pattern_rank[chunk]) */ if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) { - __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = 0; - __pyx_t_20 = NULL; + __pyx_t_7 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0; + __pyx_t_4 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_20 = Py_TYPE(__pyx_t_8)->tp_iternext; + __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = Py_TYPE(__pyx_t_7)->tp_iternext; } for (;;) { - if (!__pyx_t_20 && PyList_CheckExact(__pyx_t_8)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; - } else if (!__pyx_t_20 && PyTuple_CheckExact(__pyx_t_8)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_8)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_3 = __pyx_t_20(__pyx_t_8); - if (unlikely(!__pyx_t_3)) { + __pyx_t_8 = __pyx_t_4(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF(__pyx_v_word_id); - __pyx_v_word_id = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_word_id = __pyx_t_8; + __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":429 * arity = 0 @@ -29775,10 +30087,10 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * max_rank = max(max_rank, pattern_rank[chunk]) * arity = arity + 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_19) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":430 @@ -29788,29 +30100,29 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * arity = arity + 1 * chunk = () */ - __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __pyx_v_max_rank; - __pyx_t_5 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __pyx_v_max_rank; + __pyx_t_5 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_8, __pyx_t_5, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_19) { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_3 = __pyx_t_8; } else { - __pyx_t_6 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_t_6; + __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_max_rank = __pyx_t_13; + __pyx_v_max_rank = __pyx_t_16; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":431 * if word_id == -1: @@ -29819,11 +30131,11 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * chunk = () * else: */ - __pyx_t_7 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_arity); - __pyx_v_arity = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_arity = __pyx_t_3; + __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":432 * max_rank = max(max_rank, pattern_rank[chunk]) @@ -29835,7 +30147,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); __Pyx_DECREF(((PyObject *)__pyx_v_chunk)); __pyx_v_chunk = __pyx_empty_tuple; - goto __pyx_L61; + goto __pyx_L59; } /*else*/ { @@ -29846,21 +30158,21 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * max_rank = max(max_rank, pattern_rank[chunk]) * cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr)) */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_word_id); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_word_id); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_word_id); __Pyx_GIVEREF(__pyx_v_word_id); - __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_chunk)); - __pyx_v_chunk = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_chunk = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_L61:; + __pyx_L59:; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":435 * else: @@ -29869,29 +30181,29 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr)) * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) */ - __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __pyx_v_max_rank; - __pyx_t_7 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __pyx_v_max_rank; + __pyx_t_3 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_19) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_3 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = __pyx_t_7; } else { - __pyx_t_6 = PyInt_FromLong(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; + __pyx_t_8 = __pyx_t_6; __pyx_t_6 = 0; } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_max_rank = __pyx_t_13; + __pyx_v_max_rank = __pyx_t_16; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":436 * chunk = chunk + (word_id,) @@ -29900,8 +30212,8 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) * */ - __pyx_t_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_2)); + __pyx_t_12 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_12)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":437 * max_rank = max(max_rank, pattern_rank[chunk]) @@ -29910,26 +30222,26 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * cumul_cost = 0 */ - __pyx_t_3 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_13; + (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_16; } - __pyx_L55:; + __pyx_L53:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -29970,9 +30282,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * cumul_count = cumul_count + count_by_rank.arr[i] * logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost) */ - __pyx_t_1 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_cumul_cost); @@ -29986,9 +30298,9 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost) * */ - __pyx_t_6 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_cumul_count); @@ -30002,42 +30314,42 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * num_found_patterns = len(self.precomputed_collocations) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_83)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_83)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_83)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_83)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_cumul_count); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_cumul_count); + PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_cumul_count); __Pyx_GIVEREF(__pyx_v_cumul_count); __Pyx_INCREF(__pyx_v_cumul_cost); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_cumul_cost); + PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_v_cumul_cost); __Pyx_GIVEREF(__pyx_v_cumul_cost); __pyx_t_1 = 0; - __pyx_t_7 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":446 @@ -30047,14 +30359,14 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * for pattern in IJ_set: * if pattern not in self.precomputed_collocations: */ - __pyx_t_3 = __pyx_v_self->precomputed_collocations; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_14 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_num_found_patterns = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_8 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_num_found_patterns = __pyx_t_8; + __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":447 * @@ -30063,24 +30375,24 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * if pattern not in self.precomputed_collocations: * self.precomputed_collocations[pattern] = IntList() */ - __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + __pyx_t_8 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; for (;;) { { - __pyx_t_8 = __pyx_t_4(__pyx_t_3); - if (unlikely(!__pyx_t_8)) { + __pyx_t_7 = __pyx_t_4(__pyx_t_8); + if (unlikely(!__pyx_t_7)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_pattern = __pyx_t_7; + __pyx_t_7 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":448 * num_found_patterns = len(self.precomputed_collocations) @@ -30089,7 +30401,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * self.precomputed_collocations[pattern] = IntList() * */ - __pyx_t_19 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_pattern))); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_self->precomputed_collocations, __pyx_v_pattern))); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_19) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":449 @@ -30099,15 +30411,15 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * * cdef float stop_time = monitor_cpu() */ - __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L66; + __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L64; } - __pyx_L66:; + __pyx_L64:; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":451 * self.precomputed_collocations[pattern] = IntList() @@ -30116,7 +30428,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) */ - __pyx_v_stop_time = __pyx_f_8_cdec_sa_monitor_cpu(); + __pyx_v_stop_time = __pyx_f_3_sa_monitor_cpu(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":452 * @@ -30125,18 +30437,18 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) * logger.info("Precomputation took %f seconds", (stop_time - start_time)) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_v_self->precomputed_collocations; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_14 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_v_self->precomputed_collocations; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_kp_s_84)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_84)); @@ -30144,17 +30456,17 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_INCREF(__pyx_v_num_found_patterns); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_num_found_patterns); __Pyx_GIVEREF(__pyx_v_num_found_patterns); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":453 * cdef float stop_time = monitor_cpu() @@ -30162,56 +30474,56 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) # <<<<<<<<<<<<<< * logger.info("Precomputation took %f seconds", (stop_time - start_time)) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_v_self->precomputed_index; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_14 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_v_self->precomputed_index; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_85)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_85)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_85)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/precomputation.pxi":454 * logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) * logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) * logger.info("Precomputation took %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<< */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_kp_s_86)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_86)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_86)); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -30223,7 +30535,7 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("_cdec_sa.Precomputation.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Precomputation.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_darray); @@ -30261,15 +30573,15 @@ static PyObject *__pyx_pf_8_cdec_sa_14Precomputation_6precompute(struct __pyx_ob } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_from_binary = 0; PyObject *__pyx_v_from_text = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0}; PyObject* values[2] = {0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":11 @@ -30304,7 +30616,7 @@ static int __pyx_pw_8_cdec_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 11; __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[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -30319,18 +30631,18 @@ static int __pyx_pw_8_cdec_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text); + __pyx_r = __pyx_pf_3_sa_11SuffixArray___cinit__(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_from_binary, __pyx_v_from_text); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text) { +static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_from_binary, PyObject *__pyx_v_from_text) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30349,12 +30661,12 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * self.sa = IntList() * self.ha = IntList() */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->darray); __Pyx_DECREF(((PyObject *)__pyx_v_self->darray)); - __pyx_v_self->darray = ((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_t_1); + __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":13 @@ -30364,12 +30676,12 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * self.ha = IntList() * if from_binary: */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sa); __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); - __pyx_v_self->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":14 @@ -30379,12 +30691,12 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * if from_binary: * self.read_binary(from_binary) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->ha); __Pyx_DECREF(((PyObject *)__pyx_v_self->ha)); - __pyx_v_self->ha = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":15 @@ -30394,7 +30706,7 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * self.read_binary(from_binary) * elif from_text: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":16 @@ -30404,14 +30716,14 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * elif from_text: * self.read_text(from_text) */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_binary); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_from_binary); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_from_binary); __Pyx_GIVEREF(__pyx_v_from_binary); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -30426,7 +30738,7 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * self.read_text(from_text) * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":18 @@ -30436,14 +30748,14 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa * * def __getitem__(self, i): */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_from_text); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_from_text); __Pyx_GIVEREF(__pyx_v_from_text); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; @@ -30458,7 +30770,7 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -30466,12 +30778,12 @@ static int __pyx_pf_8_cdec_sa_11SuffixArray___cinit__(struct __pyx_obj_8_cdec_sa } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_2__getitem__(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30484,7 +30796,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v * */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; @@ -30502,8 +30814,8 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(struct __pyx_obj_ * def getSentId(self, i): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sa->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_self->sa->arr[__pyx_t_1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -30513,7 +30825,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(struct __pyx_obj_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -30522,12 +30834,12 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_2__getitem__(struct __pyx_obj_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_5getSentId(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSentId (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_4getSentId(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30540,7 +30852,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_5getSentId(PyObject *__pyx_v_s * */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_4getSentId(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30559,14 +30871,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(struct __pyx_obj_8_ * def getSent(self, i): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSentId); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSentId); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 24; __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[12]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 24; __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[13]; __pyx_lineno = 24; __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; @@ -30580,7 +30892,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(struct __pyx_obj_8_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.getSentId", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.getSentId", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -30589,12 +30901,12 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_4getSentId(struct __pyx_obj_8_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_7getSent(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSent (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_6getSent(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_6getSent(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_i)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30607,7 +30919,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_7getSent(PyObject *__pyx_v_sel * */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_6getSent(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_6getSent(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30626,14 +30938,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_6getSent(struct __pyx_obj_8_cd * def getSentPos(self, loc): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 27; __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[12]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 27; __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[13]; __pyx_lineno = 27; __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; @@ -30647,7 +30959,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_6getSent(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.getSent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.getSent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -30656,12 +30968,12 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_6getSent(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_9getSentPos(PyObject *__pyx_v_self, PyObject *__pyx_v_loc) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSentPos (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_8getSentPos(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((PyObject *)__pyx_v_loc)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30674,7 +30986,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_9getSentPos(PyObject *__pyx_v_ * */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_8getSentPos(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_loc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30693,14 +31005,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(struct __pyx_obj_8 * def read_text(self, char* filename): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSentPos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__getSentPos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 30; __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[12]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_loc); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_loc); __Pyx_GIVEREF(__pyx_v_loc); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 30; __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[13]; __pyx_lineno = 30; __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; @@ -30714,7 +31026,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(struct __pyx_obj_8 __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.getSentPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.getSentPos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -30723,23 +31035,23 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_8getSentPos(struct __pyx_obj_8 } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static char __pyx_doc_8_cdec_sa_11SuffixArray_10read_text[] = "Constructs suffix array using the algorithm\n of Larsson & Sadahkane (1999)"; -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static char __pyx_doc_3_sa_11SuffixArray_10read_text[] = "Constructs suffix array using the algorithm\n of Larsson & Sadahkane (1999)"; +static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_text (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_10read_text(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_10read_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -30752,7 +31064,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_11read_text(PyObject *__pyx_v_ * of Larsson & Sadahkane (1999)''' */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { int __pyx_v_V; int __pyx_v_N; int __pyx_v_i; @@ -30762,8 +31074,8 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 int __pyx_v_n; int __pyx_v_current_run; int __pyx_v_skip; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_isa = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_word_count = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_isa = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_word_count = 0; float __pyx_v_sort_start_time; float __pyx_v_start_time; PyObject *__pyx_r = NULL; @@ -30791,23 +31103,23 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * N = len(self.darray) * V = len(self.darray.id2word) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__from_text), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__from_text), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__use_sent_id), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__use_sent_id), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_DataArray)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->darray); __Pyx_DECREF(((PyObject *)__pyx_v_self->darray)); - __pyx_v_self->darray = ((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_t_2); + __pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":39 @@ -30819,7 +31131,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 */ __pyx_t_2 = ((PyObject *)__pyx_v_self->darray); __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_N = __pyx_t_3; @@ -30832,7 +31144,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 */ __pyx_t_2 = __pyx_v_self->darray->id2word; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_V = __pyx_t_3; @@ -30843,19 +31155,19 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * self.ha = IntList(initial_len=V+1) * */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->sa); __Pyx_DECREF(((PyObject *)__pyx_v_self->sa)); - __pyx_v_self->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":43 @@ -30865,19 +31177,19 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * * isa = IntList(initial_len=N) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->ha); __Pyx_DECREF(((PyObject *)__pyx_v_self->ha)); - __pyx_v_self->ha = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_2); + __pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":45 @@ -30887,16 +31199,16 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * word_count = IntList(initial_len=V+1) * */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_v_isa = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":46 @@ -30906,16 +31218,16 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * * '''Step 1: bucket sort data''' */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_V + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_word_count = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_2); + __pyx_v_word_count = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":49 @@ -30925,7 +31237,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * cdef float start_time = sort_start_time * for i from 0 <= i < N: */ - __pyx_v_sort_start_time = __pyx_f_8_cdec_sa_monitor_cpu(); + __pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":50 * '''Step 1: bucket sort data''' @@ -31147,14 +31459,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * * '''Step 2: prefix-doubling sort''' */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble((__pyx_f_8_cdec_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_kp_s_87)); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_87)); @@ -31162,7 +31474,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; __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_9)); __pyx_t_9 = 0; @@ -31195,7 +31507,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * logger.debug(" Refining, sort depth = %d", h) * i = 0 */ - __pyx_v_sort_start_time = __pyx_f_8_cdec_sa_monitor_cpu(); + __pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":83 * while self.sa.arr[0] != -N: @@ -31204,14 +31516,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * i = 0 * skip = 0 */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_88)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_88)); @@ -31219,7 +31531,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -31332,15 +31644,15 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * i = j+1 * if skip < 0: */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -31354,7 +31666,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -31410,14 +31722,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * * '''Step 3: read off suffix array from inverse suffix array''' */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyFloat_FromDouble((__pyx_f_8_cdec_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_89)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_89)); @@ -31425,7 +31737,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; @@ -31439,12 +31751,12 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * for i from 0 <= i < N: * j = isa.arr[i] */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -31485,14 +31797,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 * * def q3sort(self, int i, int j, int h, IntList isa, pad=""): */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyFloat_FromDouble((__pyx_f_8_cdec_sa_monitor_cpu() - __pyx_v_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(((PyObject *)__pyx_kp_s_92)); PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_92)); @@ -31500,7 +31812,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -31514,7 +31826,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_isa); @@ -31525,19 +31837,19 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_10read_text(struct __pyx_obj_8 } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_8_cdec_sa_11SuffixArray_12q3sort[] = "This is a ternary quicksort. It divides the array into\n three partitions: items less than the pivot, items equal\n to pivot, and items greater than pivot. The first and last\n of these partitions are then recursively sorted"; -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_3_sa_11SuffixArray_12q3sort[] = "This is a ternary quicksort. It divides the array into\n three partitions: items less than the pivot, items equal\n to pivot, and items greater than pivot. The first and last\n of these partitions are then recursively sorted"; +static PyObject *__pyx_pw_3_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_h; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_isa = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_isa = 0; PyObject *__pyx_v_pad = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("q3sort (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i,&__pyx_n_s__j,&__pyx_n_s__h,&__pyx_n_s__isa,&__pyx_n_s__pad,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)__pyx_kp_s_42); if (unlikely(__pyx_kwds)) { @@ -31555,26 +31867,22 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_sel kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 1); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__h)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 2); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isa)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, 3); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { @@ -31583,7 +31891,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_sel } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "q3sort") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "q3sort") < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -31596,22 +31904,22 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_sel default: goto __pyx_L5_argtuple_error; } } - __pyx_v_i = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_j = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_h = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_isa = ((struct __pyx_obj_8_cdec_sa_IntList *)values[3]); + __pyx_v_i = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_j = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_j == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_h = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)values[3]); __pyx_v_pad = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("q3sort", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.q3sort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.q3sort", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isa), __pyx_ptype_8_cdec_sa_IntList, 1, "isa", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_h, __pyx_v_isa, __pyx_v_pad); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isa), __pyx_ptype_3_sa_IntList, 1, "isa", 0))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_11SuffixArray_12q3sort(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_i, __pyx_v_j, __pyx_v_h, __pyx_v_isa, __pyx_v_pad); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -31628,7 +31936,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort(PyObject *__pyx_v_sel * three partitions: items less than the pivot, items equal */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_12q3sort(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_i, int __pyx_v_j, int __pyx_v_h, struct __pyx_obj_3_sa_IntList *__pyx_v_isa, PyObject *__pyx_v_pad) { int __pyx_v_k; int __pyx_v_midpoint; int __pyx_v_pval; @@ -31667,11 +31975,11 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd * if j-i == -1: # recursive base case -- empty interval * return */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __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[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __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); @@ -31679,20 +31987,20 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[13]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; @@ -32030,17 +32338,17 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd * * # update suffixes with pivot value */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyInt_FromLong((__pyx_v_phead - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_phead - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -32057,7 +32365,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; @@ -32112,17 +32420,17 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd * * */ - __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyInt_FromLong((__pyx_v_ptail + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong((__pyx_v_ptail + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_v_pad, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); @@ -32139,7 +32447,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -32154,7 +32462,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.q3sort", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.q3sort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -32163,22 +32471,22 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_12q3sort(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_text(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_text (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_14write_text(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_14write_text(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -32191,7 +32499,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_15write_text(PyObject *__pyx_v * */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_14write_text(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_text(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -32209,16 +32517,16 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_14write_text(struct __pyx_obj_ * * def read_binary(self, char* filename): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s__write_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__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[12]; __pyx_lineno = 179; __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[13]; __pyx_lineno = 179; __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; @@ -32230,7 +32538,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_14write_text(struct __pyx_obj_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -32239,22 +32547,22 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_14write_text(struct __pyx_obj_ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_17read_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_binary (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.read_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_16read_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -32267,7 +32575,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_17read_binary(PyObject *__pyx_ * f = fopen(filename, "r") */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_16read_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -32289,7 +32597,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj * self.sa.read_handle(f) * self.ha.read_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":185 * f = fopen(filename, "r") @@ -32298,7 +32606,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj * self.ha.read_handle(f) * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":186 * self.darray.read_handle(f) @@ -32307,7 +32615,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":187 * self.sa.read_handle(f) @@ -32325,22 +32633,22 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_16read_binary(struct __pyx_obj } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_19write_binary(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_binary (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.write_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_18write_binary(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -32353,7 +32661,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_19write_binary(PyObject *__pyx * f = fopen(filename, "w") */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_18write_binary(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { FILE *__pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -32375,7 +32683,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_ob * self.sa.write_handle(f) * self.ha.write_handle(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":193 * f = fopen(filename, "w") @@ -32384,7 +32692,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_ob * self.ha.write_handle(f) * fclose(f) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":194 * self.darray.write_handle(f) @@ -32393,7 +32701,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_ob * fclose(f) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":195 * self.sa.write_handle(f) @@ -32411,22 +32719,22 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_18write_binary(struct __pyx_ob } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_21write_enhanced(PyObject *__pyx_v_self, PyObject *__pyx_arg_filename) { char *__pyx_v_filename; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_enhanced (wrapper)", 0); assert(__pyx_arg_filename); { - __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_filename = PyBytes_AsString(__pyx_arg_filename); if (unlikely((!__pyx_v_filename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_20write_enhanced(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), ((char *)__pyx_v_filename)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -32439,7 +32747,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_21write_enhanced(PyObject *__p * self.darray.write_enhanced_handle(f) */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_20write_enhanced(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, char *__pyx_v_filename) { PyObject *__pyx_v_f = NULL; PyObject *__pyx_v_a_i = NULL; PyObject *__pyx_v_w_i = NULL; @@ -32471,9 +32779,9 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * for a_i in self.sa: */ /*with:*/ { - __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyBytes_FromString(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); @@ -32481,14 +32789,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__w)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -32510,14 +32818,14 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * for a_i in self.sa: * f.write("%d " % a_i) */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->darray), __pyx_n_s_24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_f); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f); __Pyx_GIVEREF(__pyx_v_f); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -32534,23 +32842,31 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ __pyx_t_2 = ((PyObject *)__pyx_v_self->sa); __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self->sa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self->sa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; } for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + else {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; } @@ -32567,16 +32883,16 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * f.write("\n") * for w_i in self.ha: */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_v_a_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; @@ -32591,9 +32907,9 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * for w_i in self.ha: * f.write("%d " % w_i) */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -32609,23 +32925,31 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ __pyx_t_4 = ((PyObject *)__pyx_v_self->ha); __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->ha)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_v_self->ha)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; } for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; + #endif } else { __pyx_t_2 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[12]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + else {__pyx_filename = __pyx_f[13]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_error;} } break; } @@ -32642,16 +32966,16 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * f.write("\n") * */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_v_w_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_10)); __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; @@ -32666,9 +32990,9 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * * cdef int __search_high(self, int word_id, int offset, int low, int high): */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -32691,12 +33015,12 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * for a_i in self.sa: */ /*except:*/ { - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_AddTraceback("_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); @@ -32709,11 +33033,11 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __pyx_t_13 = (!__pyx_t_11); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_10); @@ -32721,7 +33045,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ __Pyx_GIVEREF(__pyx_t_1); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_4, __pyx_t_1); __pyx_t_10 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} goto __pyx_L22; } __pyx_L22:; @@ -32749,11 +33073,11 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ if (__pyx_t_3) { __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_96, NULL); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } goto __pyx_L23; @@ -32770,7 +33094,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.write_enhanced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_f); @@ -32789,7 +33113,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_20write_enhanced(struct __pyx_ * */ -static int __pyx_f_8_cdec_sa_11SuffixArray___search_high(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { +static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { int __pyx_v_midpoint; int __pyx_r; __Pyx_RefNannyDeclarations @@ -32845,7 +33169,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_high(struct __pyx_obj_8_cdec * else: * return self.__search_high(word_id, offset, low, midpoint) */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); goto __pyx_L0; goto __pyx_L4; } @@ -32858,7 +33182,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_high(struct __pyx_obj_8_cdec * * cdef int __search_low(self, int word_id, int offset, int low, int high): */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); goto __pyx_L0; } __pyx_L4:; @@ -32877,7 +33201,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_high(struct __pyx_obj_8_cdec * */ -static int __pyx_f_8_cdec_sa_11SuffixArray___search_low(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { +static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { int __pyx_v_midpoint; int __pyx_r; __Pyx_RefNannyDeclarations @@ -32933,7 +33257,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_low(struct __pyx_obj_8_cdec_ * else: * return self.__search_low(word_id, offset, midpoint+1, high) */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); goto __pyx_L0; goto __pyx_L4; } @@ -32946,7 +33270,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_low(struct __pyx_obj_8_cdec_ * * cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); goto __pyx_L0; } __pyx_L4:; @@ -32965,7 +33289,7 @@ static int __pyx_f_8_cdec_sa_11SuffixArray___search_low(struct __pyx_obj_8_cdec_ * self.__search_high(word_id, offset, midpoint, high)) */ -static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___get_range(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high, int __pyx_v_midpoint) { +static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high, int __pyx_v_midpoint) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -32984,7 +33308,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___get_range(struct __pyx_obj_8_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":231 @@ -32994,9 +33318,9 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___get_range(struct __pyx_obj_8_ * * cdef __lookup_helper(self, int word_id, int offset, int low, int high): */ - __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_midpoint, __pyx_v_high)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_high(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_midpoint, __pyx_v_high)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 231; __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[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 230; __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); @@ -33014,7 +33338,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___get_range(struct __pyx_obj_8_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.__get_range", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.__get_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -33030,7 +33354,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___get_range(struct __pyx_obj_8_ * */ -static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { +static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, int __pyx_v_word_id, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { int __pyx_v_midpoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -33061,11 +33385,11 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong((__pyx_v_self->ha->arr[__pyx_v_word_id])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_self->ha->arr[__pyx_v_word_id])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong((__pyx_v_self->ha->arr[(__pyx_v_word_id + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_self->ha->arr[(__pyx_v_word_id + 1)])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 237; __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[12]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 237; __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); @@ -33132,7 +33456,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob * return self.__lookup_helper(word_id, offset, low, midpoint) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___get_range(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_high, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___get_range(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_high, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -33159,7 +33483,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob * return self.__lookup_helper(word_id, offset, midpoint+1, high) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -33176,7 +33500,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob * def lookup(self, word, int offset, int low, int high): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, (__pyx_v_midpoint + 1), __pyx_v_high); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -33190,7 +33514,7 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.__lookup_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.__lookup_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -33199,17 +33523,17 @@ static PyObject *__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper(struct __pyx_ob } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_11SuffixArray_23lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_word = 0; int __pyx_v_offset; int __pyx_v_low; int __pyx_v_high; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lookup (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__word,&__pyx_n_s__offset,&__pyx_n_s__low,&__pyx_n_s__high,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -33225,30 +33549,26 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_23lookup(PyObject *__pyx_v_sel kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__word)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -33259,19 +33579,19 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_23lookup(PyObject *__pyx_v_sel values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_word = values[0]; - __pyx_v_offset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_offset = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_11SuffixArray_22lookup(((struct __pyx_obj_8_cdec_sa_SuffixArray *)__pyx_v_self), __pyx_v_word, __pyx_v_offset, __pyx_v_low, __pyx_v_high); + __pyx_r = __pyx_pf_3_sa_11SuffixArray_22lookup(((struct __pyx_obj_3_sa_SuffixArray *)__pyx_v_self), __pyx_v_word, __pyx_v_offset, __pyx_v_low, __pyx_v_high); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33284,7 +33604,7 @@ static PyObject *__pyx_pw_8_cdec_sa_11SuffixArray_23lookup(PyObject *__pyx_v_sel * if low == -1: */ -static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { +static PyObject *__pyx_pf_3_sa_11SuffixArray_22lookup(struct __pyx_obj_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high) { PyObject *__pyx_v_word_id = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -33338,7 +33658,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd */ __pyx_t_2 = ((PyObject *)__pyx_v_self->sa); __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_high = __pyx_t_3; goto __pyx_L4; @@ -33352,7 +33672,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd * word_id = self.darray.word2id[word] * return self.__lookup_helper(word_id, offset, low, high) */ - __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->darray->word2id, __pyx_v_word))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PySequence_Contains(__pyx_v_self->darray->word2id, __pyx_v_word))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/suffix_array.pxi":256 @@ -33362,7 +33682,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd * return self.__lookup_helper(word_id, offset, low, high) * else: */ - __pyx_t_2 = PyObject_GetItem(__pyx_v_self->darray->word2id, __pyx_v_word); if (!__pyx_t_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->darray->word2id, __pyx_v_word); if (!__pyx_t_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_word_id = __pyx_t_2; __pyx_t_2 = 0; @@ -33375,8 +33695,8 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd * return None */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_t_4, __pyx_v_offset, __pyx_v_low, __pyx_v_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___lookup_helper(__pyx_v_self, __pyx_t_4, __pyx_v_offset, __pyx_v_low, __pyx_v_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -33401,7 +33721,7 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.SuffixArray.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_word_id); @@ -33411,15 +33731,15 @@ static PyObject *__pyx_pf_8_cdec_sa_11SuffixArray_22lookup(struct __pyx_obj_8_cd } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - __pyx_r = __pyx_pf_8_cdec_sa_8TrieNode___cinit__(((struct __pyx_obj_8_cdec_sa_TrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8TrieNode___cinit__(((struct __pyx_obj_3_sa_TrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33432,7 +33752,7 @@ static int __pyx_pw_8_cdec_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObj * */ -static int __pyx_pf_8_cdec_sa_8TrieNode___cinit__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self) { +static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -33460,7 +33780,7 @@ static int __pyx_pf_8_cdec_sa_8TrieNode___cinit__(struct __pyx_obj_8_cdec_sa_Tri goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.TrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -33468,12 +33788,12 @@ static int __pyx_pf_8_cdec_sa_8TrieNode___cinit__(struct __pyx_obj_8_cdec_sa_Tri } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_8TrieNode_8children___get__(((struct __pyx_obj_8_cdec_sa_TrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8TrieNode_8children___get__(((struct __pyx_obj_3_sa_TrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33486,7 +33806,7 @@ static PyObject *__pyx_pw_8_cdec_sa_8TrieNode_8children_1__get__(PyObject *__pyx * def __cinit__(self): */ -static PyObject *__pyx_pf_8_cdec_sa_8TrieNode_8children___get__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_8TrieNode_8children___get__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -33503,17 +33823,17 @@ static PyObject *__pyx_pf_8_cdec_sa_8TrieNode_8children___get__(struct __pyx_obj } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_8TrieNode_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_8TrieNode_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_8TrieNode_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_8TrieNode_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_8TrieNode_8children_2__set__(((struct __pyx_obj_8_cdec_sa_TrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_8TrieNode_8children_2__set__(((struct __pyx_obj_3_sa_TrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_8TrieNode_8children_2__set__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -33529,17 +33849,17 @@ static int __pyx_pf_8_cdec_sa_8TrieNode_8children_2__set__(struct __pyx_obj_8_cd } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_8TrieNode_8children_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_8TrieNode_8children_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_8TrieNode_8children_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_8TrieNode_8children_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_8TrieNode_8children_4__del__(((struct __pyx_obj_8_cdec_sa_TrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_8TrieNode_8children_4__del__(((struct __pyx_obj_3_sa_TrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_8TrieNode_8children_4__del__(struct __pyx_obj_8_cdec_sa_TrieNode *__pyx_v_self) { +static int __pyx_pf_3_sa_8TrieNode_8children_4__del__(struct __pyx_obj_3_sa_TrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -33555,16 +33875,16 @@ static int __pyx_pf_8_cdec_sa_8TrieNode_8children_4__del__(struct __pyx_obj_8_cd } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_phrase = 0; PyObject *__pyx_v_phrase_location = 0; PyObject *__pyx_v_suffix_link = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0}; PyObject* values[3] = {0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":29 @@ -33625,16 +33945,16 @@ static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_se __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode___cinit__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self), __pyx_v_phrase, __pyx_v_phrase_location, __pyx_v_suffix_link); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self), __pyx_v_phrase, __pyx_v_phrase_location, __pyx_v_suffix_link); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_phrase, PyObject *__pyx_v_phrase_location, PyObject *__pyx_v_suffix_link) { +static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_phrase, PyObject *__pyx_v_phrase_location, PyObject *__pyx_v_suffix_link) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); @@ -33684,12 +34004,12 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_8_cd } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase___get__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_6phrase___get__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33702,7 +34022,7 @@ static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject * cdef public suffix_link */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_6phrase___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -33719,17 +34039,17 @@ static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase___get__(struct __ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_2__set__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_2__set__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -33745,17 +34065,17 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_2__set__(struct __pyx_o } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_4__del__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_4__del__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_6phrase_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -33771,12 +34091,12 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_6phrase_4__del__(struct __pyx_o } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location___get__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location___get__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33789,7 +34109,7 @@ static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_1__get_ * */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -33806,17 +34126,17 @@ static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location___get__ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_2__set__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_2__set__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -33832,17 +34152,17 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_2__set__(stru } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_4__del__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_4__del__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_15phrase_location_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -33858,12 +34178,12 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_15phrase_location_4__del__(stru } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link___get__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link___get__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -33876,7 +34196,7 @@ static PyObject *__pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_1__get__(Py * def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): */ -static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link___get__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link___get__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -33893,17 +34213,17 @@ static PyObject *__pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link___get__(str } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_2__set__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_2__set__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_2__set__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_2__set__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -33919,17 +34239,17 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_2__set__(struct _ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_4__del__(((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(((struct __pyx_obj_3_sa_ExtendedTrieNode *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *__pyx_v_self) { +static int __pyx_pf_3_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct __pyx_obj_3_sa_ExtendedTrieNode *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -33945,14 +34265,14 @@ static int __pyx_pf_8_cdec_sa_16ExtendedTrieNode_11suffix_link_4__del__(struct _ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_extended = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__extended,0}; PyObject* values[1] = {0}; values[0] = __pyx_k_97; if (unlikely(__pyx_kwds)) { @@ -33987,11 +34307,11 @@ static int __pyx_pw_8_cdec_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyOb __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable___cinit__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self), __pyx_v_extended); + __pyx_r = __pyx_pf_3_sa_9TrieTable___cinit__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self), __pyx_v_extended); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34004,7 +34324,7 @@ static int __pyx_pw_8_cdec_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyOb * self.extended = extended */ -static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_extended) { +static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_extended) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -34051,7 +34371,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_Tr * else: * self.root = TrieNode() */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -34069,7 +34389,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_Tr * * # linked list structure for storing matches in BaselineRuleFactory */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root); @@ -34083,7 +34403,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_Tr goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -34091,12 +34411,12 @@ static int __pyx_pf_8_cdec_sa_9TrieTable___cinit__(struct __pyx_obj_8_cdec_sa_Tr } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_8extended___get__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_8extended___get__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34109,7 +34429,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_8extended_1__get__(PyObject *__py * cdef public root */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_8extended___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_9TrieTable_8extended___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -34128,7 +34448,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_8extended___get__(struct __pyx_ob goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.TrieTable.extended.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.extended.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -34137,17 +34457,17 @@ static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_8extended___get__(struct __pyx_ob } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9TrieTable_8extended_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_9TrieTable_8extended_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_9TrieTable_8extended_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_9TrieTable_8extended_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_8extended_2__set__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_8extended_2__set__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -34161,7 +34481,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_8_c __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.TrieTable.extended.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.extended.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -34169,12 +34489,12 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_8_c } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_5count___get__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_5count___get__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34187,7 +34507,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v * def __cinit__(self, extended=False): */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_5count___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_9TrieTable_5count___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -34206,7 +34526,7 @@ static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_5count___get__(struct __pyx_obj_8 goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.TrieTable.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -34215,17 +34535,17 @@ static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_5count___get__(struct __pyx_obj_8 } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9TrieTable_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_9TrieTable_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_9TrieTable_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_9TrieTable_5count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_5count_2__set__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_5count_2__set__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9TrieTable_5count_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -34239,7 +34559,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_5count_2__set__(struct __pyx_obj_8_cdec __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.TrieTable.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.TrieTable.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -34247,12 +34567,12 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_5count_2__set__(struct __pyx_obj_8_cdec } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_4root___get__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_4root___get__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34265,7 +34585,7 @@ static PyObject *__pyx_pw_8_cdec_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_ * self.count = 0 */ -static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_4root___get__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self) { +static PyObject *__pyx_pf_3_sa_9TrieTable_4root___get__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); @@ -34282,17 +34602,17 @@ static PyObject *__pyx_pf_8_cdec_sa_9TrieTable_4root___get__(struct __pyx_obj_8_ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9TrieTable_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_8_cdec_sa_9TrieTable_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pw_3_sa_9TrieTable_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_3_sa_9TrieTable_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_4root_2__set__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_4root_2__set__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9TrieTable_4root_2__set__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { +static int __pyx_pf_3_sa_9TrieTable_4root_2__set__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); @@ -34308,17 +34628,17 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_4root_2__set__(struct __pyx_obj_8_cdec_ } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_9TrieTable_4root_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_8_cdec_sa_9TrieTable_4root_5__del__(PyObject *__pyx_v_self) { +static int __pyx_pw_3_sa_9TrieTable_4root_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_3_sa_9TrieTable_4root_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_9TrieTable_4root_4__del__(((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_9TrieTable_4root_4__del__(((struct __pyx_obj_3_sa_TrieTable *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_8_cdec_sa_9TrieTable_4root_4__del__(struct __pyx_obj_8_cdec_sa_TrieTable *__pyx_v_self) { +static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); @@ -34341,7 +34661,7 @@ static int __pyx_pf_8_cdec_sa_9TrieTable_4root_4__del__(struct __pyx_obj_8_cdec_ * */ -static int __pyx_f_8_cdec_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_self, CYTHON_UNUSED int __pyx_v_sent_id) { +static int __pyx_f_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_self, CYTHON_UNUSED int __pyx_v_sent_id) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("contains", 0); @@ -34363,19 +34683,19 @@ static int __pyx_f_8_cdec_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __py } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sa_low; int __pyx_v_sa_high; int __pyx_v_arr_low; int __pyx_v_arr_high; PyObject *__pyx_v_arr = 0; int __pyx_v_num_subpatterns; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":69 @@ -34435,26 +34755,6 @@ static int __pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[0]) { - } else { - __pyx_v_sa_low = ((int)-1); - } - if (values[1]) { - } else { - __pyx_v_sa_high = ((int)-1); - } - if (values[2]) { - } else { - __pyx_v_arr_low = ((int)-1); - } - if (values[3]) { - } else { - __pyx_v_arr_high = ((int)-1); - } - if (values[5]) { - } else { - __pyx_v_num_subpatterns = ((int)1); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); @@ -34498,11 +34798,11 @@ static int __pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_v_self), __pyx_v_sa_low, __pyx_v_sa_high, __pyx_v_arr_low, __pyx_v_arr_high, __pyx_v_arr, __pyx_v_num_subpatterns); + __pyx_r = __pyx_pf_3_sa_14PhraseLocation___cinit__(((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_v_self), __pyx_v_sa_low, __pyx_v_sa_high, __pyx_v_arr_low, __pyx_v_arr_high, __pyx_v_arr, __pyx_v_num_subpatterns); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -34515,7 +34815,7 @@ static int __pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self * self.sa_low = sa_low */ -static int __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_self, int __pyx_v_sa_low, int __pyx_v_sa_high, int __pyx_v_arr_low, int __pyx_v_arr_high, PyObject *__pyx_v_arr, int __pyx_v_num_subpatterns) { +static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_self, int __pyx_v_sa_low, int __pyx_v_sa_high, int __pyx_v_arr_low, int __pyx_v_arr_high, PyObject *__pyx_v_arr, int __pyx_v_num_subpatterns) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -34566,12 +34866,12 @@ static int __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(struct __pyx_obj_8_cdec * self.num_subpatterns = num_subpatterns * */ - if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); __Pyx_GOTREF(__pyx_v_self->arr); __Pyx_DECREF(((PyObject *)__pyx_v_self->arr)); - __pyx_v_self->arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_v_arr); + __pyx_v_self->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":75 * self.arr_high = arr_high @@ -34585,7 +34885,7 @@ static int __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(struct __pyx_obj_8_cdec __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -34593,15 +34893,15 @@ static int __pyx_pf_8_cdec_sa_14PhraseLocation___cinit__(struct __pyx_obj_8_cdec } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sample_size; - struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; + struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sample_size,&__pyx_n_s__fsarray,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -34615,12 +34915,10 @@ static int __pyx_pw_8_cdec_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -34635,18 +34933,18 @@ static int __pyx_pw_8_cdec_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObje values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_sample_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sample_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_fsarray = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)values[1]); + __pyx_v_fsarray = ((struct __pyx_obj_3_sa_SuffixArray *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_8_cdec_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_7Sampler___cinit__(((struct __pyx_obj_8_cdec_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_7Sampler___cinit__(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray); goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -34663,7 +34961,7 @@ static int __pyx_pw_8_cdec_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObje * self.sa = fsarray.sa */ -static int __pyx_pf_8_cdec_sa_7Sampler___cinit__(struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray) { +static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx_v_self, int __pyx_v_sample_size, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -34763,7 +35061,7 @@ static int __pyx_pf_8_cdec_sa_7Sampler___cinit__(struct __pyx_obj_8_cdec_sa_Samp __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -34771,14 +35069,14 @@ static int __pyx_pf_8_cdec_sa_7Sampler___cinit__(struct __pyx_obj_8_cdec_sa_Samp } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase_location); /*proto*/ -static char __pyx_doc_8_cdec_sa_7Sampler_2sample[] = "Returns a sample of the locations for\n the phrase. If there are less than self.sample_size\n locations, return all of them; otherwise, return\n up to self.sample_size locations. In the latter case,\n we choose to sample UNIFORMLY -- that is, the locations\n are chosen at uniform intervals over the entire set, rather\n than randomly. This makes the algorithm deterministic, which\n is good for things like MERT"; -static PyObject *__pyx_pw_8_cdec_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase_location) { +static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase_location); /*proto*/ +static char __pyx_doc_3_sa_7Sampler_2sample[] = "Returns a sample of the locations for\n the phrase. If there are less than self.sample_size\n locations, return all of them; otherwise, return\n up to self.sample_size locations. In the latter case,\n we choose to sample UNIFORMLY -- that is, the locations\n are chosen at uniform intervals over the entire set, rather\n than randomly. This makes the algorithm deterministic, which\n is good for things like MERT"; +static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase_location) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sample (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_8_cdec_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_7Sampler_2sample(((struct __pyx_obj_8_cdec_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_v_phrase_location)); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_7Sampler_2sample(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_v_phrase_location)); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -34795,8 +35093,8 @@ static PyObject *__pyx_pw_8_cdec_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyO * the phrase. If there are less than self.sample_size */ -static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_self, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_phrase_location) { - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_sample = 0; +static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *__pyx_v_self, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_phrase_location) { + struct __pyx_obj_3_sa_IntList *__pyx_v_sample = 0; double __pyx_v_i; double __pyx_v_stepsize; int __pyx_v_num_locations; @@ -34821,9 +35119,9 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ * if phrase_location.arr is None: * num_locations = phrase_location.sa_high - phrase_location.sa_low */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sample = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":108 @@ -34868,7 +35166,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ * else: * stepsize = float(num_locations)/float(self.sample_size) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_self->sa->arr + __pyx_v_phrase_location->sa_low), __pyx_v_num_locations); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_self->sa->arr + __pyx_v_phrase_location->sa_low), __pyx_v_num_locations); goto __pyx_L4; } /*else*/ { @@ -34952,7 +35250,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ * i = i + stepsize * else: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val])); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":123 * val = int(floor(i)) @@ -35105,7 +35403,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ * i = i + stepsize * return sample */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":140 * j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) @@ -35137,7 +35435,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("_cdec_sa.Sampler.sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.Sampler.sample", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sample); @@ -35154,7 +35452,7 @@ static PyObject *__pyx_pf_8_cdec_sa_7Sampler_2sample(struct __pyx_obj_8_cdec_sa_ * m.start = start */ -static void __pyx_f_8_cdec_sa_assign_matching(struct __pyx_t_8_cdec_sa_Matching *__pyx_v_m, int *__pyx_v_arr, int __pyx_v_start, int __pyx_v_step, int *__pyx_v_sent_id_arr) { +static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m, int *__pyx_v_arr, int __pyx_v_start, int __pyx_v_step, int *__pyx_v_sent_id_arr) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assign_matching", 0); @@ -35214,7 +35512,7 @@ static void __pyx_f_8_cdec_sa_assign_matching(struct __pyx_t_8_cdec_sa_Matching * cdef int i, new_len */ -static int *__pyx_f_8_cdec_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc1, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc2, CYTHON_UNUSED int __pyx_v_offset_by_one, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { +static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx_t_3_sa_Matching *__pyx_v_loc1, struct __pyx_t_3_sa_Matching *__pyx_v_loc2, CYTHON_UNUSED int __pyx_v_offset_by_one, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { int __pyx_v_i; int __pyx_v_new_len; int *__pyx_r; @@ -35316,7 +35614,7 @@ static int *__pyx_f_8_cdec_sa_append_combined_matching(int *__pyx_v_arr, struct * */ -static int *__pyx_f_8_cdec_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int *__pyx_v_appendix, int __pyx_v_appendix_len) { +static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int *__pyx_v_appendix, int __pyx_v_appendix_len) { int __pyx_v_new_len; int *__pyx_r; __Pyx_RefNannyDeclarations @@ -35382,7 +35680,7 @@ static int *__pyx_f_8_cdec_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, * */ -static int __pyx_f_8_cdec_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_step) { +static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_step) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -35413,7 +35711,7 @@ static int __pyx_f_8_cdec_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("_cdec_sa.median", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.median", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -35428,7 +35726,7 @@ static int __pyx_f_8_cdec_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx * # in which all matchings have the same first index as the one */ -static void __pyx_f_8_cdec_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_high, int *__pyx_v_arr, int __pyx_v_step, int __pyx_v_loc, int *__pyx_v_loc_minus, int *__pyx_v_loc_plus) { +static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_high, int *__pyx_v_arr, int __pyx_v_step, int __pyx_v_loc, int *__pyx_v_loc_minus, int *__pyx_v_loc_plus) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; @@ -35511,9 +35809,9 @@ static void __pyx_f_8_cdec_sa_find_comparable_matchings(int __pyx_v_low, int __p } /* Python wrapper */ -static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_alignment = 0; +static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_3_sa_Alignment *__pyx_v_alignment = 0; float __pyx_v_by_slack_factor; char *__pyx_v_category; PyObject *__pyx_v_max_chunks = 0; @@ -35534,11 +35832,11 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p int __pyx_v_use_baeza_yates; int __pyx_v_use_collocations; int __pyx_v_use_index; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_68,&__pyx_n_s__precompute_rank,&__pyx_n_s_101,&__pyx_n_s_102,&__pyx_n_s_69,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0}; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_68,&__pyx_n_s__precompute_rank,&__pyx_n_s_101,&__pyx_n_s_102,&__pyx_n_s_69,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0}; PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":257 @@ -35607,8 +35905,7 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { @@ -35714,126 +36011,6 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - if (values[1]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":253 - * Alignment alignment, - * # parameter for double-binary search; doesn't seem to matter much - * float by_slack_factor=1.0, # <<<<<<<<<<<<<< - * # name of generic nonterminal used by Hiero - * char* category="[X]", - */ - __pyx_v_by_slack_factor = ((float)1.0); - } - if (values[2]) { - } else { - __pyx_v_category = ((char *)__pyx_k_103); - } - if (values[4]) { - } else { - __pyx_v_max_initial_size = ((unsigned int)10); - } - if (values[5]) { - } else { - __pyx_v_max_length = ((unsigned int)5); - } - if (values[6]) { - } else { - __pyx_v_max_nonterminals = ((unsigned int)2); - } - if (values[9]) { - } else { - __pyx_v_min_gap_size = ((unsigned int)2); - } - if (values[11]) { - } else { - __pyx_v_precompute_secondary_rank = ((unsigned int)20); - } - if (values[12]) { - } else { - __pyx_v_precompute_rank = ((unsigned int)100); - } - if (values[13]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":277 - * unsigned precompute_rank=100, - * # require extracted rules to have at least one aligned word - * bint require_aligned_terminal=True, # <<<<<<<<<<<<<< - * # require each contiguous chunk of extracted rules to have at least one aligned word - * bint require_aligned_chunks=False, - */ - __pyx_v_require_aligned_terminal = ((int)1); - } - if (values[14]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":279 - * bint require_aligned_terminal=True, - * # require each contiguous chunk of extracted rules to have at least one aligned word - * bint require_aligned_chunks=False, # <<<<<<<<<<<<<< - * # maximum span of a grammar rule extracted from TRAINING DATA - * unsigned train_max_initial_size=10, - */ - __pyx_v_require_aligned_chunks = ((int)0); - } - if (values[15]) { - } else { - __pyx_v_train_max_initial_size = ((unsigned int)10); - } - if (values[16]) { - } else { - __pyx_v_train_min_gap_size = ((unsigned int)2); - } - if (values[17]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":285 - * unsigned train_min_gap_size=2, - * # True if phrases should be tight, False otherwise (False == slower but better results) - * bint tight_phrases=False, # <<<<<<<<<<<<<< - * # True to require use of double-binary alg, false otherwise - * bint use_baeza_yates=True, - */ - __pyx_v_tight_phrases = ((int)0); - } - if (values[18]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":287 - * bint tight_phrases=False, - * # True to require use of double-binary alg, false otherwise - * bint use_baeza_yates=True, # <<<<<<<<<<<<<< - * # True to enable used of precomputed collocations - * bint use_collocations=True, - */ - __pyx_v_use_baeza_yates = ((int)1); - } - if (values[19]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":289 - * bint use_baeza_yates=True, - * # True to enable used of precomputed collocations - * bint use_collocations=True, # <<<<<<<<<<<<<< - * # True to enable use of precomputed inverted indices - * bint use_index=True): - */ - __pyx_v_use_collocations = ((int)1); - } - if (values[20]) { - } else { - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":291 - * bint use_collocations=True, - * # True to enable use of precomputed inverted indices - * bint use_index=True): # <<<<<<<<<<<<<< - * '''Note: we make a distinction between the min_gap_size - * and max_initial_size used in test and train. The latter - */ - __pyx_v_use_index = ((int)1); - } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); @@ -35861,7 +36038,7 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p default: goto __pyx_L5_argtuple_error; } } - __pyx_v_alignment = ((struct __pyx_obj_8_cdec_sa_Alignment *)values[0]); + __pyx_v_alignment = ((struct __pyx_obj_3_sa_Alignment *)values[0]); if (values[1]) { __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -36007,12 +36184,12 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_8_cdec_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index); goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; @@ -36029,7 +36206,7 @@ static int __pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__p * Alignment alignment, */ -static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Alignment *__pyx_v_alignment, float __pyx_v_by_slack_factor, char *__pyx_v_category, PyObject *__pyx_v_max_chunks, unsigned int __pyx_v_max_initial_size, unsigned int __pyx_v_max_length, unsigned int __pyx_v_max_nonterminals, PyObject *__pyx_v_max_target_chunks, PyObject *__pyx_v_max_target_length, unsigned int __pyx_v_min_gap_size, PyObject *__pyx_v_precompute_file, unsigned int __pyx_v_precompute_secondary_rank, unsigned int __pyx_v_precompute_rank, int __pyx_v_require_aligned_terminal, int __pyx_v_require_aligned_chunks, unsigned int __pyx_v_train_max_initial_size, unsigned int __pyx_v_train_min_gap_size, int __pyx_v_tight_phrases, int __pyx_v_use_baeza_yates, int __pyx_v_use_collocations, int __pyx_v_use_index) { +static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_Alignment *__pyx_v_alignment, float __pyx_v_by_slack_factor, char *__pyx_v_category, PyObject *__pyx_v_max_chunks, unsigned int __pyx_v_max_initial_size, unsigned int __pyx_v_max_length, unsigned int __pyx_v_max_nonterminals, PyObject *__pyx_v_max_target_chunks, PyObject *__pyx_v_max_target_length, unsigned int __pyx_v_min_gap_size, PyObject *__pyx_v_precompute_file, unsigned int __pyx_v_precompute_secondary_rank, unsigned int __pyx_v_precompute_rank, int __pyx_v_require_aligned_terminal, int __pyx_v_require_aligned_chunks, unsigned int __pyx_v_train_max_initial_size, unsigned int __pyx_v_train_min_gap_size, int __pyx_v_tight_phrases, int __pyx_v_use_baeza_yates, int __pyx_v_use_collocations, int __pyx_v_use_index) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -36057,13 +36234,13 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->rules); __Pyx_DECREF(((PyObject *)__pyx_v_self->rules)); - __pyx_v_self->rules = ((struct __pyx_obj_8_cdec_sa_TrieTable *)__pyx_t_1); + __pyx_v_self->rules = ((struct __pyx_obj_3_sa_TrieTable *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":298 @@ -36075,11 +36252,11 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); @@ -36558,13 +36735,13 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->findexes); __Pyx_DECREF(((PyObject *)__pyx_v_self->findexes)); - __pyx_v_self->findexes = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_5); + __pyx_v_self->findexes = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5); __pyx_t_5 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":360 @@ -36577,13 +36754,13 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->findexes1); __Pyx_DECREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_v_self->findexes1 = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_4); + __pyx_v_self->findexes1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_4); __pyx_t_4 = 0; __pyx_r = 0; @@ -36593,7 +36770,7 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -36601,17 +36778,17 @@ static int __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_o } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_8_cdec_sa_23HieroCachingRuleFactory_2configure[] = "This gives the RuleFactory access to the Context object.\n Here we also use it to precompute the most expensive intersections\n in the corpus quickly."; -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray = 0; - struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_edarray = 0; - struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_sampler = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,0}; +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_3_sa_23HieroCachingRuleFactory_2configure[] = "This gives the RuleFactory access to the Context object.\n Here we also use it to precompute the most expensive intersections\n in the corpus quickly."; +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray = 0; + struct __pyx_obj_3_sa_DataArray *__pyx_v_edarray = 0; + struct __pyx_obj_3_sa_Sampler *__pyx_v_sampler = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("configure (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__edarray,&__pyx_n_s__sampler,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -36626,18 +36803,15 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure(PyObjec kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("configure", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("configure", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -36652,22 +36826,22 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure(PyObjec values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_fsarray = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)values[0]); - __pyx_v_edarray = ((struct __pyx_obj_8_cdec_sa_DataArray *)values[1]); - __pyx_v_sampler = ((struct __pyx_obj_8_cdec_sa_Sampler *)values[2]); + __pyx_v_fsarray = ((struct __pyx_obj_3_sa_SuffixArray *)values[0]); + __pyx_v_edarray = ((struct __pyx_obj_3_sa_DataArray *)values[1]); + __pyx_v_sampler = ((struct __pyx_obj_3_sa_Sampler *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("configure", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_8_cdec_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_8_cdec_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_8_cdec_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -36684,7 +36858,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure(PyObjec * Here we also use it to precompute the most expensive intersections */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_8_cdec_sa_Sampler *__pyx_v_sampler) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_SuffixArray *__pyx_v_fsarray, struct __pyx_obj_3_sa_DataArray *__pyx_v_edarray, struct __pyx_obj_3_sa_Sampler *__pyx_v_sampler) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -36742,14 +36916,14 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct */ __pyx_t_1 = ((PyObject *)__pyx_v_self->fda); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->fid2symid); __Pyx_DECREF(((PyObject *)__pyx_v_self->fid2symid)); - __pyx_v_self->fid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_2); + __pyx_v_self->fid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":370 @@ -36761,14 +36935,14 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct */ __pyx_t_2 = ((PyObject *)__pyx_v_self->eda); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->eid2symid); __Pyx_DECREF(((PyObject *)__pyx_v_self->eid2symid)); - __pyx_v_self->eid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_self->eid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":371 @@ -36803,7 +36977,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -36819,11 +36993,11 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_2configure(struct * cdef IntList idmap */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_DataArray *__pyx_v_darray) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_DataArray *__pyx_v_darray) { int __pyx_v_word_id; int __pyx_v_new_word_id; int __pyx_v_N; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_idmap = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_idmap = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -36864,10 +37038,10 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UN __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_idmap = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_v_idmap = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":380 @@ -36938,7 +37112,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UN __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.set_idmap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.set_idmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_idmap); @@ -36948,12 +37122,12 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UN } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pattern2phrase (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -36966,7 +37140,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_5pattern2phrase(Py * result = () */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_arity = NULL; PyObject *__pyx_v_word_id = NULL; @@ -37025,10 +37199,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(st for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -37078,7 +37260,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(st * new_id = sym_fromstring(self.fda.id2word[word_id], True) */ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_new_id); __pyx_v_new_id = __pyx_t_4; @@ -37152,7 +37334,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(st __Pyx_INCREF(((PyObject *)__pyx_v_result)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_r = __pyx_t_9; @@ -37167,7 +37349,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(st __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.pattern2phrase", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.pattern2phrase", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -37180,12 +37362,12 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_4pattern2phrase(st } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(PyObject *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pattern2phrase_plus (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_pattern)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37198,7 +37380,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_7pattern2phrase_pl * # suffixed/prefixed with the NT category. */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_pattern) { PyObject *__pyx_v_patterns = NULL; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_arity = NULL; @@ -37271,10 +37453,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -37324,7 +37514,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl * new_id = sym_fromstring(self.fda.id2word[word_id], True) */ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_new_id); __pyx_v_new_id = __pyx_t_4; @@ -37397,7 +37587,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl __Pyx_INCREF(((PyObject *)__pyx_v_result)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result)); __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_10 = PyList_Append(__pyx_v_patterns, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -37410,7 +37600,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl * patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) * return patterns */ - __pyx_t_9 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -37425,7 +37615,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_10 = PyList_Append(__pyx_v_patterns, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -37438,7 +37628,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl * return patterns * */ - __pyx_t_9 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -37453,7 +37643,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_10 = PyList_Append(__pyx_v_patterns, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -37479,7 +37669,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.pattern2phrase_plus", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.pattern2phrase_plus", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_patterns); @@ -37493,12 +37683,12 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_6pattern2phrase_pl } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("precompute (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self)); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -37511,8 +37701,8 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_9precompute(PyObje * */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self) { - struct __pyx_obj_8_cdec_sa_Precomputation *__pyx_v_pre = 0; +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self) { + struct __pyx_obj_3_sa_Precomputation *__pyx_v_pre = 0; PyObject *__pyx_v_start_time = NULL; PyObject *__pyx_v_pattern = NULL; PyObject *__pyx_v_arr = NULL; @@ -37527,9 +37717,9 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; @@ -37554,7 +37744,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * logger.info("Reading precomputed data from file %s... ", self.precompute_file) * pre = Precomputation(from_binary=self.precompute_file) */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_8_cdec_sa_monitor_cpu()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_start_time = __pyx_t_2; __pyx_t_2 = 0; @@ -37595,10 +37785,10 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_v_pre = ((struct __pyx_obj_8_cdec_sa_Precomputation *)__pyx_t_2); + __pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_2); __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":425 @@ -37835,86 +38025,28 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * phrases = self.pattern2phrase_plus(pattern) * for phrase in phrases: */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_index, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; + __pyx_t_6 = 0; + if (unlikely(__pyx_v_pre->precomputed_index == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; - } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; - } else { - __pyx_t_2 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L12_unpacking_done; - __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L12_unpacking_done:; - } + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_4, NULL, __pyx_t_8); + if (unlikely(__pyx_t_9 == 0)) break; + if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_pattern = __pyx_t_2; + __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_4; + __pyx_t_4 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":436 * logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) @@ -37923,20 +38055,20 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * for phrase in phrases: * self.precomputed_index[phrase] = arr */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_pattern); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern); __Pyx_GIVEREF(__pyx_v_pattern); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_v_phrases); - __pyx_v_phrases = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_phrases = __pyx_t_3; + __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":437 * for pattern, arr in pre.precomputed_index.iteritems(): @@ -37946,34 +38078,42 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * if self.use_collocations: */ if (PyList_CheckExact(__pyx_v_phrases) || PyTuple_CheckExact(__pyx_v_phrases)) { - __pyx_t_4 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; + __pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; } for (;;) { - if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; - } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_3 = __pyx_t_11(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_11(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF(__pyx_v_phrase); - __pyx_v_phrase = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_phrase = __pyx_t_2; + __pyx_t_2 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":438 * phrases = self.pattern2phrase_plus(pattern) @@ -37984,7 +38124,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct */ if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8; @@ -38009,27 +38149,27 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_v_pre->precomputed_collocations; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_112)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_112)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_112)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_112)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":441 @@ -38039,86 +38179,28 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * phrase = self.pattern2phrase(pattern) * self.precomputed_collocations[phrase] = arr */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_pre->precomputed_collocations, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; + __pyx_t_7 = 0; + if (unlikely(__pyx_v_pre->precomputed_collocations == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_5); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L19_unpacking_done; - __pyx_L18_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L19_unpacking_done:; - } + __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __pyx_t_5 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_8); + if (unlikely(__pyx_t_9 == 0)) break; + if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_v_pattern); - __pyx_v_pattern = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_2; + __pyx_v_pattern = __pyx_t_2; __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_v_arr); + __pyx_v_arr = __pyx_t_3; + __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":442 * logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) @@ -38152,9 +38234,9 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L15; + goto __pyx_L13; } - __pyx_L15:; + __pyx_L13:; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":444 * phrase = self.pattern2phrase(pattern) @@ -38163,7 +38245,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct * logger.info("Processing precomputations took %f seconds", stop_time - start_time) * */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_f_8_cdec_sa_monitor_cpu()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_stop_time = __pyx_t_5; __pyx_t_5 = 0; @@ -38206,8 +38288,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pre); @@ -38223,12 +38304,12 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_8precompute(struct } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation(PyObject *__pyx_v_self, PyObject *__pyx_v_phrase) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_precomputed_collocation (wrapper)", 0); - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_phrase)); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_phrase)); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -38241,7 +38322,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_11get_precomputed_ * arr = self.precomputed_collocations[phrase] */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_phrase) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collocation(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_phrase) { PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -38304,7 +38385,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; @@ -38332,7 +38413,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.get_precomputed_collocation", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_precomputed_collocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_arr); @@ -38349,7 +38430,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_10get_precomputed_ * int offset_by_one, int len_last, int num_subpatterns, int* result_len): */ -static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_low1, int __pyx_v_high1, int *__pyx_v_arr1, int __pyx_v_step1, int __pyx_v_low2, int __pyx_v_high2, int *__pyx_v_arr2, int __pyx_v_step2, int __pyx_v_offset_by_one, int __pyx_v_len_last, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { +static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_low1, int __pyx_v_high1, int *__pyx_v_arr1, int __pyx_v_step1, int __pyx_v_low2, int __pyx_v_high2, int *__pyx_v_arr2, int __pyx_v_step2, int __pyx_v_offset_by_one, int __pyx_v_len_last, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { int __pyx_v_i1; int __pyx_v_i2; int __pyx_v_med1; @@ -38372,8 +38453,8 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc int *__pyx_v_low_result; int *__pyx_v_med_result; int *__pyx_v_high_result; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_loc1; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_loc2; + struct __pyx_t_3_sa_Matching __pyx_v_loc1; + struct __pyx_t_3_sa_Matching __pyx_v_loc2; int *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -38463,7 +38544,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":481 * # Case 2: sets are non-overlapping @@ -38472,7 +38553,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: * return result */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":482 * assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) @@ -38481,7 +38562,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * return result * */ - __pyx_t_3 = (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1); + __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":483 @@ -38504,7 +38585,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":486 * @@ -38513,7 +38594,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * return result */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":487 * assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) @@ -38522,7 +38603,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * return result * */ - __pyx_t_3 = (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); + __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":488 @@ -38645,7 +38726,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * * # binary search. There are two flavors, depending on */ - __pyx_r = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->merge_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, __pyx_v_result_len); + __pyx_r = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->merge_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, __pyx_v_result_len); goto __pyx_L0; goto __pyx_L8; } @@ -38667,7 +38748,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * */ - __pyx_v_med2 = __pyx_f_8_cdec_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); + __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":507 * if d_first: @@ -38676,7 +38757,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * * search_low = low1 */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":509 * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) @@ -38714,7 +38795,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) */ - __pyx_v_med1 = __pyx_f_8_cdec_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); + __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":513 * while search_low < search_high: @@ -38723,7 +38804,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: */ - __pyx_f_8_cdec_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); + __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":514 * med1 = median(search_low, search_high, step1) @@ -38732,7 +38813,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if comparison == -1: * search_low = med1_plus */ - __pyx_v_comparison = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); + __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":517 * if comparison == -1: @@ -38805,7 +38886,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) * */ - __pyx_v_med1 = __pyx_f_8_cdec_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); + __pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":523 * else: @@ -38814,7 +38895,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * * search_low = low2 */ - __pyx_f_8_cdec_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); + __pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":525 * find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) @@ -38852,7 +38933,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) */ - __pyx_v_med2 = __pyx_f_8_cdec_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); + __pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":529 * while search_low < search_high: @@ -38861,7 +38942,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) * if comparison == -1: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":530 * med2 = median(search_low, search_high, step2) @@ -38870,7 +38951,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if comparison == -1: * search_high = med2 */ - __pyx_v_comparison = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); + __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":533 * if comparison == -1: @@ -39008,7 +39089,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * while med2_minus-step2 >= low2: * assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":551 * while i1 < med1_plus: @@ -39028,7 +39109,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: * med2_minus = med2_minus - step2 */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":553 * while med2_minus-step2 >= low2: @@ -39037,7 +39118,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * med2_minus = med2_minus - step2 * else: */ - __pyx_t_3 = (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1); + __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":554 @@ -39092,7 +39173,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":560 * while i2 < high2: @@ -39101,7 +39182,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if comparison == 0: * pass */ - __pyx_v_comparison = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); + __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":561 * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) @@ -39120,7 +39201,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * if comparison == -1: * break */ - __pyx_v_med_result = __pyx_f_8_cdec_sa_append_combined_matching(__pyx_v_med_result, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_num_subpatterns, (&__pyx_v_med_result_len)); + __pyx_v_med_result = __pyx_f_3_sa_append_combined_matching(__pyx_v_med_result, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_num_subpatterns, (&__pyx_v_med_result_len)); goto __pyx_L22; } __pyx_L22:; @@ -39381,7 +39462,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * high_result_len = 0 * high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len) */ - __pyx_v_low_result = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len)); + __pyx_v_low_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":594 * low_result_len = 0 @@ -39399,7 +39480,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * * result = extend_arr(result, result_len, low_result, low_result_len) */ - __pyx_v_high_result = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len)); + __pyx_v_high_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len)); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":597 * high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len) @@ -39408,7 +39489,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * result = extend_arr(result, result_len, med_result, med_result_len) * result = extend_arr(result, result_len, high_result, high_result_len) */ - __pyx_v_result = __pyx_f_8_cdec_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); + __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":598 * @@ -39417,7 +39498,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * result = extend_arr(result, result_len, high_result, high_result_len) * free(low_result) */ - __pyx_v_result = __pyx_f_8_cdec_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); + __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":599 * result = extend_arr(result, result_len, low_result, low_result_len) @@ -39426,7 +39507,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * free(low_result) * free(med_result) */ - __pyx_v_result = __pyx_f_8_cdec_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); + __pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":600 * result = extend_arr(result, result_len, med_result, med_result_len) @@ -39468,7 +39549,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("_cdec_sa.HieroCachingRuleFactory.baeza_yates_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.HieroCachingRuleFactory.baeza_yates_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -39483,12 +39564,12 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper(struc * """ */ -static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_i1_minus, int __pyx_v_i1_plus, int *__pyx_v_arr1, int __pyx_v_step1, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc2, int __pyx_v_offset_by_one, int __pyx_v_len_last) { +static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_i1_minus, int __pyx_v_i1_plus, int *__pyx_v_arr1, int __pyx_v_step1, struct __pyx_t_3_sa_Matching *__pyx_v_loc2, int __pyx_v_offset_by_one, int __pyx_v_len_last) { int __pyx_v_i1; int __pyx_v_comparison; int __pyx_v_prev_comparison; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_l1_stack; - struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc1; + struct __pyx_t_3_sa_Matching __pyx_v_l1_stack; + struct __pyx_t_3_sa_Matching *__pyx_v_loc1; long __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -39530,7 +39611,7 @@ static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings_set(st * comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) * if comparison == 0: */ - __pyx_f_8_cdec_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":624 * while i1 < i1_plus: @@ -39539,7 +39620,7 @@ static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings_set(st * if comparison == 0: * prev_comparison = 0 */ - __pyx_v_comparison = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last); + __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":625 * assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) @@ -39661,7 +39742,7 @@ static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings_set(st * */ -static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc1, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_loc2, int __pyx_v_offset_by_one, int __pyx_v_len_last) { +static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_t_3_sa_Matching *__pyx_v_loc1, struct __pyx_t_3_sa_Matching *__pyx_v_loc2, int __pyx_v_offset_by_one, int __pyx_v_len_last) { int __pyx_v_i; long __pyx_r; __Pyx_RefNannyDeclarations @@ -39979,15 +40060,15 @@ static long __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings(struct * int offset_by_one, int len_last, int num_subpatterns, int* result_len): */ -static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_low1, int __pyx_v_high1, int *__pyx_v_arr1, int __pyx_v_step1, int __pyx_v_low2, int __pyx_v_high2, int *__pyx_v_arr2, int __pyx_v_step2, int __pyx_v_offset_by_one, int __pyx_v_len_last, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { +static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_low1, int __pyx_v_high1, int *__pyx_v_arr1, int __pyx_v_step1, int __pyx_v_low2, int __pyx_v_high2, int *__pyx_v_arr2, int __pyx_v_step2, int __pyx_v_offset_by_one, int __pyx_v_len_last, int __pyx_v_num_subpatterns, int *__pyx_v_result_len) { int __pyx_v_i1; int __pyx_v_i2; int __pyx_v_j1; int __pyx_v_j2; long __pyx_v_comparison; int *__pyx_v_result; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_loc1; - struct __pyx_t_8_cdec_sa_Matching __pyx_v_loc2; + struct __pyx_t_3_sa_Matching __pyx_v_loc1; + struct __pyx_t_3_sa_Matching __pyx_v_loc2; int *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -40055,7 +40136,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * while i2 < high2: * assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":691 * # First, pop all unneeded loc2's off the stack @@ -40075,7 +40156,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: * i2 = i2 + step2 */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":693 * while i2 < high2: @@ -40084,7 +40165,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * i2 = i2 + step2 * else: */ - __pyx_t_3 = (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); + __pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1); if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":694 @@ -40145,7 +40226,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * j2 = i2 * while j2 < high2: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":702 * while i1 < high1 and arr1[j1] == arr1[i1]: @@ -40174,7 +40255,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) * if comparison == 0: */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":705 * while j2 < high2: @@ -40183,7 +40264,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * if comparison == 0: * result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) */ - __pyx_v_comparison = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); + __pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":706 * assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) @@ -40202,7 +40283,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * if comparison == 1: * pass */ - __pyx_v_result = __pyx_f_8_cdec_sa_append_combined_matching(__pyx_v_result, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_num_subpatterns, __pyx_v_result_len); + __pyx_v_result = __pyx_f_3_sa_append_combined_matching(__pyx_v_result, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_num_subpatterns, __pyx_v_result_len); goto __pyx_L12; } __pyx_L12:; @@ -40290,10 +40371,10 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper(struct __py * cdef VEB veb */ -static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_loc, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_phrase) { +static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_IntList *__pyx_v_arr, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_loc, struct __pyx_obj_3_sa_Phrase *__pyx_v_phrase) { int __pyx_v_i; int __pyx_v_j; - struct __pyx_obj_8_cdec_sa_VEB *__pyx_v_veb = 0; + struct __pyx_obj_3_sa_VEB *__pyx_v_veb = 0; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; @@ -40323,11 +40404,11 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ */ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); - __pyx_v_loc->arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_2); + __pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3; } @@ -40346,13 +40427,13 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_loc->arr); __Pyx_DECREF(((PyObject *)__pyx_v_loc->arr)); - __pyx_v_loc->arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":727 @@ -40369,10 +40450,10 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_v_veb = ((struct __pyx_obj_8_cdec_sa_VEB *)__pyx_t_3); + __pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":728 @@ -40392,7 +40473,7 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ * i = veb.veb.min_val * for j from 0 <= j < loc.sa_high-loc.sa_low: */ - ((struct __pyx_vtabstruct_8_cdec_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); + ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i])); } /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":730 @@ -40430,7 +40511,7 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ * loc.arr_low = 0 * loc.arr_high = loc.arr.len */ - __pyx_v_i = ((struct __pyx_vtabstruct_8_cdec_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_v_veb, __pyx_v_i); + __pyx_v_i = ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_v_veb, __pyx_v_i); } } __pyx_L3:; @@ -40457,7 +40538,7 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("_cdec_sa.HieroCachingRuleFactory.sort_phrase_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.HieroCachingRuleFactory.sort_phrase_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_veb); __Pyx_RefNannyFinishContext(); @@ -40471,10 +40552,10 @@ static void __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct _ * */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_prefix, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_suffix, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_prefix_loc, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_suffix_loc, int __pyx_v_algorithm) { - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr1 = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_arr2 = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_result = 0; +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_Phrase *__pyx_v_prefix, struct __pyx_obj_3_sa_Phrase *__pyx_v_suffix, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_prefix_loc, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_suffix_loc, int __pyx_v_algorithm) { + struct __pyx_obj_3_sa_IntList *__pyx_v_arr1 = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_arr2 = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_result = 0; int __pyx_v_low1; int __pyx_v_high1; int __pyx_v_step1; @@ -40489,11 +40570,12 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -40515,22 +40597,12 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * offset_by_one = 1 * else: */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_isvar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __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[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { + __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_2); + if (__pyx_t_3) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":748 * @@ -40562,25 +40634,25 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * * if prefix_loc.arr is None: */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __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); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __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_3)); __pyx_t_3 = 0; - __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_len_last = __pyx_t_5; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_len_last = __pyx_t_6; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":754 * len_last = len(suffix.getchunk(suffix.arity())) @@ -40589,8 +40661,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) * arr1 = prefix_loc.arr */ - __pyx_t_4 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None); - if (__pyx_t_4) { + __pyx_t_7 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None); + if (__pyx_t_7) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":755 * @@ -40599,10 +40671,10 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * arr1 = prefix_loc.arr * low1 = prefix_loc.arr_low */ - __pyx_t_1 = ((PyObject *)__pyx_v_self->fsa->sa); - __Pyx_INCREF(__pyx_t_1); - ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->sort_phrase_loc(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1), __pyx_v_prefix_loc, __pyx_v_prefix); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((PyObject *)__pyx_v_self->fsa->sa); + __Pyx_INCREF(__pyx_t_5); + ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->sort_phrase_loc(__pyx_v_self, ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5), __pyx_v_prefix_loc, __pyx_v_prefix); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4; } __pyx_L4:; @@ -40651,8 +40723,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) * arr2 = suffix_loc.arr */ - __pyx_t_4 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None); - if (__pyx_t_4) { + __pyx_t_7 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None); + if (__pyx_t_7) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":762 * @@ -40661,10 +40733,10 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * arr2 = suffix_loc.arr * low2 = suffix_loc.arr_low */ - __pyx_t_1 = ((PyObject *)__pyx_v_self->fsa->sa); - __Pyx_INCREF(__pyx_t_1); - ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->sort_phrase_loc(__pyx_v_self, ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1), __pyx_v_suffix_loc, __pyx_v_suffix); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((PyObject *)__pyx_v_self->fsa->sa); + __Pyx_INCREF(__pyx_t_5); + ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->sort_phrase_loc(__pyx_v_self, ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5), __pyx_v_suffix_loc, __pyx_v_suffix); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5; } __pyx_L5:; @@ -40713,17 +40785,17 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * * if algorithm == MERGE: */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_num_subpatterns = __pyx_t_6; + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_num_subpatterns = __pyx_t_3; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":770 * num_subpatterns = prefix.arity()+1 @@ -40732,8 +40804,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, * low2, high2, arr2.arr, step2, */ - __pyx_t_4 = (__pyx_v_algorithm == __pyx_v_8_cdec_sa_MERGE); - if (__pyx_t_4) { + __pyx_t_7 = (__pyx_v_algorithm == __pyx_v_3_sa_MERGE); + if (__pyx_t_7) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":773 * result_ptr = self.merge_helper(low1, high1, arr1.arr, step1, @@ -40742,7 +40814,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * else: * result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1, */ - __pyx_v_result_ptr = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->merge_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1->arr, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2->arr, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_result_len)); + __pyx_v_result_ptr = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->merge_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1->arr, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2->arr, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_result_len)); goto __pyx_L6; } /*else*/ { @@ -40754,7 +40826,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * * if result_len == 0: */ - __pyx_v_result_ptr = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1->arr, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2->arr, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_result_len)); + __pyx_v_result_ptr = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_high1, __pyx_v_arr1->arr, __pyx_v_step1, __pyx_v_low2, __pyx_v_high2, __pyx_v_arr2->arr, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_result_len)); } __pyx_L6:; @@ -40765,8 +40837,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * free(result_ptr) * return None */ - __pyx_t_4 = (__pyx_v_result_len == 0); - if (__pyx_t_4) { + __pyx_t_7 = (__pyx_v_result_len == 0); + if (__pyx_t_7) { /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":780 * @@ -40799,10 +40871,10 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * free(result.arr) * result.arr = result_ptr */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_result = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_result = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5); + __pyx_t_5 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":784 * else: @@ -40848,23 +40920,23 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * cdef loc2str(self, PhraseLocation loc): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; } __pyx_L7:; @@ -40873,9 +40945,9 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.intersect_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.intersect_helper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_arr1); @@ -40894,7 +40966,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper(st * result = "{" */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_loc) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_loc) { int __pyx_v_i; int __pyx_v_j; PyObject *__pyx_v_result = NULL; @@ -41035,7 +41107,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUS __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.loc2str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.loc2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -41052,14 +41124,14 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUS * cdef PhraseLocation prefix_loc, suffix_loc, result */ -static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_prefix_node, PyObject *__pyx_v_suffix_node, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_phrase) { - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_prefix = 0; - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_suffix = 0; - struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_prefix_loc = 0; - struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_suffix_loc = 0; - struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_v_result = 0; +static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_prefix_node, PyObject *__pyx_v_suffix_node, struct __pyx_obj_3_sa_Phrase *__pyx_v_phrase) { + struct __pyx_obj_3_sa_Phrase *__pyx_v_prefix = 0; + struct __pyx_obj_3_sa_Phrase *__pyx_v_suffix = 0; + struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_prefix_loc = 0; + struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_suffix_loc = 0; + struct __pyx_obj_3_sa_PhraseLocation *__pyx_v_result = 0; CYTHON_UNUSED PyObject *__pyx_v_intersect_method = NULL; - struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_r = NULL; + struct __pyx_obj_3_sa_PhraseLocation *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -41079,8 +41151,8 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_prefix = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_prefix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":808 @@ -41092,8 +41164,8 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_suffix = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_suffix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":809 @@ -41105,8 +41177,8 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_prefix_loc = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_prefix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":810 @@ -41118,8 +41190,8 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_suffix_loc = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_suffix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":812 @@ -41140,8 +41212,8 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_result = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":813 @@ -41193,11 +41265,11 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi * intersect_method="double binary" * else: */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_8_cdec_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_3); + __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":819 @@ -41221,11 +41293,11 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi * intersect_method="merge" * return result */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_8_cdec_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_3); + __pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":822 @@ -41256,13 +41328,13 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct __pyx_obj_3_sa_PhraseLocation *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_prefix); @@ -41277,16 +41349,16 @@ static struct __pyx_obj_8_cdec_sa_PhraseLocation *__pyx_f_8_cdec_sa_23HieroCachi } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frontier = 0; PyObject *__pyx_v_res = 0; PyObject *__pyx_v_fwords = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("advance (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__frontier,&__pyx_n_s__res,&__pyx_n_s__fwords,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -41301,18 +41373,15 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance(PyObject kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__frontier)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -41335,11 +41404,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance(PyObject __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_frontier, __pyx_v_res, __pyx_v_fwords); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_frontier, __pyx_v_res, __pyx_v_fwords); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -41352,7 +41421,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance(PyObject * nf = [] */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_frontier, PyObject *__pyx_v_res, PyObject *__pyx_v_fwords) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_frontier, PyObject *__pyx_v_res, PyObject *__pyx_v_fwords) { unsigned int __pyx_v_na; PyObject *__pyx_v_nf = NULL; PyObject *__pyx_v_toskip = NULL; @@ -41415,10 +41484,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -41432,27 +41509,33 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -41463,12 +41546,13 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ 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[8]; __pyx_lineno = 828; __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; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } @@ -41477,21 +41561,22 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); @@ -41499,8 +41584,14 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else { + } else + { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); @@ -41513,12 +41604,13 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ index = 2; __pyx_t_10 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } @@ -41697,7 +41789,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ * return self.advance(nf, res, fwords) * else: */ - __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); + __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = (__pyx_t_2 > 0); if (__pyx_t_15) { @@ -41758,7 +41850,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_nf); @@ -41774,8 +41866,8 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_12advance(struct _ } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_skip = 0; PyObject *__pyx_v_i = 0; PyObject *__pyx_v_spanlen = 0; @@ -41783,11 +41875,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_is PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_next_states = 0; PyObject *__pyx_v_reachable_buffer = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_all_nodes_isteps_away (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__skip,&__pyx_n_s__i,&__pyx_n_s__spanlen,&__pyx_n_s__pathlen,&__pyx_n_s__fwords,&__pyx_n_s__next_states,&__pyx_n_s__reachable_buffer,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -41806,42 +41898,35 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_is kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__skip)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen); - if (likely(values[3])) kw_args--; + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[4])) kw_args--; + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states); - if (likely(values[5])) kw_args--; + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer); - if (likely(values[6])) kw_args--; + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -41872,11 +41957,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_is __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_skip, __pyx_v_i, __pyx_v_spanlen, __pyx_v_pathlen, __pyx_v_fwords, __pyx_v_next_states, __pyx_v_reachable_buffer); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_skip, __pyx_v_i, __pyx_v_spanlen, __pyx_v_pathlen, __pyx_v_fwords, __pyx_v_next_states, __pyx_v_reachable_buffer); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -41889,7 +41974,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_is * frontier = [] */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_skip, PyObject *__pyx_v_i, PyObject *__pyx_v_spanlen, PyObject *__pyx_v_pathlen, PyObject *__pyx_v_fwords, PyObject *__pyx_v_next_states, PyObject *__pyx_v_reachable_buffer) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_away(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_skip, PyObject *__pyx_v_i, PyObject *__pyx_v_spanlen, PyObject *__pyx_v_pathlen, PyObject *__pyx_v_fwords, PyObject *__pyx_v_next_states, PyObject *__pyx_v_reachable_buffer) { PyObject *__pyx_v_frontier = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_reachable = NULL; @@ -42085,10 +42170,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is for (;;) { if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) { @@ -42125,10 +42218,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is for (;;) { if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_4)) { @@ -42249,10 +42350,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is for (;;) { if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_9)) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_4 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_4)) { @@ -42283,7 +42392,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); @@ -42387,7 +42496,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_frontier); @@ -42404,16 +42513,16 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_14get_all_nodes_is } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_dist = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reachable (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__dist,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -42428,18 +42537,15 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable(PyObje kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -42462,11 +42568,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable(PyObje __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_dist); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_dist); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -42479,7 +42585,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable(PyObje * if (ifrom >= len(fwords)): */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist) { PyObject *__pyx_v_ret = NULL; PyObject *__pyx_v_alt_id = NULL; PyObject *__pyx_v_ifromchild = NULL; @@ -42578,10 +42684,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct for (;;) { if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { @@ -42612,7 +42726,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -42760,10 +42874,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct for (;;) { if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_3 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_3)) { @@ -42829,7 +42951,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ret); @@ -42841,16 +42963,16 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_16reachable(struct } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_ifrom = 0; PyObject *__pyx_v_ito = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shortest (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__ifrom,&__pyx_n_s__ito,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -42865,18 +42987,15 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest(PyObjec kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito); - if (likely(values[2])) kw_args--; + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -42899,11 +43018,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest(PyObjec __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_ito); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_ifrom, __pyx_v_ito); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -42916,7 +43035,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest(PyObjec * min = 1000 */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito) { unsigned int __pyx_v_alt_id; PyObject *__pyx_v_min = NULL; PyObject *__pyx_v_currmin = NULL; @@ -43067,7 +43186,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -43139,7 +43258,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(struct __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_min); @@ -43150,16 +43269,16 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_18shortest(struct } /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v__columns = 0; PyObject *__pyx_v_curr_idx = 0; PyObject *__pyx_v_min_dist = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s___columns,&__pyx_n_s__curr_idx,&__pyx_n_s__min_dist,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_next_states (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s___columns,&__pyx_n_s__curr_idx,&__pyx_n_s__min_dist,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_int_2); if (unlikely(__pyx_kwds)) { @@ -43175,12 +43294,10 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states( kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s___columns); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s___columns)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__curr_idx); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__curr_idx)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -43210,11 +43327,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states( __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v__columns, __pyx_v_curr_idx, __pyx_v_min_dist); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v__columns, __pyx_v_curr_idx, __pyx_v_min_dist); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -43227,7 +43344,7 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states( * candidate = [[curr_idx,0]] */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist) { +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_candidate = NULL; PyObject *__pyx_v_curr = NULL; @@ -43295,7 +43412,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states( * if curr[0] >= len(_columns): */ while (1) { - __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); + __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 > 0); if (!__pyx_t_4) break; @@ -43426,10 +43543,18 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states( for (;;) { if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_1 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_1)) { @@ -43484,7 +43609,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states( */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -43598,7 +43723,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states( __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); @@ -43612,19 +43737,19 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_20get_next_states( __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ /* Python wrapper */ -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_8_cdec_sa_23HieroCachingRuleFactory_22input[] = "When this function is called on the RuleFactory,\n it looks up all of the rules that can be used to translate\n the input sentence"; -static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_3_sa_23HieroCachingRuleFactory_22input[] = "When this function is called on the RuleFactory,\n it looks up all of the rules that can be used to translate\n the input sentence"; +static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fwords = 0; PyObject *__pyx_v_models = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__models,0}; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("input (wrapper)", 0); { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__models,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; @@ -43638,12 +43763,10 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input(PyObject * kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords); - if (likely(values[0])) kw_args--; + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__models); - if (likely(values[1])) kw_args--; + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__models)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -43664,11 +43787,11 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input(PyObject * __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_models); + __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_22input(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fwords, __pyx_v_models); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -43681,15 +43804,15 @@ static PyObject *__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input(PyObject * * it looks up all of the rules that can be used to translate */ -static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_models) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *__pyx_cur_scope; +static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_models) { + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("input", 0); - __pyx_cur_scope = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)__pyx_ptype_8_cdec_sa___pyx_scope_struct_1_input->tp_new(__pyx_ptype_8_cdec_sa___pyx_scope_struct_1_input, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)__pyx_ptype_3_sa___pyx_scope_struct_2_input->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_2_input, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __Pyx_RefNannyFinishContext(); return NULL; @@ -43705,7 +43828,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(struct __p __Pyx_INCREF(__pyx_cur_scope->__pyx_v_models); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_models); { - __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -43714,7 +43837,7 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(struct __p __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); @@ -43723,9 +43846,9 @@ static PyObject *__pyx_pf_8_cdec_sa_23HieroCachingRuleFactory_22input(struct __p return __pyx_r; } -static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator2(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *__pyx_cur_scope = ((struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)__pyx_generator->closure); + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)__pyx_generator->closure); PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; @@ -43748,11 +43871,11 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx int __pyx_t_19; float __pyx_t_20; Py_ssize_t __pyx_t_21; - PyObject *__pyx_t_22 = NULL; - PyObject *__pyx_t_23 = NULL; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; Py_ssize_t __pyx_t_24; - PyObject *(*__pyx_t_25)(PyObject *); - Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_25; + int __pyx_t_26; PyObject *(*__pyx_t_27)(PyObject *); int __pyx_t_28; int __pyx_t_29; @@ -43760,7 +43883,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_RefNannySetupContext("None", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L63_resume_from_yield; + case 1: goto __pyx_L59_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; @@ -43785,7 +43908,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * self.extract_time = 0.0 * nodes_isteps_away_buffer = {} */ - __pyx_cur_scope->__pyx_v_start_time = __pyx_f_8_cdec_sa_monitor_cpu(); + __pyx_cur_scope->__pyx_v_start_time = __pyx_f_3_sa_monitor_cpu(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":932 * flen = len(fwords) @@ -43840,11 +43963,11 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -43906,7 +44029,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -43980,7 +44103,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * if x1 in self.rules.root.children: * xroot = self.rules.root.children[x1] */ - __pyx_cur_scope->__pyx_v_x1 = __pyx_f_8_cdec_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); + __pyx_cur_scope->__pyx_v_x1 = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":948 * xroot = None @@ -44029,11 +44152,11 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot); @@ -44096,7 +44219,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -44225,7 +44348,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * for k, i, alt, pathlen, node, prefix, is_shadow_path in frontier: */ while (1) { - __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); + __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_t_1 > 0); if (!__pyx_t_8) break; @@ -44254,15 +44377,25 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_12 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_12); __pyx_t_1 = 0; for (;;) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_12)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_12, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 7)) { + if (size > 7) __Pyx_RaiseTooManyValuesError(7); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 7)) { - if (PyTuple_GET_SIZE(sequence) > 7) __Pyx_RaiseTooManyValuesError(7); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); @@ -44271,11 +44404,6 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_14 = PyTuple_GET_ITEM(sequence, 5); __pyx_t_15 = PyTuple_GET_ITEM(sequence, 6); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 7)) { - if (PyList_GET_SIZE(sequence) > 7) __Pyx_RaiseTooManyValuesError(7); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_13 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); @@ -44291,34 +44419,36 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); + #else + Py_ssize_t i; + PyObject** temps[7] = {&__pyx_t_13,&__pyx_t_7,&__pyx_t_9,&__pyx_t_10,&__pyx_t_3,&__pyx_t_14,&__pyx_t_15}; + for (i=0; i < 7; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { + } else + { Py_ssize_t index = -1; + PyObject** temps[7] = {&__pyx_t_13,&__pyx_t_7,&__pyx_t_9,&__pyx_t_10,&__pyx_t_3,&__pyx_t_14,&__pyx_t_15}; __pyx_t_16 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; - index = 0; __pyx_t_13 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_13)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_13); - index = 1; __pyx_t_7 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_7)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 2; __pyx_t_9 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 3; __pyx_t_10 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_10); - index = 4; __pyx_t_3 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_3)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 5; __pyx_t_14 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_14)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_14); - index = 6; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); + for (index=0; index < 7; index++) { + PyObject* item = __pyx_t_17(__pyx_t_16); if (unlikely(!item)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } @@ -44401,7 +44531,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * # skipping because word_id is epsilon * if i+spanlen >= len(fwords): */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_8_cdec_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); @@ -44524,8 +44654,8 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * continue * * phrase = prefix + (word_id,) # <<<<<<<<<<<<<< - * str_phrase = map(sym_tostring, phrase) * hiero_phrase = Phrase(phrase) + * arity = hiero_phrase.arity() */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -44544,67 +44674,41 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":978 * * phrase = prefix + (word_id,) - * str_phrase = map(sym_tostring, phrase) # <<<<<<<<<<<<<< - * hiero_phrase = Phrase(phrase) - * arity = hiero_phrase.arity() - */ - __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_tostring); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_phrase); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_str_phrase); - __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_str_phrase); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_v_str_phrase = __pyx_t_15; - __pyx_t_15 = 0; - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":979 - * phrase = prefix + (word_id,) - * str_phrase = map(sym_tostring, phrase) * hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<< * arity = hiero_phrase.arity() * */ - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)); __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_3); + __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":980 - * str_phrase = map(sym_tostring, phrase) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":979 + * phrase = prefix + (word_id,) * hiero_phrase = Phrase(phrase) * arity = hiero_phrase.arity() # <<<<<<<<<<<<<< * * lookup_required = False */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_cur_scope->__pyx_v_arity = __pyx_t_18; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":982 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":981 * arity = hiero_phrase.arity() * * lookup_required = False # <<<<<<<<<<<<<< @@ -44613,36 +44717,36 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ __pyx_cur_scope->__pyx_v_lookup_required = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":983 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":982 * * lookup_required = False * if word_id in node.children: # <<<<<<<<<<<<<< * if node.children[word_id] is None: * # Path dead-ends at this node */ - __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_8 = ((PySequence_Contains(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PySequence_Contains(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":984 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":983 * lookup_required = False * if word_id in node.children: * if node.children[word_id] is None: # <<<<<<<<<<<<<< * # Path dead-ends at this node * continue */ - __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_8 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":986 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":985 * if node.children[word_id] is None: * # Path dead-ends at this node * continue # <<<<<<<<<<<<<< @@ -44654,16 +44758,16 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":989 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":988 * else: * # Path continues at this node * node = node.children[word_id] # <<<<<<<<<<<<<< * else: * if node.suffix_link is None: */ - __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node); @@ -44677,20 +44781,20 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":991 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":990 * node = node.children[word_id] * else: * if node.suffix_link is None: # <<<<<<<<<<<<<< * # Current node is root; lookup required * lookup_required = True */ - __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_8 = (__pyx_t_15 == Py_None); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":993 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":992 * if node.suffix_link is None: * # Current node is root; lookup required * lookup_required = True # <<<<<<<<<<<<<< @@ -44702,54 +44806,54 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":995 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":994 * lookup_required = True * else: * if word_id in node.suffix_link.children: # <<<<<<<<<<<<<< * if node.suffix_link.children[word_id] is None: * # Suffix link reports path is dead end */ - __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_8 = ((PySequence_Contains(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PySequence_Contains(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":996 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":995 * else: * if word_id in node.suffix_link.children: * if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<< * # Suffix link reports path is dead end * node.children[word_id] = None */ - __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_8 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":998 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":997 * if node.suffix_link.children[word_id] is None: * # Suffix link reports path is dead end * node.children[word_id] = None # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":999 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":998 * # Suffix link reports path is dead end * node.children[word_id] = None * continue # <<<<<<<<<<<<<< @@ -44761,7 +44865,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1002 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1001 * else: * # Suffix link indicates lookup is reqired * lookup_required = True # <<<<<<<<<<<<<< @@ -44775,18 +44879,18 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1005 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1004 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L30:; } @@ -44794,7 +44898,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L27:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1007 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1006 * raise Exception("Keyword trie error") * # checking whether lookup_required * if lookup_required: # <<<<<<<<<<<<<< @@ -44803,7 +44907,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ if (__pyx_cur_scope->__pyx_v_lookup_required) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1008 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1007 * # checking whether lookup_required * if lookup_required: * new_node = None # <<<<<<<<<<<<<< @@ -44816,66 +44920,66 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_new_node = Py_None; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1009 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1008 * if lookup_required: * new_node = None * if is_shadow_path: # <<<<<<<<<<<<<< * # Extending shadow path * # on the shadow path we don't do any search, we just use info from suffix link */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1012 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1011 * # Extending shadow path * # on the shadow path we don't do any search, we just use info from suffix link * new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<< * suffix_link=node.suffix_link.children[word_id], * phrase=hiero_phrase) */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_GetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1013 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1012 * # on the shadow path we don't do any search, we just use info from suffix link * new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, * suffix_link=node.suffix_link.children[word_id], # <<<<<<<<<<<<<< * phrase=hiero_phrase) * else: */ - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1014 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1013 * new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, * suffix_link=node.suffix_link.children[word_id], * phrase=hiero_phrase) # <<<<<<<<<<<<<< * else: * if arity > 0: */ - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); @@ -44887,7 +44991,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1016 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1015 * phrase=hiero_phrase) * else: * if arity > 0: # <<<<<<<<<<<<<< @@ -44897,71 +45001,75 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity > 0); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1018 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1017 * if arity > 0: * # Intersecting because of arity > 0 * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<< * else: * # Suffix array search */ - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_2, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_2, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_3); + __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L34; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1021 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1020 * else: * # Suffix array search * phrase_location = node.phrase_location # <<<<<<<<<<<<<< - * sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) + * sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) * if sa_range is not None: */ - __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8_cdec_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_3); + __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1022 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1021 * # Suffix array search * phrase_location = node.phrase_location - * sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) # <<<<<<<<<<<<<< + * sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) # <<<<<<<<<<<<<< * if sa_range is not None: * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_str_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_str_phrase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_14); @@ -44972,7 +45080,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; @@ -44982,9 +45090,9 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_sa_range = __pyx_t_10; __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1023 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1022 * phrase_location = node.phrase_location - * sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) + * sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) * if sa_range is not None: # <<<<<<<<<<<<<< * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: @@ -44992,36 +45100,36 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_8 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1024 - * sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1023 + * sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) * if sa_range is not None: * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) # <<<<<<<<<<<<<< * else: * phrase_location = None */ - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_GIVEREF(__pyx_t_9); - __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_9); + __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L35; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1026 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1025 * phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) * else: * phrase_location = None # <<<<<<<<<<<<<< @@ -45032,13 +45140,13 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)); __Pyx_GIVEREF(Py_None); - __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)Py_None); + __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)Py_None); } __pyx_L35:; } __pyx_L34:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1028 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1027 * phrase_location = None * * if phrase_location is None: # <<<<<<<<<<<<<< @@ -45048,19 +45156,19 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_8 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1029 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1028 * * if phrase_location is None: * node.children[word_id] = None # <<<<<<<<<<<<<< * # Search failed * continue */ - __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - if (PyObject_SetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1031 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1030 * node.children[word_id] = None * # Search failed * continue # <<<<<<<<<<<<<< @@ -45072,7 +45180,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L36:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1033 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1032 * continue * # Search succeeded * suffix_link = self.rules.root # <<<<<<<<<<<<<< @@ -45085,32 +45193,32 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root); __pyx_cur_scope->__pyx_v_suffix_link = __pyx_cur_scope->__pyx_v_self->rules->root; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1034 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1033 * # Search succeeded * suffix_link = self.rules.root * if node.suffix_link is not None: # <<<<<<<<<<<<<< * suffix_link = node.suffix_link.children[word_id] * new_node = ExtendedTrieNode(phrase_location=phrase_location, */ - __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1035 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1034 * suffix_link = self.rules.root * if node.suffix_link is not None: * suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<< * new_node = ExtendedTrieNode(phrase_location=phrase_location, * suffix_link=suffix_link, */ - __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link); @@ -45122,35 +45230,35 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L37:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1036 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1035 * if node.suffix_link is not None: * suffix_link = node.suffix_link.children[word_id] * new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<< * suffix_link=suffix_link, * phrase=hiero_phrase) */ - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1037 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1036 * suffix_link = node.suffix_link.children[word_id] * new_node = ExtendedTrieNode(phrase_location=phrase_location, * suffix_link=suffix_link, # <<<<<<<<<<<<<< * phrase=hiero_phrase) * node.children[word_id] = new_node */ - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1038 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1037 * new_node = ExtendedTrieNode(phrase_location=phrase_location, * suffix_link=suffix_link, * phrase=hiero_phrase) # <<<<<<<<<<<<<< * node.children[word_id] = new_node * node = new_node */ - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node); @@ -45161,19 +45269,19 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L33:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1039 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1038 * suffix_link=suffix_link, * phrase=hiero_phrase) * node.children[word_id] = new_node # <<<<<<<<<<<<<< * node = new_node * */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1040 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1039 * phrase=hiero_phrase) * node.children[word_id] = new_node * node = new_node # <<<<<<<<<<<<<< @@ -45186,7 +45294,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node); __pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_new_node; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1045 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1044 * This should happen before we get to extraction (so that * the node will exist if needed)''' * if arity < self.max_nonterminals: # <<<<<<<<<<<<<< @@ -45196,14 +45304,14 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1046 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1045 * the node will exist if needed)''' * if arity < self.max_nonterminals: * xcat_index = arity+1 # <<<<<<<<<<<<<< * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index */ - __pyx_t_10 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xcat_index); @@ -45211,17 +45319,17 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_10; __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1047 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1046 * if arity < self.max_nonterminals: * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) # <<<<<<<<<<<<<< * suffix_link_xcat_index = xcat_index * if is_shadow_path: */ - __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_cur_scope->__pyx_v_xcat = __pyx_f_8_cdec_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_18); + __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_18); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1048 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1047 * xcat_index = arity+1 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<< @@ -45234,24 +45342,24 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index); __pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_cur_scope->__pyx_v_xcat_index; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1049 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1048 * xcat = sym_setindex(self.category, xcat_index) * suffix_link_xcat_index = xcat_index * if is_shadow_path: # <<<<<<<<<<<<<< * suffix_link_xcat_index = xcat_index-1 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1050 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1049 * suffix_link_xcat_index = xcat_index * if is_shadow_path: * suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<< * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, */ - __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); @@ -45262,168 +45370,168 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L39:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1051 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1050 * if is_shadow_path: * suffix_link_xcat_index = xcat_index-1 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) # <<<<<<<<<<<<<< * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, * suffix_link=node.suffix_link.children[suffix_link_xcat], */ - __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_8_cdec_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_18); + __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_18); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1052 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1051 * suffix_link_xcat_index = xcat_index-1 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<< * suffix_link=node.suffix_link.children[suffix_link_xcat], * phrase= Phrase(phrase + (xcat,))) */ - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1053 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1052 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, * suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<< * phrase= Phrase(phrase + (xcat,))) * */ - __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1054 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1053 * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, * suffix_link=node.suffix_link.children[suffix_link_xcat], * phrase= Phrase(phrase + (xcat,))) # <<<<<<<<<<<<<< * * # sample from range */ - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __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[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1052 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1051 * suffix_link_xcat_index = xcat_index-1 * suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) * node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<< * suffix_link=node.suffix_link.children[suffix_link_xcat], * phrase= Phrase(phrase + (xcat,))) */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_9, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_9, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L38; } __pyx_L38:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1057 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1056 * * # sample from range * if not is_shadow_path: # <<<<<<<<<<<<<< * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (!__pyx_t_8); if (__pyx_t_19) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1058 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1057 * # sample from range * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<< * num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) */ - __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_8_cdec_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample)); __Pyx_GIVEREF(__pyx_t_10); - __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_10); + __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_10); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1059 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1058 * if not is_shadow_path: * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns # <<<<<<<<<<<<<< * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)__pyx_t_10)->num_subpatterns; + __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_10)->num_subpatterns; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1060 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1059 * sample = self.sampler.sample(node.phrase_location) * num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) # <<<<<<<<<<<<<< * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) */ - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen)); __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_3); + __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1061 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1060 * num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<< @@ -45433,24 +45541,24 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_18 = __pyx_cur_scope->__pyx_v_num_subpatterns; for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_18; __pyx_cur_scope->__pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1062 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1061 * chunklen = IntList(initial_len=num_subpatterns) * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<< * extracts = [] * j = 0 */ - (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_8_cdec_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j); + (__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1063 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1062 * for j from 0 <= j < num_subpatterns: * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] # <<<<<<<<<<<<<< * j = 0 * extract_start = monitor_cpu() */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); @@ -45458,7 +45566,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_extracts = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1064 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1063 * chunklen.arr[j] = hiero_phrase.chunklen(j) * extracts = [] * j = 0 # <<<<<<<<<<<<<< @@ -45467,14 +45575,14 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ __pyx_cur_scope->__pyx_v_j = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1065 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1064 * extracts = [] * j = 0 * extract_start = monitor_cpu() # <<<<<<<<<<<<<< * while j < sample.len: * extract = [] */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_f_8_cdec_sa_monitor_cpu()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_start); @@ -45482,7 +45590,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_extract_start = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1066 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1065 * j = 0 * extract_start = monitor_cpu() * while j < sample.len: # <<<<<<<<<<<<<< @@ -45493,14 +45601,14 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_19 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len); if (!__pyx_t_19) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1067 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1066 * extract_start = monitor_cpu() * while j < sample.len: * extract = [] # <<<<<<<<<<<<<< * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract); @@ -45508,23 +45616,23 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1069 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1068 * extract = [] * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<< * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend(extract) */ - __pyx_f_8_cdec_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr); + __pyx_f_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1070 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1069 * * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<< * extracts.extend(extract) * j = j + num_subpatterns */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_extract); @@ -45532,27 +45640,27 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_extract = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1071 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1070 * assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend(extract) # <<<<<<<<<<<<<< * j = j + num_subpatterns * */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_extract); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_extract); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_extract); - __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1072 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1071 * extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) * extracts.extend(extract) * j = j + num_subpatterns # <<<<<<<<<<<<<< @@ -45562,7 +45670,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1074 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1073 * j = j + num_subpatterns * * num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<< @@ -45571,22 +45679,22 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ if (unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(int) == sizeof(long) && unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_cur_scope->__pyx_v_sample->len))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_cur_scope->__pyx_v_num_samples = __Pyx_div_int(__pyx_cur_scope->__pyx_v_sample->len, __pyx_cur_scope->__pyx_v_num_subpatterns); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1075 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1074 * * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() # <<<<<<<<<<<<<< * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: */ - __pyx_t_9 = PyFloat_FromDouble(__pyx_f_8_cdec_sa_monitor_cpu()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_stop); @@ -45594,44 +45702,44 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_9; __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1076 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1075 * num_samples = sample.len/num_subpatterns * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<< * if len(extracts) > 0: * fphrases = {} */ - __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyNumber_Subtract(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_20 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_20 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_PyFloat_AsFloat(__pyx_t_9); if (unlikely((__pyx_t_20 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_20; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1077 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1076 * extract_stop = monitor_cpu() * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: # <<<<<<<<<<<<<< * fphrases = {} * fals = {} */ - __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); + __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (__pyx_t_5 > 0); if (__pyx_t_19) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1078 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1077 * self.extract_time = self.extract_time + extract_stop - extract_start * if len(extracts) > 0: * fphrases = {} # <<<<<<<<<<<<<< * fals = {} * fcount = {} */ - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases)); @@ -45639,14 +45747,14 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_fphrases = __pyx_t_9; __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1079 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1078 * if len(extracts) > 0: * fphrases = {} * fals = {} # <<<<<<<<<<<<<< * fcount = {} * for f, e, count, als in extracts: */ - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_fals)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_fals)); @@ -45654,14 +45762,14 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_fals = __pyx_t_9; __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1080 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1079 * fphrases = {} * fals = {} * fcount = {} # <<<<<<<<<<<<<< * for f, e, count, als in extracts: * fcount.setdefault(f, 0.0) */ - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_fcount)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_fcount)); @@ -45669,7 +45777,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_fcount = __pyx_t_9; __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1081 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1080 * fals = {} * fcount = {} * for f, e, count, als in extracts: # <<<<<<<<<<<<<< @@ -45679,25 +45787,30 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_t_9 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_10); __pyx_t_5++; + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { PyObject* sequence = __pyx_t_10; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 4)) { - if (PyTuple_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_15 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 4)) { - if (PyList_GET_SIZE(sequence) > 4) __Pyx_RaiseTooManyValuesError(4); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_14 = PyList_GET_ITEM(sequence, 1); __pyx_t_15 = PyList_GET_ITEM(sequence, 2); @@ -45707,29 +45820,37 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_2); + #else + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_14,&__pyx_t_15,&__pyx_t_2}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(temps[i]) = item; + } + #endif __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_14,&__pyx_t_15,&__pyx_t_2}; + __pyx_t_7 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L48_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_14 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_14)) goto __pyx_L48_unpacking_failed; - __Pyx_GOTREF(__pyx_t_14); - index = 2; __pyx_t_15 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_15)) goto __pyx_L48_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 3; __pyx_t_2 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L48_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + for (index=0; index < 4; index++) { + PyObject* item = __pyx_t_17(__pyx_t_7); if (unlikely(!item)) goto __pyx_L48_unpacking_failed; + __Pyx_GOTREF(item); + *(temps[index]) = item; + } + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L49_unpacking_done; __pyx_L48_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L49_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); @@ -45753,64 +45874,64 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_als = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1082 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1081 * fcount = {} * for f, e, count, als in extracts: * fcount.setdefault(f, 0.0) # <<<<<<<<<<<<<< * fcount[f] = fcount[f] + count * fphrases.setdefault(f, {}) */ - __pyx_t_10 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyDict_SetDefault(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyDict_SetDefault(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1083 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1082 * for f, e, count, als in extracts: * fcount.setdefault(f, 0.0) * fcount[f] = fcount[f] + count # <<<<<<<<<<<<<< * fphrases.setdefault(f, {}) * fphrases[f].setdefault(e, {}) */ - __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1084 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1083 * fcount.setdefault(f, 0.0) * fcount[f] = fcount[f] + count * fphrases.setdefault(f, {}) # <<<<<<<<<<<<<< * fphrases[f].setdefault(e, {}) * fphrases[f][e].setdefault(als,0.0) */ - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_2 = __Pyx_PyDict_SetDefault(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyDict_SetDefault(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1085 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1084 * fcount[f] = fcount[f] + count * fphrases.setdefault(f, {}) * fphrases[f].setdefault(e, {}) # <<<<<<<<<<<<<< * fphrases[f][e].setdefault(als,0.0) * fphrases[f][e][als] = fphrases[f][e][als] + count */ - __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setdefault); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__setdefault); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e); @@ -45818,30 +45939,30 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1086 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1085 * fphrases.setdefault(f, {}) * fphrases[f].setdefault(e, {}) * fphrases[f][e].setdefault(als,0.0) # <<<<<<<<<<<<<< * fphrases[f][e][als] = fphrases[f][e][als] + count * for f, elist in fphrases.iteritems(): */ - __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyObject_GetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__setdefault); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__setdefault); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_als); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_als); @@ -45849,177 +45970,121 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1087 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1086 * fphrases[f].setdefault(e, {}) * fphrases[f][e].setdefault(als,0.0) * fphrases[f][e][als] = fphrases[f][e][als] + count # <<<<<<<<<<<<<< * for f, elist in fphrases.iteritems(): * f_margin = fcount[f] */ - __pyx_t_15 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_t_15, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Add(__pyx_t_15, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (PyObject_SetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_als, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_als, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1088 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1087 * fphrases[f][e].setdefault(als,0.0) * fphrases[f][e][als] = fphrases[f][e][als] + count * for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<< * f_margin = fcount[f] * for e, alslist in elist.iteritems(): */ - __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases)); - __Pyx_XDECREF(__pyx_t_9); - __pyx_t_9 = ((PyObject *)__pyx_cur_scope->__pyx_v_fphrases); __pyx_t_5 = 0; - __pyx_t_21 = PyDict_Size(__pyx_t_9); + __pyx_t_10 = __Pyx_dict_iterator(((PyObject *)__pyx_cur_scope->__pyx_v_fphrases), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_21), (&__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); + __pyx_t_9 = __pyx_t_10; + __pyx_t_10 = 0; while (1) { - if (unlikely(__pyx_t_21 != PyDict_Size(__pyx_t_9))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - if (!PyDict_Next(__pyx_t_9, (&__pyx_t_5), (&__pyx_t_22), (&__pyx_t_23))) break; - __Pyx_INCREF(((PyObject *)__pyx_t_22)); + __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_21, &__pyx_t_5, &__pyx_t_10, &__pyx_t_2, NULL, __pyx_t_18); + if (unlikely(__pyx_t_6 == 0)) break; + if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f); - __Pyx_GIVEREF(__pyx_t_22); - __pyx_cur_scope->__pyx_v_f = __pyx_t_22; - __Pyx_INCREF(((PyObject *)__pyx_t_23)); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_cur_scope->__pyx_v_f = __pyx_t_10; + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_elist); - __Pyx_GIVEREF(__pyx_t_23); - __pyx_cur_scope->__pyx_v_elist = __pyx_t_23; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_elist = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1089 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1088 * fphrases[f][e][als] = fphrases[f][e][als] + count * for f, elist in fphrases.iteritems(): * f_margin = fcount[f] # <<<<<<<<<<<<<< * for e, alslist in elist.iteritems(): * alignment = None */ - __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f_margin); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f_margin); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_cur_scope->__pyx_v_f_margin = __pyx_t_10; - __pyx_t_10 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_f_margin = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1090 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1089 * for f, elist in fphrases.iteritems(): * f_margin = fcount[f] * for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<< * alignment = None * count = 0 */ - __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_elist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = 0; + if (unlikely(__pyx_cur_scope->__pyx_v_elist == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_10 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_6)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_10 = __pyx_t_2; __Pyx_INCREF(__pyx_t_10); __pyx_t_24 = 0; - __pyx_t_25 = NULL; - } else { - __pyx_t_24 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_10; + __pyx_t_10 = 0; + while (1) { + __pyx_t_4 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_23, &__pyx_t_22, &__pyx_t_10, &__pyx_t_15, NULL, __pyx_t_6); + if (unlikely(__pyx_t_4 == 0)) break; + if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_25 = Py_TYPE(__pyx_t_10)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (!__pyx_t_25 && PyList_CheckExact(__pyx_t_10)) { - if (__pyx_t_24 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_24); __Pyx_INCREF(__pyx_t_2); __pyx_t_24++; - } else if (!__pyx_t_25 && PyTuple_CheckExact(__pyx_t_10)) { - if (__pyx_t_24 >= PyTuple_GET_SIZE(__pyx_t_10)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_24); __Pyx_INCREF(__pyx_t_2); __pyx_t_24++; - } else { - __pyx_t_2 = __pyx_t_25(__pyx_t_10); - if (unlikely(!__pyx_t_2)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyList_GET_ITEM(sequence, 0); - __pyx_t_14 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_3); if (unlikely(!__pyx_t_15)) goto __pyx_L54_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_14 = __pyx_t_17(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L54_unpacking_failed; - __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L55_unpacking_done; - __pyx_L54_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L55_unpacking_done:; - } + __Pyx_GOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_v_e = __pyx_t_15; - __pyx_t_15 = 0; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_cur_scope->__pyx_v_e = __pyx_t_10; + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alslist); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alslist); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_cur_scope->__pyx_v_alslist = __pyx_t_14; - __pyx_t_14 = 0; + __Pyx_GIVEREF(__pyx_t_15); + __pyx_cur_scope->__pyx_v_alslist = __pyx_t_15; + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1091 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1090 * f_margin = fcount[f] * for e, alslist in elist.iteritems(): * alignment = None # <<<<<<<<<<<<<< @@ -46032,7 +46097,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(Py_None); __pyx_cur_scope->__pyx_v_alignment = Py_None; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1092 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1091 * for e, alslist in elist.iteritems(): * alignment = None * count = 0 # <<<<<<<<<<<<<< @@ -46045,112 +46110,54 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(__pyx_int_0); __pyx_cur_scope->__pyx_v_count = __pyx_int_0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1093 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1092 * alignment = None * count = 0 * for als, currcount in alslist.iteritems(): # <<<<<<<<<<<<<< * if currcount > count: * alignment = als */ - __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_14) || PyTuple_CheckExact(__pyx_t_14)) { - __pyx_t_2 = __pyx_t_14; __Pyx_INCREF(__pyx_t_2); __pyx_t_26 = 0; - __pyx_t_27 = NULL; - } else { - __pyx_t_26 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_27 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_24 = 0; + if (unlikely(__pyx_cur_scope->__pyx_v_alslist == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - for (;;) { - if (!__pyx_t_27 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_26 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_26); __Pyx_INCREF(__pyx_t_14); __pyx_t_26++; - } else if (!__pyx_t_27 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_26 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_26); __Pyx_INCREF(__pyx_t_14); __pyx_t_26++; - } else { - __pyx_t_14 = __pyx_t_27(__pyx_t_2); - if (unlikely(!__pyx_t_14)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_14); - } - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; - if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_7 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; - index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_15)) goto __pyx_L58_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L58_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L59_unpacking_done; - __pyx_L58_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L59_unpacking_done:; - } + __pyx_t_10 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_alslist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_4)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_15); + __pyx_t_15 = __pyx_t_10; + __pyx_t_10 = 0; + while (1) { + __pyx_t_26 = __Pyx_dict_iter_next(__pyx_t_15, __pyx_t_25, &__pyx_t_24, &__pyx_t_10, &__pyx_t_14, NULL, __pyx_t_4); + if (unlikely(__pyx_t_26 == 0)) break; + if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_als); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_als); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_cur_scope->__pyx_v_als = __pyx_t_15; - __pyx_t_15 = 0; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_cur_scope->__pyx_v_als = __pyx_t_10; + __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_currcount); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_currcount); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_currcount = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_14); + __pyx_cur_scope->__pyx_v_currcount = __pyx_t_14; + __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1094 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1093 * count = 0 * for als, currcount in alslist.iteritems(): * if currcount > count: # <<<<<<<<<<<<<< * alignment = als * count = currcount */ - __pyx_t_14 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_currcount, __pyx_cur_scope->__pyx_v_count, Py_GT); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_currcount, __pyx_cur_scope->__pyx_v_count, Py_GT); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_19) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1095 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1094 * for als, currcount in alslist.iteritems(): * if currcount > count: * alignment = als # <<<<<<<<<<<<<< @@ -46163,7 +46170,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_als); __pyx_cur_scope->__pyx_v_alignment = __pyx_cur_scope->__pyx_v_als; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1096 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1095 * if currcount > count: * alignment = als * count = currcount # <<<<<<<<<<<<<< @@ -46175,28 +46182,28 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_DECREF(__pyx_cur_scope->__pyx_v_count); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_currcount); __pyx_cur_scope->__pyx_v_count = __pyx_cur_scope->__pyx_v_currcount; - goto __pyx_L60; + goto __pyx_L56; } - __pyx_L60:; + __pyx_L56:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1097 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1096 * alignment = als * count = currcount * scores = [] # <<<<<<<<<<<<<< * for model in models: * scores.append(model(f, e, count, fcount[f], num_samples)) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_cur_scope->__pyx_v_scores = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_15)); + __pyx_cur_scope->__pyx_v_scores = __pyx_t_15; + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1098 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1097 * count = currcount * scores = [] * for model in models: # <<<<<<<<<<<<<< @@ -46204,26 +46211,34 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * yield Rule(self.category, f, e, */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_models) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_models)) { - __pyx_t_2 = __pyx_cur_scope->__pyx_v_models; __Pyx_INCREF(__pyx_t_2); __pyx_t_26 = 0; + __pyx_t_15 = __pyx_cur_scope->__pyx_v_models; __Pyx_INCREF(__pyx_t_15); __pyx_t_25 = 0; __pyx_t_27 = NULL; } else { - __pyx_t_26 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_models); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_27 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_25 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_models); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_27 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { - if (!__pyx_t_27 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_26 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_26); __Pyx_INCREF(__pyx_t_14); __pyx_t_26++; - } else if (!__pyx_t_27 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_26 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_26); __Pyx_INCREF(__pyx_t_14); __pyx_t_26++; + if (!__pyx_t_27 && PyList_CheckExact(__pyx_t_15)) { + if (__pyx_t_25 >= PyList_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_25); __Pyx_INCREF(__pyx_t_14); __pyx_t_25++; + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_15, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_27 && PyTuple_CheckExact(__pyx_t_15)) { + if (__pyx_t_25 >= PyTuple_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_25); __Pyx_INCREF(__pyx_t_14); __pyx_t_25++; + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_15, __pyx_t_25); __pyx_t_25++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_14 = __pyx_t_27(__pyx_t_2); + __pyx_t_14 = __pyx_t_27(__pyx_t_15); if (unlikely(!__pyx_t_14)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -46235,114 +46250,118 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_model = __pyx_t_14; __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1099 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1098 * scores = [] * for model in models: * scores.append(model(f, e, count, fcount[f], num_samples)) # <<<<<<<<<<<<<< * yield Rule(self.category, f, e, * scores=scores, word_alignments=alignment) */ - __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fcount), __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyTuple_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_count); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_count); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_count); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_14 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_cur_scope->__pyx_v_model, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_scores, __pyx_t_3); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = PyObject_Call(__pyx_cur_scope->__pyx_v_model, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_scores, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1100 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1099 * for model in models: * scores.append(model(f, e, count, fcount[f], num_samples)) * yield Rule(self.category, f, e, # <<<<<<<<<<<<<< * scores=scores, word_alignments=alignment) * */ - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __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_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_f); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_f); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_e); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_15 = 0; + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_15)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1101 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1100 * scores.append(model(f, e, count, fcount[f], num_samples)) * yield Rule(self.category, f, e, * scores=scores, word_alignments=alignment) # <<<<<<<<<<<<<< * * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: */ - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__scores), ((PyObject *)__pyx_cur_scope->__pyx_v_scores)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__word_alignments), __pyx_cur_scope->__pyx_v_alignment) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Rule)), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_15; - __pyx_t_15 = 0; + if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__scores), ((PyObject *)__pyx_cur_scope->__pyx_v_scores)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__word_alignments), __pyx_cur_scope->__pyx_v_alignment) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; + __Pyx_XGIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; + __pyx_cur_scope->__pyx_t_3 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_9); - __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; - __Pyx_XGIVEREF(__pyx_t_10); - __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; + __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_12); - __pyx_cur_scope->__pyx_t_4 = __pyx_t_12; - __pyx_cur_scope->__pyx_t_5 = __pyx_t_21; - __pyx_cur_scope->__pyx_t_6 = __pyx_t_24; - __pyx_cur_scope->__pyx_t_7 = __pyx_t_25; + __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; + __pyx_cur_scope->__pyx_t_6 = __pyx_t_18; + __pyx_cur_scope->__pyx_t_7 = __pyx_t_21; + __pyx_cur_scope->__pyx_t_8 = __pyx_t_22; + __pyx_cur_scope->__pyx_t_9 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; - __pyx_L63_resume_from_yield:; + __pyx_L59_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; - __pyx_cur_scope->__pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_12 = __pyx_cur_scope->__pyx_t_4; + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; + __pyx_t_6 = __pyx_cur_scope->__pyx_t_3; + __pyx_t_9 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; + __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_21 = __pyx_cur_scope->__pyx_t_5; - __pyx_t_24 = __pyx_cur_scope->__pyx_t_6; - __pyx_t_25 = __pyx_cur_scope->__pyx_t_7; - if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __pyx_cur_scope->__pyx_t_6; + __pyx_t_21 = __pyx_cur_scope->__pyx_t_7; + __pyx_t_22 = __pyx_cur_scope->__pyx_t_8; + __pyx_t_23 = __pyx_cur_scope->__pyx_t_9; + if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L45; @@ -46355,41 +46374,41 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } __pyx_L32:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1103 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1102 * scores=scores, word_alignments=alignment) * * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: # <<<<<<<<<<<<<< * for alt_id in range(len(fwords[i+spanlen])): * new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) */ - __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (__pyx_t_21 < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_19) { - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_21); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_9, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_15, __pyx_t_9, Py_LE); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_9, Py_LE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_28 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_28 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_28 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_28 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_29 = __pyx_t_28; } else { __pyx_t_29 = __pyx_t_8; @@ -46400,72 +46419,72 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1104 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1103 * * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: * for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<< * new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity */ - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_9); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_9); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_21 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_21 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_21; __pyx_t_18+=1) { __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_18; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1105 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1104 * if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: * for alt_id in range(len(fwords[i+spanlen])): * new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<< * num_subpatterns = arity * if not is_shadow_path: */ - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2); + __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_node); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_cur_scope->__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_node); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); - PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_cur_scope->__pyx_v_phrase); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_cur_scope->__pyx_v_is_shadow_path); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_cur_scope->__pyx_v_is_shadow_path); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - __pyx_t_10 = 0; - __pyx_t_15 = 0; - __pyx_t_9 = 0; __pyx_t_2 = 0; - __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = 0; + __pyx_t_9 = 0; + __pyx_t_15 = 0; + __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1106 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1105 * for alt_id in range(len(fwords[i+spanlen])): * new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity # <<<<<<<<<<<<<< @@ -46474,18 +46493,18 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx */ __pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1107 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1106 * new_frontier.append((k, i+spanlen, alt_id, pathlen + 1, node, phrase, is_shadow_path)) * num_subpatterns = arity * if not is_shadow_path: # <<<<<<<<<<<<<< * num_subpatterns = num_subpatterns + 1 * if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = (!__pyx_t_8); if (__pyx_t_19) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1108 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1107 * num_subpatterns = arity * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<< @@ -46493,18 +46512,18 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * xcat = sym_setindex(self.category, arity+1) */ __pyx_cur_scope->__pyx_v_num_subpatterns = (__pyx_cur_scope->__pyx_v_num_subpatterns + 1); - goto __pyx_L67; + goto __pyx_L63; } - __pyx_L67:; + __pyx_L63:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1109 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1108 * if not is_shadow_path: * num_subpatterns = num_subpatterns + 1 * if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: # <<<<<<<<<<<<<< * xcat = sym_setindex(self.category, arity+1) * xnode = node.children[xcat] */ - __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_21 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_19 = ((__pyx_t_21 + 1) < __pyx_cur_scope->__pyx_v_self->max_length); if (__pyx_t_19) { __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals); @@ -46520,168 +46539,168 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx } if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1110 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1109 * num_subpatterns = num_subpatterns + 1 * if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: * xcat = sym_setindex(self.category, arity+1) # <<<<<<<<<<<<<< * xnode = node.children[xcat] * # I put spanlen=1 below */ - __pyx_cur_scope->__pyx_v_xcat = __pyx_f_8_cdec_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); + __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1111 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1110 * if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: * xcat = sym_setindex(self.category, arity+1) * xnode = node.children[xcat] # <<<<<<<<<<<<<< * # I put spanlen=1 below * key = tuple([self.min_gap_size, i, 1, pathlen]) */ - __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xnode); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_xnode = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_15); + __pyx_cur_scope->__pyx_v_xnode = __pyx_t_15; + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1113 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1112 * xnode = node.children[xcat] * # I put spanlen=1 below * key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<< * frontier_nodes = [] * if (key in nodes_isteps_away_buffer): */ - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __Pyx_INCREF(__pyx_int_1); PyList_SET_ITEM(__pyx_t_9, 2, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); PyList_SET_ITEM(__pyx_t_9, 3, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = ((PyObject *)PyList_AsTuple(__pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_15 = 0; + __pyx_t_10 = 0; + __pyx_t_10 = ((PyObject *)PyList_AsTuple(__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_10)); __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_key)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_cur_scope->__pyx_v_key = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); + __pyx_cur_scope->__pyx_v_key = __pyx_t_10; + __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1114 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1113 * # I put spanlen=1 below * key = tuple([self.min_gap_size, i, 1, pathlen]) * frontier_nodes = [] # <<<<<<<<<<<<<< * if (key in nodes_isteps_away_buffer): * frontier_nodes = nodes_isteps_away_buffer[key] */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); + __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_10); + __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1115 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1114 * key = tuple([self.min_gap_size, i, 1, pathlen]) * frontier_nodes = [] * if (key in nodes_isteps_away_buffer): # <<<<<<<<<<<<<< * frontier_nodes = nodes_isteps_away_buffer[key] * else: */ - __pyx_t_8 = ((PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = ((PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1116 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1115 * frontier_nodes = [] * if (key in nodes_isteps_away_buffer): * frontier_nodes = nodes_isteps_away_buffer[key] # <<<<<<<<<<<<<< * else: * frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) */ - __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L69; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L65; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1118 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1117 * frontier_nodes = nodes_isteps_away_buffer[key] * else: * frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) # <<<<<<<<<<<<<< * nodes_isteps_away_buffer[key] = frontier_nodes * */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_121); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_121); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyTuple_New(7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); + __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_cur_scope->__pyx_v_pathlen); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_cur_scope->__pyx_v_pathlen); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords); - PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_cur_scope->__pyx_v_fwords); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_cur_scope->__pyx_v_fwords); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states)); - PyTuple_SET_ITEM(__pyx_t_15, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states)); + PyTuple_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states)); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); - PyTuple_SET_ITEM(__pyx_t_15, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); + PyTuple_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer)); __pyx_t_9 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_15); + __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_15; + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1119 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1118 * else: * frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) * nodes_isteps_away_buffer[key] = frontier_nodes # <<<<<<<<<<<<<< * * for (i, alt, pathlen) in frontier_nodes: */ - if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_L69:; + __pyx_L65:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1121 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1120 * nodes_isteps_away_buffer[key] = frontier_nodes * * for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<< @@ -46689,119 +46708,135 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * frontier = new_frontier */ if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) { - __pyx_t_2 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0; - __pyx_t_25 = NULL; + __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_21 = 0; + __pyx_t_27 = NULL; } else { - __pyx_t_21 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_25 = Py_TYPE(__pyx_t_2)->tp_iternext; + __pyx_t_21 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_27 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { - if (!__pyx_t_25 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_15 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_15); __pyx_t_21++; - } else if (!__pyx_t_25 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_21 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_15); __pyx_t_21++; + if (!__pyx_t_27 && PyList_CheckExact(__pyx_t_15)) { + if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_21); __Pyx_INCREF(__pyx_t_3); __pyx_t_21++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_27 && PyTuple_CheckExact(__pyx_t_15)) { + if (__pyx_t_21 >= PyTuple_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_21); __Pyx_INCREF(__pyx_t_3); __pyx_t_21++; + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_15 = __pyx_t_25(__pyx_t_2); - if (unlikely(!__pyx_t_15)) { + __pyx_t_3 = __pyx_t_27(__pyx_t_15); + if (unlikely(!__pyx_t_3)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_15); + __Pyx_GOTREF(__pyx_t_3); } - if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { - PyObject* sequence = __pyx_t_15; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 3)) { + if (size > 3) __Pyx_RaiseTooManyValuesError(3); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) { - if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 3)) { - if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); - __pyx_t_10 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = PyList_GET_ITEM(sequence, 2); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __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_14 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_14)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L72_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_9 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_9)) goto __pyx_L72_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 2; __pyx_t_10 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L72_unpacking_failed; + index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L68_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_14), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + index = 1; __pyx_t_9 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_9)) goto __pyx_L68_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 2; __pyx_t_2 = __pyx_t_17(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L68_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_14), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L73_unpacking_done; - __pyx_L72_unpacking_failed:; + goto __pyx_L69_unpacking_done; + __pyx_L68_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L73_unpacking_done:; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L69_unpacking_done:; } - __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_cur_scope->__pyx_v_i = __pyx_t_18; __pyx_cur_scope->__pyx_v_alt = __pyx_t_6; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pathlen); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_pathlen); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_10; - __pyx_t_10 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1122 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1121 * * for (i, alt, pathlen) in frontier_nodes: * new_frontier.append((k, i, alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<< * frontier = new_frontier * */ - __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyTuple_New(7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen); @@ -46810,30 +46845,30 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __Pyx_INCREF(__pyx_cur_scope->__pyx_v_xnode); PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_xnode); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode); - PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path); PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_cur_scope->__pyx_v_is_shadow_path); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path); - __pyx_t_15 = 0; - __pyx_t_10 = 0; - __pyx_t_9 = 0; __pyx_t_3 = 0; - __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L68; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L64; } - __pyx_L68:; - goto __pyx_L64; + __pyx_L64:; + goto __pyx_L60; } - __pyx_L64:; + __pyx_L60:; __pyx_L19_continue:; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1123 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1122 * for (i, alt, pathlen) in frontier_nodes: * new_frontier.append((k, i, alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) * frontier = new_frontier # <<<<<<<<<<<<<< @@ -46847,37 +46882,37 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1125 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1124 * frontier = new_frontier * * stop_time = monitor_cpu() # <<<<<<<<<<<<<< * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) * gc.collect() */ - __pyx_t_12 = PyFloat_FromDouble(__pyx_f_8_cdec_sa_monitor_cpu()); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_12; __pyx_t_12 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1126 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1125 * * stop_time = monitor_cpu() * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<< * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) */ - __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(((PyObject *)__pyx_kp_s_122)); PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_kp_s_122)); @@ -46885,55 +46920,55 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1127 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1126 * stop_time = monitor_cpu() * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) * gc.collect() # <<<<<<<<<<<<<< * logger.info(" Extract time = %f seconds", self.extract_time) * */ - __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__collect); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1128 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1127 * logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) * gc.collect() * logger.info(" Extract time = %f seconds", self.extract_time) # <<<<<<<<<<<<<< * * */ - __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_kp_s_123)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_123)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_kp_s_123)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_123)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; @@ -46952,11 +46987,12 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_generator->resume_label = -1; + __Pyx_Generator_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return NULL; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1131 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1130 * * * cdef int find_fixpoint(self, # <<<<<<<<<<<<<< @@ -46964,7 +47000,7 @@ static PyObject *__pyx_gb_8_cdec_sa_23HieroCachingRuleFactory_24generator1(__pyx * int* f_links_low, int* f_links_high, */ -static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_f_low, PyObject *__pyx_v_f_high, int *__pyx_v_f_links_low, int *__pyx_v_f_links_high, int *__pyx_v_e_links_low, int *__pyx_v_e_links_high, int __pyx_v_e_in_low, int __pyx_v_e_in_high, int *__pyx_v_e_low, int *__pyx_v_e_high, int *__pyx_v_f_back_low, int *__pyx_v_f_back_high, int __pyx_v_f_sent_len, int __pyx_v_e_sent_len, int __pyx_v_max_f_len, int __pyx_v_max_e_len, int __pyx_v_min_fx_size, int __pyx_v_min_ex_size, int __pyx_v_max_new_x, int __pyx_v_allow_low_x, int __pyx_v_allow_high_x, int __pyx_v_allow_arbitrary_x, CYTHON_UNUSED int __pyx_v_write_log) { +static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_f_low, PyObject *__pyx_v_f_high, int *__pyx_v_f_links_low, int *__pyx_v_f_links_high, int *__pyx_v_e_links_low, int *__pyx_v_e_links_high, int __pyx_v_e_in_low, int __pyx_v_e_in_high, int *__pyx_v_e_low, int *__pyx_v_e_high, int *__pyx_v_f_back_low, int *__pyx_v_f_back_high, int __pyx_v_f_sent_len, int __pyx_v_e_sent_len, int __pyx_v_max_f_len, int __pyx_v_max_e_len, int __pyx_v_min_fx_size, int __pyx_v_min_ex_size, int __pyx_v_max_new_x, int __pyx_v_allow_low_x, int __pyx_v_allow_high_x, int __pyx_v_allow_arbitrary_x, CYTHON_UNUSED int __pyx_v_write_log) { int __pyx_v_e_low_prev; int __pyx_v_e_high_prev; int __pyx_v_f_low_prev; @@ -46986,7 +47022,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("find_fixpoint", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1146 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1145 * cdef int e_low_prev, e_high_prev, f_low_prev, f_high_prev, new_x, new_low_x, new_high_x * * e_low[0] = e_in_low # <<<<<<<<<<<<<< @@ -46995,7 +47031,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_e_low[0]) = __pyx_v_e_in_low; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1147 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1146 * * e_low[0] = e_in_low * e_high[0] = e_in_high # <<<<<<<<<<<<<< @@ -47004,19 +47040,19 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_e_high[0]) = __pyx_v_e_in_high; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1148 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1147 * e_low[0] = e_in_low * e_high[0] = e_in_high * self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<< * if e_low[0] == -1: * # low-priority corner case: if phrase w is unaligned, */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1149 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1148 * e_high[0] = e_in_high * self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high) * if e_low[0] == -1: # <<<<<<<<<<<<<< @@ -47026,7 +47062,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_3 = ((__pyx_v_e_low[0]) == -1); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1155 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1154 * # rule X -> X_1 w X_2 / X_1 X_2. This is probably * # not worth the bother, though. * return 0 # <<<<<<<<<<<<<< @@ -47038,7 +47074,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py goto __pyx_L3; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1156 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1155 * # not worth the bother, though. * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<< @@ -47054,7 +47090,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1157 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1156 * return 0 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<< @@ -47064,7 +47100,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_5 = ((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size); if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1158 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1157 * elif e_in_low != -1 and e_low[0] != e_in_low: * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size # <<<<<<<<<<<<<< @@ -47073,7 +47109,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1159 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1158 * if e_in_low - e_low[0] < min_ex_size: * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: # <<<<<<<<<<<<<< @@ -47083,7 +47119,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_5 = ((__pyx_v_e_low[0]) < 0); if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1160 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1159 * e_low[0] = e_in_low - min_ex_size * if e_low[0] < 0: * return 0 # <<<<<<<<<<<<<< @@ -47102,7 +47138,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L3:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1162 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1161 * return 0 * * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -47112,7 +47148,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_5 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1163 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1162 * * if e_high[0] - e_low[0] > max_e_len: * return 0 # <<<<<<<<<<<<<< @@ -47124,7 +47160,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py goto __pyx_L6; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1164 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1163 * if e_high[0] - e_low[0] > max_e_len: * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<< @@ -47140,7 +47176,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1165 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1164 * return 0 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<< @@ -47150,7 +47186,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1166 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1165 * elif e_in_high != -1 and e_high[0] != e_in_high: * if e_high[0] - e_in_high < min_ex_size: * e_high[0] = e_in_high + min_ex_size # <<<<<<<<<<<<<< @@ -47159,7 +47195,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1167 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1166 * if e_high[0] - e_in_high < min_ex_size: * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: # <<<<<<<<<<<<<< @@ -47169,7 +47205,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_e_high[0]) > __pyx_v_e_sent_len); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1168 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1167 * e_high[0] = e_in_high + min_ex_size * if e_high[0] > e_sent_len: * return 0 # <<<<<<<<<<<<<< @@ -47188,7 +47224,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L6:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1170 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1169 * return 0 * * f_back_low[0] = -1 # <<<<<<<<<<<<<< @@ -47197,7 +47233,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_f_back_low[0]) = -1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1171 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1170 * * f_back_low[0] = -1 * f_back_high[0] = -1 # <<<<<<<<<<<<<< @@ -47206,7 +47242,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_f_back_high[0]) = -1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1172 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1171 * f_back_low[0] = -1 * f_back_high[0] = -1 * f_low_prev = f_low # <<<<<<<<<<<<<< @@ -47215,17 +47251,17 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_f_low_prev = __pyx_v_f_low; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1173 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1172 * f_back_high[0] = -1 * f_low_prev = f_low * f_high_prev = f_high # <<<<<<<<<<<<<< * new_x = 0 * new_low_x = 0 */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f_high_prev = __pyx_t_1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1174 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1173 * f_low_prev = f_low * f_high_prev = f_high * new_x = 0 # <<<<<<<<<<<<<< @@ -47234,7 +47270,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_new_x = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1175 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1174 * f_high_prev = f_high * new_x = 0 * new_low_x = 0 # <<<<<<<<<<<<<< @@ -47243,7 +47279,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_new_low_x = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1176 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1175 * new_x = 0 * new_low_x = 0 * new_high_x = 0 # <<<<<<<<<<<<<< @@ -47252,7 +47288,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_new_high_x = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1178 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1177 * new_high_x = 0 * * while True: # <<<<<<<<<<<<<< @@ -47262,7 +47298,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py while (1) { if (!1) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1180 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1179 * while True: * * if f_back_low[0] == -1: # <<<<<<<<<<<<<< @@ -47272,45 +47308,45 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_f_back_low[0]) == -1); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1181 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1180 * * if f_back_low[0] == -1: * self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<< * else: * self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L11; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1183 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1182 * self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) * else: * self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<< * self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) * */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1184 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1183 * else: * self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) * self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<< * * if f_back_low[0] > f_low: */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L11:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1186 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1185 * self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) * * if f_back_low[0] > f_low: # <<<<<<<<<<<<<< @@ -47320,7 +47356,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_f_back_low[0]) > __pyx_v_f_low); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1187 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1186 * * if f_back_low[0] > f_low: * f_back_low[0] = f_low # <<<<<<<<<<<<<< @@ -47332,36 +47368,36 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L12:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1189 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1188 * f_back_low[0] = f_low * * if f_back_high[0] < f_high: # <<<<<<<<<<<<<< * f_back_high[0] = f_high * */ - __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1190 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1189 * * if f_back_high[0] < f_high: * f_back_high[0] = f_high # <<<<<<<<<<<<<< * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_f_back_high[0]) = __pyx_t_1; goto __pyx_L13; } __pyx_L13:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1192 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1191 * f_back_high[0] = f_high * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<< @@ -47377,7 +47413,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1193 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1192 * * if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: * return 1 # <<<<<<<<<<<<<< @@ -47390,7 +47426,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L14:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1195 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1194 * return 1 * * if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<< @@ -47406,7 +47442,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1197 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1196 * if allow_low_x == 0 and f_back_low[0] < f_low: * # FAIL: f phrase is not tight * return 0 # <<<<<<<<<<<<<< @@ -47419,7 +47455,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L15:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1199 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1198 * return 0 * * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -47429,7 +47465,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_5 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_5) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1201 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1200 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: f back projection is too wide * return 0 # <<<<<<<<<<<<<< @@ -47442,7 +47478,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L16:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1203 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1202 * return 0 * * if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<< @@ -47451,12 +47487,12 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_t_5 = (__pyx_v_allow_high_x == 0); if (__pyx_t_5) { - __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; } else { @@ -47464,7 +47500,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1205 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1204 * if allow_high_x == 0 and f_back_high[0] > f_high: * # FAIL: extension on high side not allowed * return 0 # <<<<<<<<<<<<<< @@ -47477,7 +47513,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L17:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1207 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1206 * return 0 * * if f_low != f_back_low[0]: # <<<<<<<<<<<<<< @@ -47487,7 +47523,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (__pyx_v_f_low != (__pyx_v_f_back_low[0])); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1208 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1207 * * if f_low != f_back_low[0]: * if new_low_x == 0: # <<<<<<<<<<<<<< @@ -47497,7 +47533,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (__pyx_v_new_low_x == 0); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1209 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1208 * if f_low != f_back_low[0]: * if new_low_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -47507,7 +47543,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1211 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1210 * if new_x >= max_new_x: * # FAIL: extension required on low side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -47520,7 +47556,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1213 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1212 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -47529,7 +47565,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1214 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1213 * else: * new_x = new_x + 1 * new_low_x = 1 # <<<<<<<<<<<<<< @@ -47543,7 +47579,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L19:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1215 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1214 * new_x = new_x + 1 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<< @@ -47553,7 +47589,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1216 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1215 * new_low_x = 1 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<< @@ -47562,7 +47598,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ (__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1217 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1216 * if f_low - f_back_low[0] < min_fx_size: * f_back_low[0] = f_low - min_fx_size * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -47572,7 +47608,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1219 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1218 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on low side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -47585,7 +47621,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L22:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1220 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1219 * # FAIL: extension required on low side violates max initial length * return 0 * if f_back_low[0] < 0: # <<<<<<<<<<<<<< @@ -47595,7 +47631,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_f_back_low[0]) < 0); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1222 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1221 * if f_back_low[0] < 0: * # FAIL: extension required on low side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -47614,23 +47650,23 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L18:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1224 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1223 * return 0 * * if f_high != f_back_high[0]: # <<<<<<<<<<<<<< * if new_high_x == 0: * if new_x >= max_new_x: */ - __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1225 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1224 * * if f_high != f_back_high[0]: * if new_high_x == 0: # <<<<<<<<<<<<<< @@ -47640,7 +47676,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (__pyx_v_new_high_x == 0); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1226 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1225 * if f_high != f_back_high[0]: * if new_high_x == 0: * if new_x >= max_new_x: # <<<<<<<<<<<<<< @@ -47650,7 +47686,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1228 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1227 * if new_x >= max_new_x: * # FAIL: extension required on high side violates max # of gaps * return 0 # <<<<<<<<<<<<<< @@ -47663,7 +47699,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1230 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1229 * return 0 * else: * new_x = new_x + 1 # <<<<<<<<<<<<<< @@ -47672,7 +47708,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_new_x = (__pyx_v_new_x + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1231 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1230 * else: * new_x = new_x + 1 * new_high_x = 1 # <<<<<<<<<<<<<< @@ -47686,45 +47722,45 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L25:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1232 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1231 * new_x = new_x + 1 * new_high_x = 1 * if f_back_high[0] - f_high < min_fx_size: # <<<<<<<<<<<<<< * f_back_high[0] = f_high + min_fx_size * if f_back_high[0] - f_back_low[0] > max_f_len: */ - __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1233 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1232 * new_high_x = 1 * if f_back_high[0] - f_high < min_fx_size: * f_back_high[0] = f_high + min_fx_size # <<<<<<<<<<<<<< * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_f_back_high[0]) = __pyx_t_1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1234 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1233 * if f_back_high[0] - f_high < min_fx_size: * f_back_high[0] = f_high + min_fx_size * if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<< @@ -47734,7 +47770,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1236 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1235 * if f_back_high[0] - f_back_low[0] > max_f_len: * # FAIL: extension required on high side violates max initial length * return 0 # <<<<<<<<<<<<<< @@ -47747,7 +47783,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L28:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1237 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1236 * # FAIL: extension required on high side violates max initial length * return 0 * if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<< @@ -47757,7 +47793,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_4 = ((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len); if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1239 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1238 * if f_back_high[0] > f_sent_len: * # FAIL: extension required on high side violates sentence boundary * return 0 # <<<<<<<<<<<<<< @@ -47776,7 +47812,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L24:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1241 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1240 * return 0 * * e_low_prev = e_low[0] # <<<<<<<<<<<<<< @@ -47785,7 +47821,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_e_low_prev = (__pyx_v_e_low[0]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1242 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1241 * * e_low_prev = e_low[0] * e_high_prev = e_high[0] # <<<<<<<<<<<<<< @@ -47794,29 +47830,29 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_e_high_prev = (__pyx_v_e_high[0]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1244 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1243 * e_high_prev = e_high[0] * * self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<< * self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: */ - __pyx_t_6 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1245 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1244 * * self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) * self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<< * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 */ - __pyx_t_6 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1246 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1245 * self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) * self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: # <<<<<<<<<<<<<< @@ -47832,7 +47868,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1247 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1246 * self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 # <<<<<<<<<<<<<< @@ -47845,7 +47881,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L30:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1248 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1247 * if e_low[0] == e_low_prev and e_high[0] == e_high_prev: * return 1 * if allow_arbitrary_x == 0: # <<<<<<<<<<<<<< @@ -47855,7 +47891,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_3 = (__pyx_v_allow_arbitrary_x == 0); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1250 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1249 * if allow_arbitrary_x == 0: * # FAIL: arbitrary expansion not permitted * return 0 # <<<<<<<<<<<<<< @@ -47868,7 +47904,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L31:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1251 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1250 * # FAIL: arbitrary expansion not permitted * return 0 * if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<< @@ -47878,7 +47914,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __pyx_t_3 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len); if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1253 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1252 * if e_high[0] - e_low[0] > max_e_len: * # FAIL: re-projection violates sentence max phrase length * return 0 # <<<<<<<<<<<<<< @@ -47891,7 +47927,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py } __pyx_L32:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1254 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1253 * # FAIL: re-projection violates sentence max phrase length * return 0 * f_low_prev = f_back_low[0] # <<<<<<<<<<<<<< @@ -47900,7 +47936,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py */ __pyx_v_f_low_prev = (__pyx_v_f_back_low[0]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1255 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1254 * return 0 * f_low_prev = f_back_low[0] * f_high_prev = f_back_high[0] # <<<<<<<<<<<<<< @@ -47916,14 +47952,14 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_WriteUnraisable("_cdec_sa.HieroCachingRuleFactory.find_fixpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_WriteUnraisable("_sa.HieroCachingRuleFactory.find_fixpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1258 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1257 * * * cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<< @@ -47931,7 +47967,7 @@ static int __pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint(struct __py * cdef int i */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_in_low, int __pyx_v_in_high, int *__pyx_v_in_links_low, int *__pyx_v_in_links_high, int *__pyx_v_out_low, int *__pyx_v_out_high) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_UNUSED struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_in_low, int __pyx_v_in_high, int *__pyx_v_in_links_low, int *__pyx_v_in_links_high, int *__pyx_v_out_low, int *__pyx_v_out_high) { int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -47941,7 +47977,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT int __pyx_t_4; __Pyx_RefNannySetupContext("find_projection", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1261 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1260 * int* out_low, int* out_high): * cdef int i * for i from in_low <= i < in_high: # <<<<<<<<<<<<<< @@ -47951,7 +47987,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT __pyx_t_1 = __pyx_v_in_high; for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1262 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1261 * cdef int i * for i from in_low <= i < in_high: * if in_links_low[i] != -1: # <<<<<<<<<<<<<< @@ -47961,7 +47997,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT __pyx_t_2 = ((__pyx_v_in_links_low[__pyx_v_i]) != -1); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1263 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1262 * for i from in_low <= i < in_high: * if in_links_low[i] != -1: * if out_low[0] == -1 or in_links_low[i] < out_low[0]: # <<<<<<<<<<<<<< @@ -47977,7 +48013,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT } if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1264 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1263 * if in_links_low[i] != -1: * if out_low[0] == -1 or in_links_low[i] < out_low[0]: * out_low[0] = in_links_low[i] # <<<<<<<<<<<<<< @@ -47989,7 +48025,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT } __pyx_L6:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1265 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1264 * if out_low[0] == -1 or in_links_low[i] < out_low[0]: * out_low[0] = in_links_low[i] * if out_high[0] == -1 or in_links_high[i] > out_high[0]: # <<<<<<<<<<<<<< @@ -48005,7 +48041,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT } if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1266 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1265 * out_low[0] = in_links_low[i] * if out_high[0] == -1 or in_links_high[i] > out_high[0]: * out_high[0] = in_links_high[i] # <<<<<<<<<<<<<< @@ -48027,7 +48063,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1269 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1268 * * * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<< @@ -48035,13 +48071,13 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection(CYT * new_len = arr_len[0] + data_len */ -static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int *__pyx_v_arr, int *__pyx_v_arr_len, int *__pyx_v_data, int __pyx_v_data_len) { +static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int *__pyx_v_arr, int *__pyx_v_arr_len, int *__pyx_v_data, int __pyx_v_data_len) { int __pyx_v_new_len; int *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("int_arr_extend", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1271 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1270 * cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): * cdef int new_len * new_len = arr_len[0] + data_len # <<<<<<<<<<<<<< @@ -48050,7 +48086,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN */ __pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1272 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1271 * cdef int new_len * new_len = arr_len[0] + data_len * arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -48059,7 +48095,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN */ __pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1273 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1272 * new_len = arr_len[0] + data_len * arr = <int*> realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -48068,7 +48104,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN */ memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int)))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1274 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1273 * arr = <int*> realloc(arr, new_len*sizeof(int)) * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len # <<<<<<<<<<<<<< @@ -48077,7 +48113,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN */ (__pyx_v_arr_len[0]) = __pyx_v_new_len; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1275 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1274 * memcpy(arr+arr_len[0], data, data_len*sizeof(int)) * arr_len[0] = new_len * return arr # <<<<<<<<<<<<<< @@ -48093,7 +48129,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1278 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1277 * * * cdef extract_phrases(self, int e_low, int e_high, int* e_gap_low, int* e_gap_high, int* e_links_low, int num_gaps, # <<<<<<<<<<<<<< @@ -48101,7 +48137,7 @@ static int *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UN * int sent_id, int e_sent_len, int e_sent_start): */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_e_low, int __pyx_v_e_high, int *__pyx_v_e_gap_low, int *__pyx_v_e_gap_high, int *__pyx_v_e_links_low, int __pyx_v_num_gaps, CYTHON_UNUSED int __pyx_v_f_low, CYTHON_UNUSED int __pyx_v_f_high, CYTHON_UNUSED int *__pyx_v_f_gap_low, CYTHON_UNUSED int *__pyx_v_f_gap_high, CYTHON_UNUSED int *__pyx_v_f_links_low, CYTHON_UNUSED int __pyx_v_sent_id, int __pyx_v_e_sent_len, int __pyx_v_e_sent_start) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int __pyx_v_e_low, int __pyx_v_e_high, int *__pyx_v_e_gap_low, int *__pyx_v_e_gap_high, int *__pyx_v_e_links_low, int __pyx_v_num_gaps, CYTHON_UNUSED int __pyx_v_f_low, CYTHON_UNUSED int __pyx_v_f_high, CYTHON_UNUSED int *__pyx_v_f_gap_low, CYTHON_UNUSED int *__pyx_v_f_gap_high, CYTHON_UNUSED int *__pyx_v_f_links_low, CYTHON_UNUSED int __pyx_v_sent_id, int __pyx_v_e_sent_len, int __pyx_v_e_sent_start) { int __pyx_v_i; int __pyx_v_j; int __pyx_v_k; @@ -48118,7 +48154,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str int __pyx_v_len2; int __pyx_v_step; int __pyx_v_num_chunks; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_ephr_arr = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_ephr_arr = 0; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_indexes = NULL; PyObject *__pyx_r = NULL; @@ -48139,19 +48175,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract_phrases", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1286 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1285 * cdef result * * result = [] # <<<<<<<<<<<<<< * len1 = 0 * e_gaps1 = <int*> malloc(0) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1287 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1286 * * result = [] * len1 = 0 # <<<<<<<<<<<<<< @@ -48160,7 +48196,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_len1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1288 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1287 * result = [] * len1 = 0 * e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<< @@ -48169,19 +48205,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gaps1 = ((int *)malloc(0)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1289 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1288 * len1 = 0 * e_gaps1 = <int*> malloc(0) * ephr_arr = IntList() # <<<<<<<<<<<<<< * * e_gap_order = <int*> malloc(num_gaps*sizeof(int)) */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ephr_arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_ephr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1291 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1290 * ephr_arr = IntList() * * e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<< @@ -48190,7 +48226,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1292 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1291 * * e_gap_order = <int*> malloc(num_gaps*sizeof(int)) * if num_gaps > 0: # <<<<<<<<<<<<<< @@ -48200,7 +48236,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = (__pyx_v_num_gaps > 0); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1293 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1292 * e_gap_order = <int*> malloc(num_gaps*sizeof(int)) * if num_gaps > 0: * e_gap_order[0] = 0 # <<<<<<<<<<<<<< @@ -48209,7 +48245,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ (__pyx_v_e_gap_order[0]) = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1294 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1293 * if num_gaps > 0: * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -48219,7 +48255,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1295 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1294 * e_gap_order[0] = 0 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: # <<<<<<<<<<<<<< @@ -48229,7 +48265,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_4 = __pyx_v_i; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1296 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1295 * for i from 1 <= i < num_gaps: * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<< @@ -48239,7 +48275,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = ((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1297 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1296 * for j from 0 <= j < i: * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: # <<<<<<<<<<<<<< @@ -48249,7 +48285,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_5 = __pyx_v_i; for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1298 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1297 * if e_gap_low[i] < e_gap_low[j]: * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<< @@ -48259,7 +48295,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str (__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1299 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1298 * for k from j <= k < i: * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i # <<<<<<<<<<<<<< @@ -48268,7 +48304,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ (__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1300 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1299 * e_gap_order[k+1] = e_gap_order[k] * e_gap_order[j] = i * break # <<<<<<<<<<<<<< @@ -48282,7 +48318,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1302 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1301 * break * else: * e_gap_order[i] = i # <<<<<<<<<<<<<< @@ -48297,7 +48333,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } __pyx_L3:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1304 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1303 * e_gap_order[i] = i * * e_x_low = e_low # <<<<<<<<<<<<<< @@ -48306,7 +48342,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_x_low = __pyx_v_e_low; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1305 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1304 * * e_x_low = e_low * e_x_high = e_high # <<<<<<<<<<<<<< @@ -48315,7 +48351,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_x_high = __pyx_v_e_high; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1306 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1305 * e_x_low = e_low * e_x_high = e_high * if self.tight_phrases == 0: # <<<<<<<<<<<<<< @@ -48325,7 +48361,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = (__pyx_v_self->tight_phrases == 0); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1307 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1306 * e_x_high = e_high * if self.tight_phrases == 0: * while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: # <<<<<<<<<<<<<< @@ -48348,7 +48384,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (!__pyx_t_6) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1308 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1307 * if self.tight_phrases == 0: * while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: * e_x_low = e_x_low - 1 # <<<<<<<<<<<<<< @@ -48358,7 +48394,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_v_e_x_low = (__pyx_v_e_x_low - 1); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1309 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1308 * while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: * e_x_low = e_x_low - 1 * while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1: # <<<<<<<<<<<<<< @@ -48381,7 +48417,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (!__pyx_t_2) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1310 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1309 * e_x_low = e_x_low - 1 * while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1: * e_x_high = e_x_high + 1 # <<<<<<<<<<<<<< @@ -48394,7 +48430,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } __pyx_L11:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1312 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1311 * e_x_high = e_x_high + 1 * * for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<< @@ -48404,17 +48440,17 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_3 = __pyx_v_e_low; for (__pyx_v_i = __pyx_v_e_x_low; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1313 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1312 * * for i from e_x_low <= i <= e_low: * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<< * * for i from 0 <= i < num_gaps: */ - __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1); + __pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1315 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1314 * e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) * * for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<< @@ -48424,7 +48460,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1316 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1315 * * for i from 0 <= i < num_gaps: * e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<< @@ -48433,7 +48469,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1317 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1316 * for i from 0 <= i < num_gaps: * e_gaps2 = <int*> malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -48442,7 +48478,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_len2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1319 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1318 * len2 = 0 * * j = e_gap_order[i] # <<<<<<<<<<<<<< @@ -48451,7 +48487,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1320 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1319 * * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<< @@ -48460,7 +48496,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1321 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1320 * j = e_gap_order[i] * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<< @@ -48469,7 +48505,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1322 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1321 * e_x_gap_low = e_gap_low[j] * e_x_gap_high = e_gap_high[j] * if self.tight_phrases == 0: # <<<<<<<<<<<<<< @@ -48479,7 +48515,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = (__pyx_v_self->tight_phrases == 0); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1323 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1322 * e_x_gap_high = e_gap_high[j] * if self.tight_phrases == 0: * while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<< @@ -48496,7 +48532,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (!__pyx_t_7) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1324 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1323 * if self.tight_phrases == 0: * while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: * e_x_gap_low = e_x_gap_low - 1 # <<<<<<<<<<<<<< @@ -48506,7 +48542,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1325 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1324 * while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: * e_x_gap_low = e_x_gap_low - 1 * while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1: # <<<<<<<<<<<<<< @@ -48523,7 +48559,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (!__pyx_t_6) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1326 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1325 * e_x_gap_low = e_x_gap_low - 1 * while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1: * e_x_gap_high = e_x_gap_high + 1 # <<<<<<<<<<<<<< @@ -48536,7 +48572,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } __pyx_L20:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1328 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1327 * e_x_gap_high = e_x_gap_high + 1 * * k = 0 # <<<<<<<<<<<<<< @@ -48545,7 +48581,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_k = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1329 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1328 * * k = 0 * step = 1+(i*2) # <<<<<<<<<<<<<< @@ -48554,7 +48590,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_step = (1 + (__pyx_v_i * 2)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1330 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1329 * k = 0 * step = 1+(i*2) * while k < len1: # <<<<<<<<<<<<<< @@ -48565,7 +48601,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_6 = (__pyx_v_k < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1331 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1330 * step = 1+(i*2) * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<< @@ -48575,7 +48611,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_4 = (__pyx_v_e_gap_low[__pyx_v_j]); for (__pyx_v_m = __pyx_v_e_x_gap_low; __pyx_v_m <= __pyx_t_4; __pyx_v_m++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1332 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1331 * while k < len1: * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<< @@ -48585,7 +48621,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_6 = (__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])); if (__pyx_t_6) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1333 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1332 * for m from e_x_gap_low <= m <= e_gap_low[j]: * if m >= e_gaps1[k+step-1]: * for n from e_gap_high[j] <= n <= e_x_gap_high: # <<<<<<<<<<<<<< @@ -48595,7 +48631,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_5 = __pyx_v_e_x_gap_high; for (__pyx_v_n = (__pyx_v_e_gap_high[__pyx_v_j]); __pyx_v_n <= __pyx_t_5; __pyx_v_n++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1334 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1333 * if m >= e_gaps1[k+step-1]: * for n from e_gap_high[j] <= n <= e_x_gap_high: * if n-m >= 1: # extractor.py doesn't restrict target-side gap length # <<<<<<<<<<<<<< @@ -48605,32 +48641,32 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_6 = ((__pyx_v_n - __pyx_v_m) >= 1); if (__pyx_t_6) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1335 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1334 * for n from e_gap_high[j] <= n <= e_x_gap_high: * if n-m >= 1: # extractor.py doesn't restrict target-side gap length * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step) # <<<<<<<<<<<<<< * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) */ - __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step); + __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1336 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1335 * if n-m >= 1: # extractor.py doesn't restrict target-side gap length * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) # <<<<<<<<<<<<<< * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step */ - __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1); + __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1337 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1336 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) # <<<<<<<<<<<<<< * k = k + step * free(e_gaps1) */ - __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_n), 1); + __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_n), 1); goto __pyx_L32; } __pyx_L32:; @@ -48640,7 +48676,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_L29:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1338 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1337 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step # <<<<<<<<<<<<<< @@ -48650,7 +48686,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_v_k = (__pyx_v_k + __pyx_v_step); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1339 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1338 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) * k = k + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -48659,7 +48695,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ free(__pyx_v_e_gaps1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1340 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1339 * k = k + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -48668,7 +48704,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1341 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1340 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -48678,7 +48714,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_v_len1 = __pyx_v_len2; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1343 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1342 * len1 = len2 * * step = 1+(num_gaps*2) # <<<<<<<<<<<<<< @@ -48687,7 +48723,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_step = (1 + (__pyx_v_num_gaps * 2)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1344 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1343 * * step = 1+(num_gaps*2) * e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<< @@ -48696,7 +48732,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gaps2 = ((int *)malloc(0)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1345 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1344 * step = 1+(num_gaps*2) * e_gaps2 = <int*> malloc(0) * len2 = 0 # <<<<<<<<<<<<<< @@ -48705,7 +48741,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_len2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1346 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1345 * e_gaps2 = <int*> malloc(0) * len2 = 0 * for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<< @@ -48715,7 +48751,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_3 = __pyx_v_e_x_high; for (__pyx_v_i = __pyx_v_e_high; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1347 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1346 * len2 = 0 * for i from e_high <= i <= e_x_high: * j = 0 # <<<<<<<<<<<<<< @@ -48724,7 +48760,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_j = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1348 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1347 * for i from e_high <= i <= e_x_high: * j = 0 * while j < len1: # <<<<<<<<<<<<<< @@ -48735,7 +48771,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_6 = (__pyx_v_j < __pyx_v_len1); if (!__pyx_t_6) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1349 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1348 * j = 0 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<< @@ -48751,28 +48787,28 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1350 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1349 * while j < len1: * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step) # <<<<<<<<<<<<<< * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step */ - __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step); + __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1351 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1350 * if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) # <<<<<<<<<<<<<< * j = j + step * free(e_gaps1) */ - __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_i), 1); + __pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_i), 1); goto __pyx_L37; } __pyx_L37:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1352 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1351 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step) * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step # <<<<<<<<<<<<<< @@ -48783,7 +48819,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1353 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1352 * e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) * j = j + step * free(e_gaps1) # <<<<<<<<<<<<<< @@ -48792,7 +48828,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ free(__pyx_v_e_gaps1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1354 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1353 * j = j + step * free(e_gaps1) * e_gaps1 = e_gaps2 # <<<<<<<<<<<<<< @@ -48801,7 +48837,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_e_gaps1 = __pyx_v_e_gaps2; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1355 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1354 * free(e_gaps1) * e_gaps1 = e_gaps2 * len1 = len2 # <<<<<<<<<<<<<< @@ -48810,7 +48846,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_len1 = __pyx_v_len2; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1357 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1356 * len1 = len2 * * step = (num_gaps+1)*2 # <<<<<<<<<<<<<< @@ -48819,7 +48855,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_step = ((__pyx_v_num_gaps + 1) * 2); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1358 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1357 * * step = (num_gaps+1)*2 * i = 0 # <<<<<<<<<<<<<< @@ -48828,7 +48864,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_i = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1360 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1359 * i = 0 * * while i < len1: # <<<<<<<<<<<<<< @@ -48839,16 +48875,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = (__pyx_v_i < __pyx_v_len1); if (!__pyx_t_2) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1361 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1360 * * while i < len1: * ephr_arr._clear() # <<<<<<<<<<<<<< * num_chunks = 0 * indexes = [] */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1362 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1361 * while i < len1: * ephr_arr._clear() * num_chunks = 0 # <<<<<<<<<<<<<< @@ -48857,20 +48893,20 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_num_chunks = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1363 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1362 * ephr_arr._clear() * num_chunks = 0 * indexes = [] # <<<<<<<<<<<<<< * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(((PyObject *)__pyx_v_indexes)); __pyx_v_indexes = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1364 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1363 * num_chunks = 0 * indexes = [] * for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<< @@ -48880,7 +48916,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_9 = (__pyx_v_num_gaps + 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1365 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1364 * indexes = [] * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -48890,7 +48926,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = ((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)])); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1366 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1365 * for j from 0 <= j < num_gaps+1: * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: * num_chunks = num_chunks + 1 # <<<<<<<<<<<<<< @@ -48902,7 +48938,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } __pyx_L42:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1367 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1366 * if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: * num_chunks = num_chunks + 1 * for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<< @@ -48912,19 +48948,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_3 = (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]); for (__pyx_v_k = (__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]); __pyx_v_k < __pyx_t_3; __pyx_v_k++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1368 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1367 * num_chunks = num_chunks + 1 * for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: * indexes.append(k) # <<<<<<<<<<<<<< * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1369 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1368 * for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) # <<<<<<<<<<<<<< @@ -48932,14 +48968,14 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) */ __pyx_t_4 = (__pyx_v_self->eda->data->arr[(__pyx_v_e_sent_start + __pyx_v_k)]); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1370 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1369 * indexes.append(k) * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: # <<<<<<<<<<<<<< @@ -48949,32 +48985,32 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_t_2 = (__pyx_v_j < __pyx_v_num_gaps); if (__pyx_t_2) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1371 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1370 * ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) * if j < num_gaps: * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<< * ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) * i = i + step */ - __pyx_t_1 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1372 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1371 * if j < num_gaps: * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) * ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<< * i = i + step * if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); goto __pyx_L45; } __pyx_L45:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1373 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1372 * indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) * ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) * i = i + step # <<<<<<<<<<<<<< @@ -48983,7 +49019,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ __pyx_v_i = (__pyx_v_i + __pyx_v_step); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1374 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1373 * ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) * i = i + step * if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: # <<<<<<<<<<<<<< @@ -48999,22 +49035,22 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1375 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1374 * i = i + step * if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: * result.append((Phrase(ephr_arr),indexes)) # <<<<<<<<<<<<<< * * free(e_gaps1) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_ephr_arr)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ephr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ephr_arr)); - __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); @@ -49022,7 +49058,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_indexes)); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -49031,7 +49067,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_L46:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1377 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1376 * result.append((Phrase(ephr_arr),indexes)) * * free(e_gaps1) # <<<<<<<<<<<<<< @@ -49040,7 +49076,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ free(__pyx_v_e_gaps1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1378 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1377 * * free(e_gaps1) * free(e_gap_order) # <<<<<<<<<<<<<< @@ -49049,7 +49085,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str */ free(__pyx_v_e_gap_order); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1379 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1378 * free(e_gaps1) * free(e_gap_order) * return result # <<<<<<<<<<<<<< @@ -49066,7 +49102,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.extract_phrases", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.extract_phrases", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ephr_arr); @@ -49077,7 +49113,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1381 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1380 * return result * * cdef create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<< @@ -49085,9 +49121,9 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases(str * ret = IntList() */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(CYTHON_UNUSED struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, int *__pyx_v_sent_links, int __pyx_v_num_links, PyObject *__pyx_v_findexes, PyObject *__pyx_v_eindexes) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_create_alignments(CYTHON_UNUSED struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, int *__pyx_v_sent_links, int __pyx_v_num_links, PyObject *__pyx_v_findexes, PyObject *__pyx_v_eindexes) { unsigned int __pyx_v_i; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_ret = NULL; + struct __pyx_obj_3_sa_IntList *__pyx_v_ret = NULL; PyObject *__pyx_v_s = NULL; PyObject *__pyx_v_idx = NULL; PyObject *__pyx_v_j = NULL; @@ -49105,56 +49141,56 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_alignments", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1383 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1382 * cdef create_alignments(self, int* sent_links, int num_links, findexes, eindexes): * cdef unsigned i * ret = IntList() # <<<<<<<<<<<<<< * for i in range(len(findexes)): * s = findexes[i] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_ret = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_ret = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1384 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1383 * cdef unsigned i * ret = IntList() * for i in range(len(findexes)): # <<<<<<<<<<<<<< * s = findexes[i] * if (s<0): */ - __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1385 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1384 * ret = IntList() * for i in range(len(findexes)): * s = findexes[i] # <<<<<<<<<<<<<< * if (s<0): * continue */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_s); __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1386 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1385 * for i in range(len(findexes)): * s = findexes[i] * if (s<0): # <<<<<<<<<<<<<< * continue * idx = 0 */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1387 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1386 * s = findexes[i] * if (s<0): * continue # <<<<<<<<<<<<<< @@ -49166,7 +49202,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C } __pyx_L5:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1388 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1387 * if (s<0): * continue * idx = 0 # <<<<<<<<<<<<<< @@ -49177,7 +49213,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C __Pyx_XDECREF(__pyx_v_idx); __pyx_v_idx = __pyx_int_0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1389 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1388 * continue * idx = 0 * while (idx < num_links*2): # <<<<<<<<<<<<<< @@ -49185,53 +49221,53 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C * j = eindexes.index(sent_links[idx+1]) */ while (1) { - __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_4) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1390 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1389 * idx = 0 * while (idx < num_links*2): * if (sent_links[idx] == s): # <<<<<<<<<<<<<< * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) */ - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1391 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1390 * while (idx < num_links*2): * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<< * ret.append(i*65536+j) * idx += 2 */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; @@ -49239,19 +49275,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C __pyx_v_j = __pyx_t_5; __pyx_t_5 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1392 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1391 * if (sent_links[idx] == s): * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) # <<<<<<<<<<<<<< * idx += 2 * return ret */ - __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -49259,14 +49295,14 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C } __pyx_L8:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1393 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1392 * j = eindexes.index(sent_links[idx+1]) * ret.append(i*65536+j) * idx += 2 # <<<<<<<<<<<<<< * return ret * */ - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_v_idx); __pyx_v_idx = __pyx_t_5; @@ -49275,7 +49311,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C __pyx_L3_continue:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1394 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1393 * ret.append(i*65536+j) * idx += 2 * return ret # <<<<<<<<<<<<<< @@ -49293,7 +49329,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.create_alignments", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.create_alignments", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ret); @@ -49305,7 +49341,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C return __pyx_r; } -/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1396 +/* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1395 * return ret * * cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<< @@ -49313,7 +49349,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments(C * cdef int *f_gap_low, *f_gap_high, *e_gap_low, *e_gap_high, num_gaps, gap_start */ -static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_phrase, struct __pyx_t_8_cdec_sa_Matching *__pyx_v_matching, int *__pyx_v_chunklen, int __pyx_v_num_chunks) { +static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, struct __pyx_obj_3_sa_Phrase *__pyx_v_phrase, struct __pyx_t_3_sa_Matching *__pyx_v_matching, int *__pyx_v_chunklen, int __pyx_v_num_chunks) { int *__pyx_v_sent_links; int *__pyx_v_e_links_low; int *__pyx_v_e_links_high; @@ -49354,8 +49390,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py float __pyx_v_pair_count; PyObject *__pyx_v_extracts = 0; PyObject *__pyx_v_phrase_list = 0; - struct __pyx_obj_8_cdec_sa_IntList *__pyx_v_fphr_arr = 0; - struct __pyx_obj_8_cdec_sa_Phrase *__pyx_v_fphr = 0; + struct __pyx_obj_3_sa_IntList *__pyx_v_fphr_arr = 0; + struct __pyx_obj_3_sa_Phrase *__pyx_v_fphr = 0; CYTHON_UNUSED PyObject *__pyx_v_reason_for_failure = 0; PyObject *__pyx_v_sofar = NULL; PyObject *__pyx_v_als = NULL; @@ -49399,19 +49435,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("extract", 0); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1409 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1408 * cdef reason_for_failure * * fphr_arr = IntList() # <<<<<<<<<<<<<< * phrase_len = phrase.n * extracts = [] */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_v_fphr_arr = ((struct __pyx_obj_8_cdec_sa_IntList *)__pyx_t_1); + __pyx_v_fphr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1410 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1409 * * fphr_arr = IntList() * phrase_len = phrase.n # <<<<<<<<<<<<<< @@ -49420,28 +49456,28 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_phrase_len = __pyx_v_phrase->n; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1411 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1410 * fphr_arr = IntList() * phrase_len = phrase.n * extracts = [] # <<<<<<<<<<<<<< * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_extracts = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1412 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1411 * phrase_len = phrase.n * extracts = [] * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<< * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] */ - __pyx_v_sent_links = ((struct __pyx_vtabstruct_8_cdec_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links)); + __pyx_v_sent_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1414 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1413 * sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -49450,7 +49486,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1415 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1414 * * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -49459,7 +49495,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1416 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1415 * e_sent_start = self.eda.sent_index.arr[matching.sent_id] * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] * e_sent_len = e_sent_end - e_sent_start - 1 # <<<<<<<<<<<<<< @@ -49468,7 +49504,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1417 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1416 * e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] * e_sent_len = e_sent_end - e_sent_start - 1 * f_sent_start = self.fda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<< @@ -49477,7 +49513,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1418 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1417 * e_sent_len = e_sent_end - e_sent_start - 1 * f_sent_start = self.fda.sent_index.arr[matching.sent_id] * f_sent_end = self.fda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<< @@ -49486,7 +49522,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1419 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1418 * f_sent_start = self.fda.sent_index.arr[matching.sent_id] * f_sent_end = self.fda.sent_index.arr[matching.sent_id+1] * f_sent_len = f_sent_end - f_sent_start - 1 # <<<<<<<<<<<<<< @@ -49495,21 +49531,21 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1421 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1420 * f_sent_len = f_sent_end - f_sent_start - 1 * * self.findexes1.reset() # <<<<<<<<<<<<<< * sofar = 0 * for i in range(num_chunks): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1420; __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[8]; __pyx_lineno = 1421; __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[8]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1422 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1421 * * self.findexes1.reset() * sofar = 0 # <<<<<<<<<<<<<< @@ -49519,7 +49555,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_INCREF(__pyx_int_0); __pyx_v_sofar = __pyx_int_0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1423 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1422 * self.findexes1.reset() * sofar = 0 * for i in range(num_chunks): # <<<<<<<<<<<<<< @@ -49530,7 +49566,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1424 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1423 * sofar = 0 * for i in range(num_chunks): * for j in range(chunklen[i]): # <<<<<<<<<<<<<< @@ -49541,35 +49577,35 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_j = __pyx_t_6; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1425 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1424 * for i in range(num_chunks): * for j in range(chunklen[i]): * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<< * sofar += 1 * if (i+1<num_chunks): */ - __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1426 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1425 * for j in range(chunklen[i]): * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 # <<<<<<<<<<<<<< * if (i+1<num_chunks): * self.findexes1.append(phrase[sofar]) */ - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_sofar); __pyx_v_sofar = __pyx_t_1; __pyx_t_1 = 0; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1427 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1426 * self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); * sofar += 1 * if (i+1<num_chunks): # <<<<<<<<<<<<<< @@ -49579,28 +49615,28 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = ((__pyx_v_i + 1) < __pyx_v_num_chunks); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1428 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1427 * sofar += 1 * if (i+1<num_chunks): * self.findexes1.append(phrase[sofar]) # <<<<<<<<<<<<<< * sofar += 1 * */ - __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1429 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1428 * if (i+1<num_chunks): * self.findexes1.append(phrase[sofar]) * sofar += 1 # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_sofar); __pyx_v_sofar = __pyx_t_2; @@ -49610,7 +49646,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_L7:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1432 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1431 * * * e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -49619,7 +49655,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1433 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1432 * * e_links_low = <int*> malloc(e_sent_len*sizeof(int)) * e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -49628,7 +49664,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1434 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1433 * e_links_low = <int*> malloc(e_sent_len*sizeof(int)) * e_links_high = <int*> malloc(e_sent_len*sizeof(int)) * f_links_low = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -49637,7 +49673,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1435 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1434 * e_links_high = <int*> malloc(e_sent_len*sizeof(int)) * f_links_low = <int*> malloc(f_sent_len*sizeof(int)) * f_links_high = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<< @@ -49646,7 +49682,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1436 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1435 * f_links_low = <int*> malloc(f_sent_len*sizeof(int)) * f_links_high = <int*> malloc(f_sent_len*sizeof(int)) * f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49655,7 +49691,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1437 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1436 * f_links_high = <int*> malloc(f_sent_len*sizeof(int)) * f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) * f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49664,7 +49700,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1438 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1437 * f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) * f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) * e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49673,7 +49709,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1439 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1438 * f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) * e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) * e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49682,7 +49718,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int))))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1440 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1439 * e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) * e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) * memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49691,7 +49727,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1441 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1440 * e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) * memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) * memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49700,7 +49736,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1442 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1441 * memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) * memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) * memset(e_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49709,7 +49745,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1443 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1442 * memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) * memset(e_gap_low, 0, (num_chunks+1)*sizeof(int)) * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<< @@ -49718,7 +49754,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int)))); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1445 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1444 * memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) * * reason_for_failure = "" # <<<<<<<<<<<<<< @@ -49728,7 +49764,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_42); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1447 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1446 * reason_for_failure = "" * * for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<< @@ -49738,7 +49774,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_e_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1448 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1447 * * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -49747,7 +49783,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_e_links_low[__pyx_v_i]) = -1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1449 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1448 * for i from 0 <= i < e_sent_len: * e_links_low[i] = -1 * e_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -49757,7 +49793,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py (__pyx_v_e_links_high[__pyx_v_i]) = -1; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1450 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1449 * e_links_low[i] = -1 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<< @@ -49767,7 +49803,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_f_sent_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1451 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1450 * e_links_high[i] = -1 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 # <<<<<<<<<<<<<< @@ -49776,7 +49812,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_links_low[__pyx_v_i]) = -1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1452 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1451 * for i from 0 <= i < f_sent_len: * f_links_low[i] = -1 * f_links_high[i] = -1 # <<<<<<<<<<<<<< @@ -49786,7 +49822,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py (__pyx_v_f_links_high[__pyx_v_i]) = -1; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1458 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1457 * # links that we care about (but then how to look up * # when we want to check something on the e side?) * i = 0 # <<<<<<<<<<<<<< @@ -49795,7 +49831,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1459 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1458 * # when we want to check something on the e side?) * i = 0 * while i < num_links*2: # <<<<<<<<<<<<<< @@ -49806,7 +49842,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_i < (__pyx_v_num_links * 2)); if (!__pyx_t_7) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1460 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1459 * i = 0 * while i < num_links*2: * f_i = sent_links[i] # <<<<<<<<<<<<<< @@ -49815,7 +49851,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1461 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1460 * while i < num_links*2: * f_i = sent_links[i] * e_i = sent_links[i+1] # <<<<<<<<<<<<<< @@ -49824,7 +49860,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1462 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1461 * f_i = sent_links[i] * e_i = sent_links[i+1] * if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i: # <<<<<<<<<<<<<< @@ -49840,7 +49876,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1463 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1462 * e_i = sent_links[i+1] * if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i: * f_links_low[f_i] = e_i # <<<<<<<<<<<<<< @@ -49852,7 +49888,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L14:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1464 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1463 * if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i: * f_links_low[f_i] = e_i * if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: # <<<<<<<<<<<<<< @@ -49868,7 +49904,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1465 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1464 * f_links_low[f_i] = e_i * if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: * f_links_high[f_i] = e_i + 1 # <<<<<<<<<<<<<< @@ -49880,7 +49916,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L15:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1466 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1465 * if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: * f_links_high[f_i] = e_i + 1 * if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: # <<<<<<<<<<<<<< @@ -49896,7 +49932,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1467 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1466 * f_links_high[f_i] = e_i + 1 * if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: * e_links_low[e_i] = f_i # <<<<<<<<<<<<<< @@ -49908,7 +49944,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L16:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1468 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1467 * if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: * e_links_low[e_i] = f_i * if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: # <<<<<<<<<<<<<< @@ -49924,7 +49960,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1469 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1468 * e_links_low[e_i] = f_i * if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: * e_links_high[e_i] = f_i + 1 # <<<<<<<<<<<<<< @@ -49936,7 +49972,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L17:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1470 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1469 * if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: * e_links_high[e_i] = f_i + 1 * i = i + 2 # <<<<<<<<<<<<<< @@ -49946,19 +49982,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_v_i = (__pyx_v_i + 2); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1472 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1471 * i = i + 2 * * als = [] # <<<<<<<<<<<<<< * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_als = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1473 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1472 * * als = [] * for x in range(matching.start,matching.end): # <<<<<<<<<<<<<< @@ -49969,18 +50005,18 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_x = __pyx_t_4; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1474 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1473 * als = [] * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) # <<<<<<<<<<<<<< * als.append(al) * # check all source-side alignment constraints */ - __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -49992,17 +50028,17 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_v_al = __pyx_t_10; __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1475 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1474 * for x in range(matching.start,matching.end): * al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) * als.append(al) # <<<<<<<<<<<<<< * # check all source-side alignment constraints * met_constraints = 1 */ - __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1477 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1476 * als.append(al) * # check all source-side alignment constraints * met_constraints = 1 # <<<<<<<<<<<<<< @@ -50011,7 +50047,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1478 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1477 * # check all source-side alignment constraints * met_constraints = 1 * if self.require_aligned_terminal: # <<<<<<<<<<<<<< @@ -50020,7 +50056,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->require_aligned_terminal) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1479 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1478 * met_constraints = 1 * if self.require_aligned_terminal: * num_aligned_chunks = 0 # <<<<<<<<<<<<<< @@ -50029,7 +50065,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_num_aligned_chunks = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1480 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1479 * if self.require_aligned_terminal: * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<< @@ -50039,7 +50075,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_num_chunks; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1481 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1480 * num_aligned_chunks = 0 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<< @@ -50049,7 +50085,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1482 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1481 * for i from 0 <= i < num_chunks: * for j from 0 <= j < chunklen[i]: * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: # <<<<<<<<<<<<<< @@ -50059,7 +50095,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1483 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1482 * for j from 0 <= j < chunklen[i]: * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 # <<<<<<<<<<<<<< @@ -50068,7 +50104,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1484 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1483 * if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: * num_aligned_chunks = num_aligned_chunks + 1 * break # <<<<<<<<<<<<<< @@ -50083,7 +50119,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_L24_break:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1485 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1484 * num_aligned_chunks = num_aligned_chunks + 1 * break * if num_aligned_chunks == 0: # <<<<<<<<<<<<<< @@ -50093,7 +50129,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_num_aligned_chunks == 0); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1486 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1485 * break * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<< @@ -50104,7 +50140,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_124); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1487 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1486 * if num_aligned_chunks == 0: * reason_for_failure = "No aligned terminals" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50116,7 +50152,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L26:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1488 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1487 * reason_for_failure = "No aligned terminals" * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<< @@ -50131,7 +50167,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1489 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1488 * met_constraints = 0 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<< @@ -50142,7 +50178,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_125); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1490 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1489 * if self.require_aligned_chunks and num_aligned_chunks < num_chunks: * reason_for_failure = "Unaligned chunk" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50157,7 +50193,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L20:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1492 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1491 * met_constraints = 0 * * if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<< @@ -50171,7 +50207,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1494 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1493 * if met_constraints and self.tight_phrases: * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<< @@ -50181,7 +50217,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_12 = (__pyx_v_num_chunks - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1495 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1494 * # outside edge constraints are checked later * for i from 0 <= i < num_chunks-1: * if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1: # <<<<<<<<<<<<<< @@ -50191,7 +50227,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1496 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1495 * for i from 0 <= i < num_chunks-1: * if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<< @@ -50202,7 +50238,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_126); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1497 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1496 * if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50211,7 +50247,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1498 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1497 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -50223,7 +50259,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L31:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1499 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1498 * met_constraints = 0 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<< @@ -50233,7 +50269,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1500 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1499 * break * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<< @@ -50244,7 +50280,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_126); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1501 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1500 * if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50253,7 +50289,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1502 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1501 * reason_for_failure = "Gaps are not tight phrases" * met_constraints = 0 * break # <<<<<<<<<<<<<< @@ -50270,7 +50306,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L28:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1504 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1503 * break * * f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<< @@ -50279,7 +50315,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1505 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1504 * * f_low = matching.arr[matching.start] - f_sent_start * f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start # <<<<<<<<<<<<<< @@ -50288,7 +50324,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_high = (((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_matching->size) - 1)]) + (__pyx_v_chunklen[(__pyx_v_num_chunks - 1)])) - __pyx_v_f_sent_start); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1506 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1505 * f_low = matching.arr[matching.start] - f_sent_start * f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start * if met_constraints: # <<<<<<<<<<<<<< @@ -50297,28 +50333,28 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_met_constraints) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1508 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1507 * if met_constraints: * * if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, # <<<<<<<<<<<<<< * -1, -1, &e_low, &e_high, &f_back_low, &f_back_high, f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, */ - __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1512 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1511 * self.train_max_initial_size, self.train_max_initial_size, * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): # <<<<<<<<<<<<<< * gap_error = 0 * num_gaps = 0 */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_low, __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, (&__pyx_v_e_low), (&__pyx_v_e_high), (&__pyx_v_f_back_low), (&__pyx_v_f_back_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_min_gap_size, 0, ((__pyx_v_self->max_nonterminals - __pyx_v_num_chunks) + 1), 1, 1, 0, 0); + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_low, __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, (&__pyx_v_e_low), (&__pyx_v_e_high), (&__pyx_v_f_back_low), (&__pyx_v_f_back_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_min_gap_size, 0, ((__pyx_v_self->max_nonterminals - __pyx_v_num_chunks) + 1), 1, 1, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1513 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1512 * self.train_min_gap_size, 0, * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 # <<<<<<<<<<<<<< @@ -50327,7 +50363,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_error = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1514 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1513 * self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): * gap_error = 0 * num_gaps = 0 # <<<<<<<<<<<<<< @@ -50336,7 +50372,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_num_gaps = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1516 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1515 * num_gaps = 0 * * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -50346,7 +50382,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1517 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1516 * * if f_back_low < f_low: * f_gap_low[0] = f_back_low # <<<<<<<<<<<<<< @@ -50355,7 +50391,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1518 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1517 * if f_back_low < f_low: * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low # <<<<<<<<<<<<<< @@ -50364,7 +50400,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_high[0]) = __pyx_v_f_low; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1519 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1518 * f_gap_low[0] = f_back_low * f_gap_high[0] = f_low * num_gaps = 1 # <<<<<<<<<<<<<< @@ -50373,7 +50409,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_num_gaps = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1520 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1519 * f_gap_high[0] = f_low * num_gaps = 1 * gap_start = 0 # <<<<<<<<<<<<<< @@ -50382,7 +50418,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_start = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1521 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1520 * num_gaps = 1 * gap_start = 0 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -50391,7 +50427,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1522 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1521 * gap_start = 0 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -50401,7 +50437,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1523 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1522 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -50413,7 +50449,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L36:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1524 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1523 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -50422,7 +50458,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1525 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1524 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<< @@ -50438,7 +50474,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1526 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1525 * if self.tight_phrases: * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -50447,7 +50483,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_error = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1527 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1526 * if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: * gap_error = 1 * reason_for_failure = "Inside edges of preceding subphrase are not tight" # <<<<<<<<<<<<<< @@ -50467,7 +50503,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1529 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1528 * reason_for_failure = "Inside edges of preceding subphrase are not tight" * else: * gap_start = 1 # <<<<<<<<<<<<<< @@ -50476,7 +50512,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_start = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1530 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1529 * else: * gap_start = 1 * if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<< @@ -50491,7 +50527,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1533 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1532 * # this is not a hard error. we can't extract this phrase * # but we still might be able to extract a superphrase * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50505,7 +50541,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L35:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1535 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1534 * met_constraints = 0 * * for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<< @@ -50515,7 +50551,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_12 = (__pyx_v_matching->size - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1536 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1535 * * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<< @@ -50524,7 +50560,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_low[(1 + __pyx_v_i)]) = (((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1537 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1536 * for i from 0 <= i < matching.size - 1: * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start * f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start # <<<<<<<<<<<<<< @@ -50533,7 +50569,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_high[(1 + __pyx_v_i)]) = ((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - __pyx_v_f_sent_start); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1538 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1537 * f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start * f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -50543,7 +50579,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1540 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1539 * num_gaps = num_gaps + 1 * * if f_high < f_back_high: # <<<<<<<<<<<<<< @@ -50553,7 +50589,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_f_high < __pyx_v_f_back_high); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1541 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1540 * * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<< @@ -50562,7 +50598,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1542 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1541 * if f_high < f_back_high: * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high # <<<<<<<<<<<<<< @@ -50571,7 +50607,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ (__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1543 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1542 * f_gap_low[gap_start+num_gaps] = f_high * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 # <<<<<<<<<<<<<< @@ -50580,7 +50616,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_num_gaps = (__pyx_v_num_gaps + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1544 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1543 * f_gap_high[gap_start+num_gaps] = f_back_high * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 # <<<<<<<<<<<<<< @@ -50589,7 +50625,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_phrase_len = (__pyx_v_phrase_len + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1545 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1544 * num_gaps = num_gaps + 1 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: # <<<<<<<<<<<<<< @@ -50599,7 +50635,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_phrase_len > __pyx_v_self->max_length); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1546 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1545 * phrase_len = phrase_len+1 * if phrase_len > self.max_length: * gap_error = 1 # <<<<<<<<<<<<<< @@ -50611,7 +50647,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L43:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1547 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1546 * if phrase_len > self.max_length: * gap_error = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -50620,7 +50656,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1548 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1547 * gap_error = 1 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<< @@ -50636,7 +50672,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1549 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1548 * if self.tight_phrases: * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 # <<<<<<<<<<<<<< @@ -50645,7 +50681,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_error = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1550 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1549 * if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: * gap_error = 1 * reason_for_failure = "Inside edges of following subphrase are not tight" # <<<<<<<<<<<<<< @@ -50665,7 +50701,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1552 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1551 * reason_for_failure = "Inside edges of following subphrase are not tight" * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<< @@ -50680,7 +50716,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1553 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1552 * else: * if self.tight_phrases and f_links_low[f_high-1] == -1: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -50694,7 +50730,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L42:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1555 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1554 * met_constraints = 0 * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -50704,7 +50740,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_gap_error == 0); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1556 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1555 * * if gap_error == 0: * e_word_count = e_high - e_low # <<<<<<<<<<<<<< @@ -50713,7 +50749,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1557 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1556 * if gap_error == 0: * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<< @@ -50723,28 +50759,28 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_num_gaps; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1558 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1557 * e_word_count = e_high - e_low * for i from 0 <= i < num_gaps: # check integrity of subphrases * if self.find_fixpoint(f_gap_low[gap_start+i], f_gap_high[gap_start+i], # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * -1, -1, e_gap_low+gap_start+i, e_gap_high+gap_start+i, */ - __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1563 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1562 * f_gap_low+gap_start+i, f_gap_high+gap_start+i, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 */ - __pyx_t_7 = (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)]), __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_e_gap_high + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_f_gap_low + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_f_gap_high + __pyx_v_gap_start) + __pyx_v_i), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0) == 0); + __pyx_t_7 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, (__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)]), __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_e_gap_high + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_f_gap_low + __pyx_v_gap_start) + __pyx_v_i), ((__pyx_v_f_gap_high + __pyx_v_gap_start) + __pyx_v_i), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0) == 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1565 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1564 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 # <<<<<<<<<<<<<< @@ -50753,18 +50789,18 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_gap_error = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1566 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1565 * 0, 0, 0, 0, 0, 0, 0) == 0: * gap_error = 1 * reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i]) # <<<<<<<<<<<<<< * break * */ - __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -50772,14 +50808,14 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_GIVEREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_129), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_129), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_reason_for_failure); __pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1567 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1566 * gap_error = 1 * reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i]) * break # <<<<<<<<<<<<<< @@ -50796,7 +50832,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L47:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1569 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1568 * break * * if gap_error == 0: # <<<<<<<<<<<<<< @@ -50806,7 +50842,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_gap_error == 0); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1570 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1569 * * if gap_error == 0: * i = 1 # <<<<<<<<<<<<<< @@ -50815,21 +50851,21 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1571 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1570 * if gap_error == 0: * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1570; __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[8]; __pyx_lineno = 1571; __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[8]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1572 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1571 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -50839,16 +50875,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1573 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1572 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1574 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1573 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -50857,16 +50893,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = (__pyx_v_i + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1575 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1574 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: */ - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -50874,27 +50910,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L52:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1576 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1575 * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1575; __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[8]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1577 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1576 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -50904,40 +50940,26 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1578 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1577 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_isvar); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PyInt_FromLong((__pyx_v_phrase->syms[__pyx_v_j])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_7) { + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); + if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1579 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1578 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i + 1 * else: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1580 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1579 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -50949,19 +50971,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1582 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1581 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); } __pyx_L55:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1583 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1582 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -50971,51 +50993,51 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1584 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1583 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1585 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1584 * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * * fphr = Phrase(fphr_arr) */ - __pyx_t_2 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L56; } __pyx_L56:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1587 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1586 * self.findexes.append(sym_setindex(self.category, i)) * * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< * if met_constraints: * phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1587; __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[8]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_fphr = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10); + __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1588 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1587 * * fphr = Phrase(fphr_arr) * if met_constraints: # <<<<<<<<<<<<<< @@ -51024,47 +51046,47 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_met_constraints) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1591 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1590 * phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps, * f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<< * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_phrase_list = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_v_phrase_list = __pyx_t_10; + __pyx_t_10 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1592 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1591 * f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: # <<<<<<<<<<<<<< * pair_count = 1.0 / len(phrase_list) * else: */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_t_13 > 0); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1593 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1592 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< * else: * pair_count = 0 */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L58; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1595 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1594 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -51073,36 +51095,36 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_pair_count = 0.0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1596 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1595 * else: * pair_count = 0 * reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) # <<<<<<<<<<<<<< * for (phrase2,eindexes) in phrase_list: * als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_10 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_10 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_130), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_130), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_14)); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_v_reason_for_failure); @@ -51111,7 +51133,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L58:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1597 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1596 * pair_count = 0 * reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) * for (phrase2,eindexes) in phrase_list: # <<<<<<<<<<<<<< @@ -51122,23 +51144,31 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0; __pyx_t_16 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #else + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #else + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_15 = __pyx_t_16(__pyx_t_14); if (unlikely(!__pyx_t_15)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -51146,54 +51176,61 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_2)->tp_iternext; - index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L61_unpacking_failed; + __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - index = 1; __pyx_t_1 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L61_unpacking_failed; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L61_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L62_unpacking_done; __pyx_L61_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L62_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); - __pyx_v_phrase2 = __pyx_t_10; - __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_v_eindexes); - __pyx_v_eindexes = __pyx_t_1; + __pyx_v_phrase2 = __pyx_t_1; __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_v_eindexes); + __pyx_v_eindexes = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1598 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1597 * reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) * for (phrase2,eindexes) in phrase_list: * als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -51202,31 +51239,31 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_v_als1); - __pyx_v_als1 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_als1 = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1599 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1598 * for (phrase2,eindexes) in phrase_list: * als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) * extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<< * * if (num_gaps < self.max_nonterminals and */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_als1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_als1); __Pyx_GIVEREF(__pyx_v_als1); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr)); @@ -51234,23 +51271,23 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_INCREF(__pyx_v_phrase2); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L57; } __pyx_L57:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1601 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1600 * extracts.append((fphr, phrase2, pair_count, tuple(als1))) * * if (num_gaps < self.max_nonterminals and # <<<<<<<<<<<<<< @@ -51260,7 +51297,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1602 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1601 * * if (num_gaps < self.max_nonterminals and * phrase_len < self.max_length and # <<<<<<<<<<<<<< @@ -51270,7 +51307,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_phrase_len < __pyx_v_self->max_length); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1603 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1602 * if (num_gaps < self.max_nonterminals and * phrase_len < self.max_length and * f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): # <<<<<<<<<<<<<< @@ -51288,7 +51325,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1604 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1603 * phrase_len < self.max_length and * f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): * if (f_back_low == f_low and # <<<<<<<<<<<<<< @@ -51298,7 +51335,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_f_back_low == __pyx_v_f_low); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1605 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1604 * f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): * if (f_back_low == f_low and * f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -51308,7 +51345,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1606 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1605 * if (f_back_low == f_low and * f_low >= self.train_min_gap_size and * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))): # <<<<<<<<<<<<<< @@ -51338,7 +51375,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1607 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1606 * f_low >= self.train_min_gap_size and * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))): * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -51347,7 +51384,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1608 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1607 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))): * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 # <<<<<<<<<<<<<< @@ -51356,7 +51393,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1609 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1608 * f_x_low = f_low-self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -51365,7 +51402,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1610 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1609 * met_constraints = 1 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -51382,7 +51419,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (!__pyx_t_18) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1611 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1610 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -51395,7 +51432,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L65:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1612 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1611 * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 * if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -51411,7 +51448,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1613 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1612 * f_x_low = f_x_low - 1 * if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -51423,7 +51460,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L68:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1615 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1614 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -51432,27 +51469,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_met_constraints) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1616 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1615 * * if (met_constraints and * self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, */ - __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1620 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1619 * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 1, 1, 1, 1, 0, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and */ - if (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) { + if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) { __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1622 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1621 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 1, 1, 0, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<< @@ -51468,31 +51505,31 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1623 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1622 * 1, 1, 1, 1, 0, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and * self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high, */ - __pyx_t_10 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1627 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1626 * -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() */ - __pyx_t_9 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_9 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_9 = __pyx_t_7; } __pyx_t_7 = __pyx_t_9; } else { - __pyx_t_7 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0); + __pyx_t_7 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_t_9 = __pyx_t_7; @@ -51501,16 +51538,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1629 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1628 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< * i = 1 * self.findexes.reset() */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1630 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1629 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -51519,44 +51556,44 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1631 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1630 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1632 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1631 * i = 1 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 */ - __pyx_t_10 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1633 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1632 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i+1 * self.findexes.extend(self.findexes1) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1634 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1633 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -51565,27 +51602,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = (__pyx_v_i + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1635 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1634 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_self->findexes1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1636 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1635 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -51595,40 +51632,26 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1637 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1636 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 */ - __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_isvar); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyInt_FromLong((__pyx_v_phrase->syms[__pyx_v_j])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); + if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1638 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1637 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i + 1 * else: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1639 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1638 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -51640,19 +51663,19 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1641 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1640 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); } __pyx_L72:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1642 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1641 * else: * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: # <<<<<<<<<<<<<< @@ -51662,93 +51685,93 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_f_back_high > __pyx_v_f_high); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1643 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1642 * fphr_arr._append(phrase.syms[j]) * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1644 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1643 * if f_back_high > f_high: * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * fphr = Phrase(fphr_arr) * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1, */ - __pyx_t_10 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L73; } __pyx_L73:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1645 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1644 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1, * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id, */ - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); - __pyx_v_fphr = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_10); - __pyx_t_10 = 0; + __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_15); + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1648 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1647 * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1, * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id, * e_sent_len, e_sent_start) # <<<<<<<<<<<<<< * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) */ - __pyx_t_10 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF(__pyx_v_phrase_list); - __pyx_v_phrase_list = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_v_phrase_list = __pyx_t_15; + __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1649 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1648 * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id, * e_sent_len, e_sent_start) * if len(phrase_list) > 0: # <<<<<<<<<<<<<< * pair_count = 1.0 / len(phrase_list) * else: */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_13 > 0); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1650 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1649 * e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< * else: * pair_count = 0 */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L74; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1652 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1651 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -51759,7 +51782,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L74:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1653 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1652 * else: * pair_count = 0 * for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -51767,133 +51790,148 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py * extracts.append((fphr, phrase2, pair_count, tuple(als2))) */ if (PyList_CheckExact(__pyx_v_phrase_list) || PyTuple_CheckExact(__pyx_v_phrase_list)) { - __pyx_t_10 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = 0; + __pyx_t_15 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_15); __pyx_t_13 = 0; __pyx_t_16 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext; + __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; } for (;;) { - if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_10)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_10)) break; - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; - } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_10)) { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_10)) break; - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_15)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_15)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_15)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_14 = __pyx_t_16(__pyx_t_10); - if (unlikely(!__pyx_t_14)) { + __pyx_t_1 = __pyx_t_16(__pyx_t_15); + if (unlikely(!__pyx_t_1)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_1); } - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_15 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_14 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else { + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __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_2 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_14 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L77_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L77_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_2)->tp_iternext; - index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_15)) goto __pyx_L77_unpacking_failed; - __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_1 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L77_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L78_unpacking_done; __pyx_L77_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L78_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); - __pyx_v_phrase2 = __pyx_t_15; - __pyx_t_15 = 0; + __pyx_v_phrase2 = __pyx_t_14; + __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_v_eindexes); - __pyx_v_eindexes = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_eindexes = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1654 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1653 * pair_count = 0 * for phrase2,eindexes in phrase_list: * als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * */ - __pyx_t_14 = ((PyObject *)__pyx_v_self->findexes); - __Pyx_INCREF(__pyx_t_14); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = ((PyObject *)__pyx_v_self->findexes); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_v_als2); - __pyx_v_als2 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_als2 = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1655 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1654 * for phrase2,eindexes in phrase_list: * als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) * extracts.append((fphr, phrase2, pair_count, tuple(als2))) # <<<<<<<<<<<<<< * * if (f_back_high == f_high and */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_als2); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_als2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_als2); __Pyx_GIVEREF(__pyx_v_als2); - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr)); __Pyx_INCREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_phrase2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_1 = 0; - __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_2 = 0; + __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L69; } __pyx_L69:; @@ -51901,7 +51939,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L64:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1657 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1656 * extracts.append((fphr, phrase2, pair_count, tuple(als2))) * * if (f_back_high == f_high and # <<<<<<<<<<<<<< @@ -51911,7 +51949,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1658 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1657 * * if (f_back_high == f_high and * f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -51921,7 +51959,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1659 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1658 * if (f_back_high == f_high and * f_sent_len - f_high >= self.train_min_gap_size and * ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))): # <<<<<<<<<<<<<< @@ -51951,7 +51989,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1660 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1659 * f_sent_len - f_high >= self.train_min_gap_size and * ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))): * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -51960,7 +51998,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1661 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1660 * ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))): * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 # <<<<<<<<<<<<<< @@ -51969,7 +52007,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1662 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1661 * f_x_high = f_high+self.train_min_gap_size * met_constraints = 1 * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -51978,7 +52016,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1663 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1662 * met_constraints = 1 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -51995,7 +52033,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (!__pyx_t_18) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1664 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1663 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: * f_x_high = f_x_high + 1 # <<<<<<<<<<<<<< @@ -52008,7 +52046,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L80:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1665 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1664 * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: * f_x_high = f_x_high + 1 * if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -52024,7 +52062,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1666 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1665 * f_x_high = f_x_high + 1 * if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -52036,7 +52074,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L83:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1668 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1667 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -52045,27 +52083,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_met_constraints) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1669 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1668 * * if (met_constraints and * self.find_fixpoint(f_back_low, f_x_high, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, */ - __pyx_t_10 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1673 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1672 * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 1, 1, 1, 0, 1, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and */ - if (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) { - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) { + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1675 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1674 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 1, 0, 1, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and # <<<<<<<<<<<<<< @@ -52081,32 +52119,32 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1676 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1675 * 1, 1, 1, 0, 1, 1, 0) and * ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and * self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * -1, -1, e_gap_low+gap_start+num_gaps, e_gap_high+gap_start+num_gaps, */ - __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1681 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1680 * f_gap_low+gap_start+num_gaps, f_gap_high+gap_start+num_gaps, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() */ - __pyx_t_9 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_9 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + __pyx_v_gap_start) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + __pyx_v_gap_start) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } else { __pyx_t_9 = __pyx_t_7; } __pyx_t_7 = __pyx_t_9; } else { - __pyx_t_7 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_10, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_7 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __pyx_t_9 = __pyx_t_7; } else { @@ -52114,16 +52152,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1683 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1682 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< * i = 1 * self.findexes.reset() */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1684 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1683 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -52132,21 +52170,21 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1685 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1684 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1686 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1685 * i = 1 * self.findexes.reset() * if f_back_low < f_low: # <<<<<<<<<<<<<< @@ -52156,16 +52194,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1687 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1686 * self.findexes.reset() * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1688 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1687 * if f_back_low < f_low: * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -52174,44 +52212,44 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = (__pyx_v_i + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1689 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1688 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: */ - __pyx_t_15 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L85; } __pyx_L85:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1690 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1689 * i = i+1 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); - PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_self->findexes1)); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_14 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1691 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1690 * self.findexes.append(sym_setindex(self.category, i)) * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -52221,40 +52259,26 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1692 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1691 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 */ - __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_isvar); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyInt_FromLong((__pyx_v_phrase->syms[__pyx_v_j])); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - __pyx_t_15 = 0; - __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_9) { + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); + if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1693 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1692 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i + 1 * else: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1694 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1693 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -52266,102 +52290,102 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1696 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1695 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); } __pyx_L88:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1697 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1696 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1698 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1697 * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * fphr = Phrase(fphr_arr) * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1, */ - __pyx_t_15 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1699 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1698 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1, * f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low, */ - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_fphr_arr)); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); - __pyx_v_fphr = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_15); - __pyx_t_15 = 0; + __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1702 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1701 * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1, * f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<< * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) */ - __pyx_t_15 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF(__pyx_v_phrase_list); - __pyx_v_phrase_list = __pyx_t_15; - __pyx_t_15 = 0; + __pyx_v_phrase_list = __pyx_t_1; + __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1703 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1702 * f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: # <<<<<<<<<<<<<< * pair_count = 1.0 / len(phrase_list) * else: */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_13 > 0); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1704 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1703 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< * else: * pair_count = 0 */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L89; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1706 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1705 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -52372,7 +52396,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L89:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1707 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1706 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -52380,133 +52404,148 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py * extracts.append((fphr, phrase2, pair_count, tuple(als3))) */ if (PyList_CheckExact(__pyx_v_phrase_list) || PyTuple_CheckExact(__pyx_v_phrase_list)) { - __pyx_t_15 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_15); __pyx_t_13 = 0; + __pyx_t_1 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; __pyx_t_16 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; + __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { - if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_15)) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break; - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; - } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_15)) { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_15)) break; - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; + #else + __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { - __pyx_t_10 = __pyx_t_16(__pyx_t_15); - if (unlikely(!__pyx_t_10)) { + __pyx_t_14 = __pyx_t_16(__pyx_t_1); + if (unlikely(!__pyx_t_14)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_14); } - if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { - PyObject* sequence = __pyx_t_10; + if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { + PyObject* sequence = __pyx_t_14; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_14 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_15 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } else { + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } else + { Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_15)) goto __pyx_L92_unpacking_failed; + __Pyx_GOTREF(__pyx_t_15); + index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L92_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_2)->tp_iternext; - index = 0; __pyx_t_14 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_14)) goto __pyx_L92_unpacking_failed; - __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_1 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L92_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L93_unpacking_done; __pyx_L92_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L93_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); - __pyx_v_phrase2 = __pyx_t_14; - __pyx_t_14 = 0; + __pyx_v_phrase2 = __pyx_t_15; + __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_v_eindexes); - __pyx_v_eindexes = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_eindexes = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1708 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1707 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and */ - __pyx_t_10 = ((PyObject *)__pyx_v_self->findexes); - __Pyx_INCREF(__pyx_t_10); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_10, __pyx_v_eindexes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_14 = ((PyObject *)__pyx_v_self->findexes); + __Pyx_INCREF(__pyx_t_14); + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_v_als3); - __pyx_v_als3 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_als3 = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1709 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1708 * for phrase2, eindexes in phrase_list: * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) * extracts.append((fphr, phrase2, pair_count, tuple(als3))) # <<<<<<<<<<<<<< * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_als3); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_als3); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_als3); __Pyx_GIVEREF(__pyx_v_als3); - __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_fphr)); + PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr)); __Pyx_INCREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_phrase2); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_1 = 0; - __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_15); + __pyx_t_2 = 0; + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L84; } __pyx_L84:; @@ -52514,7 +52553,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L79:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1710 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1709 * als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and # <<<<<<<<<<<<<< @@ -52524,7 +52563,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_9 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)); if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1711 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1710 * extracts.append((fphr, phrase2, pair_count, tuple(als3))) * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and # <<<<<<<<<<<<<< @@ -52534,7 +52573,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_7 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length); if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1712 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1711 * if (num_gaps < self.max_nonterminals - 1 and * phrase_len+1 < self.max_length and * f_back_high == f_high and # <<<<<<<<<<<<<< @@ -52544,7 +52583,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_18 = (__pyx_v_f_back_high == __pyx_v_f_high); if (__pyx_t_18) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1713 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1712 * phrase_len+1 < self.max_length and * f_back_high == f_high and * f_back_low == f_low and # <<<<<<<<<<<<<< @@ -52554,7 +52593,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_8 = (__pyx_v_f_back_low == __pyx_v_f_low); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1714 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1713 * f_back_high == f_high and * f_back_low == f_low and * f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and # <<<<<<<<<<<<<< @@ -52564,7 +52603,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_19 = (((__pyx_v_f_back_high - __pyx_v_f_back_low) + (2 * __pyx_v_self->train_min_gap_size)) <= __pyx_v_self->train_max_initial_size); if (__pyx_t_19) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1715 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1714 * f_back_low == f_low and * f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and * f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -52574,7 +52613,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_20 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size); if (__pyx_t_20) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1716 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1715 * f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and * f_low >= self.train_min_gap_size and * f_high <= f_sent_len - self.train_min_gap_size and # <<<<<<<<<<<<<< @@ -52584,7 +52623,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_21 = (__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)); if (__pyx_t_21) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1717 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1716 * f_low >= self.train_min_gap_size and * f_high <= f_sent_len - self.train_min_gap_size and * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): # <<<<<<<<<<<<<< @@ -52634,7 +52673,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1719 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1718 * ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): * * met_constraints = 1 # <<<<<<<<<<<<<< @@ -52643,7 +52682,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_met_constraints = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1720 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1719 * * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<< @@ -52652,7 +52691,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1721 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1720 * met_constraints = 1 * f_x_low = f_low-self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -52661,7 +52700,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1722 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1721 * f_x_low = f_low-self.train_min_gap_size * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<< @@ -52678,7 +52717,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (!__pyx_t_18) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1723 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1722 * if self.tight_phrases: * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 # <<<<<<<<<<<<<< @@ -52691,7 +52730,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L95:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1724 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1723 * while f_x_low >= 0 and f_links_low[f_x_low] == -1: * f_x_low = f_x_low - 1 * if f_x_low < 0: # <<<<<<<<<<<<<< @@ -52701,7 +52740,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_18 = (__pyx_v_f_x_low < 0); if (__pyx_t_18) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1725 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1724 * f_x_low = f_x_low - 1 * if f_x_low < 0: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -52713,7 +52752,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L98:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1727 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1726 * met_constraints = 0 * * f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<< @@ -52722,7 +52761,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1728 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1727 * * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: # <<<<<<<<<<<<<< @@ -52731,7 +52770,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_self->tight_phrases) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1729 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1728 * f_x_high = f_high+self.train_min_gap_size * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<< @@ -52748,7 +52787,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (!__pyx_t_9) break; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1730 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1729 * if self.tight_phrases: * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: * f_x_high = f_x_high + 1 # <<<<<<<<<<<<<< @@ -52761,7 +52800,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L99:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1731 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1730 * while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: * f_x_high = f_x_high + 1 * if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<< @@ -52777,7 +52816,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_7) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1732 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1731 * f_x_high = f_x_high + 1 * if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size: * met_constraints = 0 # <<<<<<<<<<<<<< @@ -52789,7 +52828,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L102:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1734 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1733 * met_constraints = 0 * * if (met_constraints and # <<<<<<<<<<<<<< @@ -52798,27 +52837,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ if (__pyx_v_met_constraints) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1735 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1734 * * if (met_constraints and * self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, */ - __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1739 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1738 * e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 1, 1, 2, 1, 1, 1, 1) and * ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and */ - if (((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1)) { - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1)) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1741 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1740 * self.train_max_initial_size, self.train_max_initial_size, * 1, 1, 2, 1, 1, 1, 1) and * ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<< @@ -52840,46 +52879,46 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_9) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1742 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1741 * 1, 1, 2, 1, 1, 1, 1) and * ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and * self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high, */ - __pyx_t_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1746 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1745 * -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0) and * self.find_fixpoint(f_high, f_x_high, */ - __pyx_t_3 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_3) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1748 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1747 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0) and * self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<< * f_links_low, f_links_high, e_links_low, e_links_high, * -1, -1, e_gap_low+1+num_gaps, e_gap_high+1+num_gaps, */ - __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_15); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1753 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1752 * f_gap_low+1+num_gaps, f_gap_high+1+num_gaps, * f_sent_len, e_sent_len, * self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<< * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() */ - __pyx_t_4 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + 1) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + 1) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_7 = __pyx_t_4; } else { __pyx_t_7 = __pyx_t_3; @@ -52890,8 +52929,8 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_t_9 = __pyx_t_8; } else { - __pyx_t_9 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_9 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_8 = __pyx_t_9; } else { @@ -52899,16 +52938,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1755 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1754 * self.train_max_initial_size, self.train_max_initial_size, * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() # <<<<<<<<<<<<<< * i = 1 * self.findexes.reset() */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1756 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1755 * 0, 0, 0, 0, 0, 0, 0)): * fphr_arr._clear() * i = 1 # <<<<<<<<<<<<<< @@ -52917,44 +52956,44 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = 1; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1757 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1756 * fphr_arr._clear() * i = 1 * self.findexes.reset() # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) */ - __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1758 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1757 * i = 1 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 */ - __pyx_t_14 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1759 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1758 * self.findexes.reset() * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i+1 * self.findexes.extend(self.findexes1) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1760 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1759 * self.findexes.append(sym_setindex(self.category, i)) * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 # <<<<<<<<<<<<<< @@ -52963,27 +53002,27 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_v_i = (__pyx_v_i + 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1761 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1760 * fphr_arr._append(sym_setindex(self.category, i)) * i = i+1 * self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<< * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): */ - __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1)); - PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_self->findexes1)); + PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_self->findexes1)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1)); - __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1762 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1761 * i = i+1 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<< @@ -52993,40 +53032,26 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_3 = __pyx_v_phrase->n; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1763 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1762 * self.findexes.extend(self.findexes1) * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 */ - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__sym_isvar); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = PyInt_FromLong((__pyx_v_phrase->syms[__pyx_v_j])); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_8) { + __pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])); + if (__pyx_t_4) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1764 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1763 * for j from 0 <= j < phrase.n: * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * i = i + 1 * else: */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1765 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1764 * if sym_isvar(phrase.syms[j]): * fphr_arr._append(sym_setindex(self.category, i)) * i = i + 1 # <<<<<<<<<<<<<< @@ -53038,102 +53063,102 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1767 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1766 * i = i + 1 * else: * fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<< * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, (__pyx_v_phrase->syms[__pyx_v_j])); } __pyx_L106:; } - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1768 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1767 * else: * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) */ - ((struct __pyx_vtabstruct_8_cdec_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); + ((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1769 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1768 * fphr_arr._append(phrase.syms[j]) * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<< * fphr = Phrase(fphr_arr) * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2, */ - __pyx_t_14 = PyInt_FromLong(__pyx_f_8_cdec_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1770 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1769 * fphr_arr._append(sym_setindex(self.category, i)) * self.findexes.append(sym_setindex(self.category, i)) * fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<< * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2, * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, */ - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr)); - __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_fphr)); - __pyx_v_fphr = ((struct __pyx_obj_8_cdec_sa_Phrase *)__pyx_t_14); + __pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_14); __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1773 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1772 * phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2, * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<< * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) */ - __pyx_t_14 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF(__pyx_v_phrase_list); __pyx_v_phrase_list = __pyx_t_14; __pyx_t_14 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1774 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1773 * f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: # <<<<<<<<<<<<<< * pair_count = 1.0 / len(phrase_list) * else: */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_t_13 > 0); if (__pyx_t_8) { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1775 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1774 * matching.sent_id, e_sent_len, e_sent_start) * if len(phrase_list) > 0: * pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<< * else: * pair_count = 0 */ - __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_t_13 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_pair_count = (1.0 / __pyx_t_13); goto __pyx_L107; } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1777 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1776 * pair_count = 1.0 / len(phrase_list) * else: * pair_count = 0 # <<<<<<<<<<<<<< @@ -53144,7 +53169,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L107:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1778 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1777 * else: * pair_count = 0 * for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<< @@ -53155,23 +53180,31 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0; __pyx_t_16 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; } for (;;) { if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #else + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break; + #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; + #else + __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #endif } else { __pyx_t_15 = __pyx_t_16(__pyx_t_14); if (unlikely(!__pyx_t_15)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } @@ -53179,54 +53212,61 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { - if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) { - if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - if (unlikely(PyList_GET_SIZE(sequence) != 2)) { - if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2); - else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence)); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } - __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { + } else + { Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_17 = Py_TYPE(__pyx_t_2)->tp_iternext; - index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L110_unpacking_failed; + __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - index = 1; __pyx_t_1 = __pyx_t_17(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L110_unpacking_failed; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L110_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L110_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L111_unpacking_done; __pyx_L110_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear(); - if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L111_unpacking_done:; } __Pyx_XDECREF(__pyx_v_phrase2); - __pyx_v_phrase2 = __pyx_t_10; - __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_v_eindexes); - __pyx_v_eindexes = __pyx_t_1; + __pyx_v_phrase2 = __pyx_t_1; __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_v_eindexes); + __pyx_v_eindexes = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1779 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1778 * pair_count = 0 * for phrase2, eindexes in phrase_list: * als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<< @@ -53235,31 +53275,31 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ __pyx_t_15 = ((PyObject *)__pyx_v_self->findexes); __Pyx_INCREF(__pyx_t_15); - __pyx_t_1 = ((struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_v_als4); - __pyx_v_als4 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_als4 = __pyx_t_2; + __pyx_t_2 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1780 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1779 * for phrase2, eindexes in phrase_list: * als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) * extracts.append((fphr, phrase2, pair_count, tuple(als4))) # <<<<<<<<<<<<<< * else: * reason_for_failure = "Unable to extract basic phrase" */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_als4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_als4); __Pyx_GIVEREF(__pyx_v_als4); - __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)__pyx_v_fphr)); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr)); @@ -53267,16 +53307,16 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_INCREF(__pyx_v_phrase2); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_phrase2); __Pyx_GIVEREF(__pyx_v_phrase2); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L103; @@ -53295,7 +53335,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } /*else*/ { - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1782 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1781 * extracts.append((fphr, phrase2, pair_count, tuple(als4))) * else: * reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<< @@ -53311,7 +53351,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py } __pyx_L33:; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1784 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1783 * reason_for_failure = "Unable to extract basic phrase" * * free(sent_links) # <<<<<<<<<<<<<< @@ -53320,7 +53360,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_sent_links); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1785 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1784 * * free(sent_links) * free(f_links_low) # <<<<<<<<<<<<<< @@ -53329,7 +53369,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_f_links_low); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1786 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1785 * free(sent_links) * free(f_links_low) * free(f_links_high) # <<<<<<<<<<<<<< @@ -53338,7 +53378,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_f_links_high); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1787 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1786 * free(f_links_low) * free(f_links_high) * free(e_links_low) # <<<<<<<<<<<<<< @@ -53347,7 +53387,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_e_links_low); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1788 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1787 * free(f_links_high) * free(e_links_low) * free(e_links_high) # <<<<<<<<<<<<<< @@ -53356,7 +53396,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_e_links_high); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1789 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1788 * free(e_links_low) * free(e_links_high) * free(f_gap_low) # <<<<<<<<<<<<<< @@ -53365,7 +53405,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_f_gap_low); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1790 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1789 * free(e_links_high) * free(f_gap_low) * free(f_gap_high) # <<<<<<<<<<<<<< @@ -53374,7 +53414,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_f_gap_high); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1791 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1790 * free(f_gap_low) * free(f_gap_high) * free(e_gap_low) # <<<<<<<<<<<<<< @@ -53383,7 +53423,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_e_gap_low); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1792 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1791 * free(f_gap_high) * free(e_gap_low) * free(e_gap_high) # <<<<<<<<<<<<<< @@ -53392,7 +53432,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py */ free(__pyx_v_e_gap_high); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1794 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1793 * free(e_gap_high) * * return extracts # <<<<<<<<<<<<<< @@ -53410,7 +53450,7 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); - __Pyx_AddTraceback("_cdec_sa.HieroCachingRuleFactory.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.extract", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_extracts); @@ -53431,33 +53471,33 @@ static PyObject *__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract(struct __py __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_8_cdec_sa_FloatList __pyx_vtable_8_cdec_sa_FloatList; +static struct __pyx_vtabstruct_3_sa_Phrase __pyx_vtable_3_sa_Phrase; -static PyObject *__pyx_tp_new_8_cdec_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_FloatList *p; +static PyObject *__pyx_tp_new_3_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_Phrase *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_FloatList *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_FloatList; - if (__pyx_pw_8_cdec_sa_9FloatList_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_Phrase *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_Phrase; + if (__pyx_pw_3_sa_6Phrase_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_FloatList(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_Phrase(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_9FloatList_3__dealloc__(o); + __pyx_pw_3_sa_6Phrase_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_8_cdec_sa_FloatList(PyObject *o, Py_ssize_t i) { +static PyObject *__pyx_sq_item_3_sa_Phrase(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); @@ -53465,25 +53505,28 @@ static PyObject *__pyx_sq_item_8_cdec_sa_FloatList(PyObject *o, Py_ssize_t i) { return r; } -static int __pyx_mp_ass_subscript_8_cdec_sa_FloatList(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_pw_8_cdec_sa_9FloatList_7__setitem__(o, i, v); - } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); - return -1; - } +static PyObject *__pyx_getprop_3_sa_6Phrase_words(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_6Phrase_5words_1__get__(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_FloatList[] = { - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_8_cdec_sa_9FloatList_11append, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_8_cdec_sa_9FloatList_13write, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_8_cdec_sa_9FloatList_15read, METH_O, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_Phrase[] = { + {__Pyx_NAMESTR("handle"), (PyCFunction)__pyx_pw_3_sa_6Phrase_7handle, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3_sa_6Phrase_6handle)}, + {__Pyx_NAMESTR("strhandle"), (PyCFunction)__pyx_pw_3_sa_6Phrase_9strhandle, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_3_sa_6Phrase_11arity, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getvarpos"), (PyCFunction)__pyx_pw_3_sa_6Phrase_13getvarpos, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getvar"), (PyCFunction)__pyx_pw_3_sa_6Phrase_15getvar, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("clen"), (PyCFunction)__pyx_pw_3_sa_6Phrase_17clen, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getchunk"), (PyCFunction)__pyx_pw_3_sa_6Phrase_19getchunk, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("subst"), (PyCFunction)__pyx_pw_3_sa_6Phrase_32subst, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_FloatList = { +static struct PyGetSetDef __pyx_getsets_3_sa_Phrase[] = { + {(char *)"words", __pyx_getprop_3_sa_6Phrase_words, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Phrase = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -53541,11 +53584,11 @@ static PyNumberMethods __pyx_tp_as_number_FloatList = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_FloatList = { - __pyx_pw_8_cdec_sa_9FloatList_9__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_Phrase = { + __pyx_pw_3_sa_6Phrase_25__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_8_cdec_sa_FloatList, /*sq_item*/ + __pyx_sq_item_3_sa_Phrase, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -53554,13 +53597,13 @@ static PySequenceMethods __pyx_tp_as_sequence_FloatList = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_FloatList = { - __pyx_pw_8_cdec_sa_9FloatList_9__len__, /*mp_length*/ - __pyx_pw_8_cdec_sa_9FloatList_5__getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_8_cdec_sa_FloatList, /*mp_ass_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_Phrase = { + __pyx_pw_3_sa_6Phrase_25__len__, /*mp_length*/ + __pyx_pw_3_sa_6Phrase_27__getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_FloatList = { +static PyBufferProcs __pyx_tp_as_buffer_Phrase = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -53581,41 +53624,41 @@ static PyBufferProcs __pyx_tp_as_buffer_FloatList = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_FloatList = { +static PyTypeObject __pyx_type_3_sa_Phrase = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.FloatList"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_FloatList), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Phrase"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Phrase), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_FloatList, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Phrase, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ + __pyx_pw_3_sa_6Phrase_21__cmp__, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_FloatList, /*tp_as_number*/ - &__pyx_tp_as_sequence_FloatList, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_FloatList, /*tp_as_mapping*/ - 0, /*tp_hash*/ + &__pyx_tp_as_number_Phrase, /*tp_as_number*/ + &__pyx_tp_as_sequence_Phrase, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Phrase, /*tp_as_mapping*/ + __pyx_pw_3_sa_6Phrase_23__hash__, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_pw_3_sa_6Phrase_5__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_FloatList, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_Phrase, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ + __pyx_pw_3_sa_6Phrase_29__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_FloatList, /*tp_methods*/ + __pyx_methods_3_sa_Phrase, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_3_sa_Phrase, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -53623,7 +53666,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_FloatList = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_FloatList, /*tp_new*/ + __pyx_tp_new_3_sa_Phrase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -53636,66 +53679,133 @@ static PyTypeObject __pyx_type_8_cdec_sa_FloatList = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_IntList __pyx_vtable_8_cdec_sa_IntList; -static PyObject *__pyx_tp_new_8_cdec_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_IntList *p; +static PyObject *__pyx_tp_new_3_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_Rule *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_IntList *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_IntList; - if (__pyx_pw_8_cdec_sa_7IntList_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_Rule *)o); + p->f = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + p->e = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + p->word_alignments = Py_None; Py_INCREF(Py_None); + if (__pyx_pw_3_sa_4Rule_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_IntList(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_Rule(PyObject *o) { + struct __pyx_obj_3_sa_Rule *p = (struct __pyx_obj_3_sa_Rule *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_7IntList_15__dealloc__(o); + __pyx_pw_3_sa_4Rule_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } + Py_XDECREF(((PyObject *)p->f)); + Py_XDECREF(((PyObject *)p->e)); + Py_XDECREF(p->word_alignments); (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_8_cdec_sa_IntList(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; + +static int __pyx_tp_traverse_3_sa_Rule(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3_sa_Rule *p = (struct __pyx_obj_3_sa_Rule *)o; + if (p->f) { + e = (*v)(((PyObject*)p->f), a); if (e) return e; + } + if (p->e) { + e = (*v)(((PyObject*)p->e), a); if (e) return e; + } + if (p->word_alignments) { + e = (*v)(p->word_alignments, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3_sa_Rule(PyObject *o) { + struct __pyx_obj_3_sa_Rule *p = (struct __pyx_obj_3_sa_Rule *)o; + PyObject* tmp; + tmp = ((PyObject*)p->f); + p->f = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->e); + p->e = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->word_alignments); + p->word_alignments = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; } -static int __pyx_mp_ass_subscript_8_cdec_sa_IntList(PyObject *o, PyObject *i, PyObject *v) { +static PyObject *__pyx_getprop_3_sa_4Rule_scores(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_4Rule_6scores_1__get__(o); +} + +static int __pyx_setprop_3_sa_4Rule_scores(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_7IntList_19__setitem__(o, i, v); + return __pyx_pw_3_sa_4Rule_6scores_3__set__(o, v); } else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); + PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } -static PyMethodDef __pyx_methods_8_cdec_sa_IntList[] = { - {__Pyx_NAMESTR("index"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_5index, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("partition"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_7partition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_doquicksort"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_9_doquicksort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("sort"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_11sort, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_13reset, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getSize"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_23getSize, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_25append, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_27extend, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_29write, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_8_cdec_sa_7IntList_31read, METH_O, __Pyx_DOCSTR(0)}, +static PyObject *__pyx_getprop_3_sa_4Rule_lhs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_4Rule_3lhs_1__get__(o); +} + +static int __pyx_setprop_3_sa_4Rule_lhs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_3_sa_4Rule_3lhs_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_3_sa_4Rule_f(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_4Rule_1f_1__get__(o); +} + +static PyObject *__pyx_getprop_3_sa_4Rule_e(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_4Rule_1e_1__get__(o); +} + +static PyObject *__pyx_getprop_3_sa_4Rule_word_alignments(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_4Rule_15word_alignments_1__get__(o); +} + +static int __pyx_setprop_3_sa_4Rule_word_alignments(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_3_sa_4Rule_15word_alignments_3__set__(o, v); + } + else { + return __pyx_pw_3_sa_4Rule_15word_alignments_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_3_sa_Rule[] = { + {__Pyx_NAMESTR("fmerge"), (PyCFunction)__pyx_pw_3_sa_4Rule_11fmerge, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_3_sa_4Rule_13arity, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_IntList = { +static struct PyGetSetDef __pyx_getsets_3_sa_Rule[] = { + {(char *)"scores", __pyx_getprop_3_sa_4Rule_scores, __pyx_setprop_3_sa_4Rule_scores, 0, 0}, + {(char *)"lhs", __pyx_getprop_3_sa_4Rule_lhs, __pyx_setprop_3_sa_4Rule_lhs, 0, 0}, + {(char *)"f", __pyx_getprop_3_sa_4Rule_f, 0, 0, 0}, + {(char *)"e", __pyx_getprop_3_sa_4Rule_e, 0, 0, 0}, + {(char *)"word_alignments", __pyx_getprop_3_sa_4Rule_word_alignments, __pyx_setprop_3_sa_4Rule_word_alignments, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Rule = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -53731,7 +53841,7 @@ static PyNumberMethods __pyx_tp_as_number_IntList = { #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif - 0, /*nb_inplace_add*/ + __pyx_pw_3_sa_4Rule_9__iadd__, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 @@ -53753,11 +53863,11 @@ static PyNumberMethods __pyx_tp_as_number_IntList = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_IntList = { - __pyx_pw_8_cdec_sa_7IntList_21__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_Rule = { + 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_8_cdec_sa_IntList, /*sq_item*/ + 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -53766,13 +53876,13 @@ static PySequenceMethods __pyx_tp_as_sequence_IntList = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_IntList = { - __pyx_pw_8_cdec_sa_7IntList_21__len__, /*mp_length*/ - __pyx_pw_8_cdec_sa_7IntList_17__getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_8_cdec_sa_IntList, /*mp_ass_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_Rule = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_IntList = { +static PyBufferProcs __pyx_tp_as_buffer_Rule = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -53793,41 +53903,41 @@ static PyBufferProcs __pyx_tp_as_buffer_IntList = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_IntList = { +static PyTypeObject __pyx_type_3_sa_Rule = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.IntList"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_IntList), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Rule"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Rule), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_IntList, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Rule, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ + __pyx_pw_3_sa_4Rule_7__cmp__, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_IntList, /*tp_as_number*/ - &__pyx_tp_as_sequence_IntList, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_IntList, /*tp_as_mapping*/ - 0, /*tp_hash*/ + &__pyx_tp_as_number_Rule, /*tp_as_number*/ + &__pyx_tp_as_sequence_Rule, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Rule, /*tp_as_mapping*/ + __pyx_pw_3_sa_4Rule_5__hash__, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_8_cdec_sa_7IntList_3__str__, /*tp_str*/ + __pyx_pw_3_sa_4Rule_15__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_IntList, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + &__pyx_tp_as_buffer_Rule, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_3_sa_Rule, /*tp_traverse*/ + __pyx_tp_clear_3_sa_Rule, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_IntList, /*tp_methods*/ + __pyx_methods_3_sa_Rule, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_3_sa_Rule, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -53835,7 +53945,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_IntList = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_IntList, /*tp_new*/ + __pyx_tp_new_3_sa_Rule, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -53848,38 +53958,59 @@ static PyTypeObject __pyx_type_8_cdec_sa_IntList = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_StringMap __pyx_vtable_8_cdec_sa_StringMap; +static struct __pyx_vtabstruct_3_sa_FloatList __pyx_vtable_3_sa_FloatList; -static PyObject *__pyx_tp_new_8_cdec_sa_StringMap(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_StringMap *p; +static PyObject *__pyx_tp_new_3_sa_FloatList(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_FloatList *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_StringMap *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_StringMap; - if (__pyx_pw_8_cdec_sa_9StringMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { + p = ((struct __pyx_obj_3_sa_FloatList *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_FloatList; + if (__pyx_pw_3_sa_9FloatList_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_StringMap(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_FloatList(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_9StringMap_3__dealloc__(o); + __pyx_pw_3_sa_9FloatList_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } +static PyObject *__pyx_sq_item_3_sa_FloatList(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_3_sa_FloatList(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_3_sa_9FloatList_7__setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); + return -1; + } +} -static PyMethodDef __pyx_methods_8_cdec_sa_StringMap[] = { +static PyMethodDef __pyx_methods_3_sa_FloatList[] = { + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_3_sa_9FloatList_11append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_3_sa_9FloatList_13write, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_3_sa_9FloatList_15read, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_StringMap = { +static PyNumberMethods __pyx_tp_as_number_FloatList = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -53937,11 +54068,11 @@ static PyNumberMethods __pyx_tp_as_number_StringMap = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_StringMap = { - 0, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_FloatList = { + __pyx_pw_3_sa_9FloatList_9__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - 0, /*sq_item*/ + __pyx_sq_item_3_sa_FloatList, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -53950,13 +54081,13 @@ static PySequenceMethods __pyx_tp_as_sequence_StringMap = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_StringMap = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_FloatList = { + __pyx_pw_3_sa_9FloatList_9__len__, /*mp_length*/ + __pyx_pw_3_sa_9FloatList_5__getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_3_sa_FloatList, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_StringMap = { +static PyBufferProcs __pyx_tp_as_buffer_FloatList = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -53977,12 +54108,12 @@ static PyBufferProcs __pyx_tp_as_buffer_StringMap = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_StringMap = { +static PyTypeObject __pyx_type_3_sa_FloatList = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.StringMap"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_StringMap), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.FloatList"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_FloatList), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_StringMap, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_FloatList, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -53992,15 +54123,15 @@ static PyTypeObject __pyx_type_8_cdec_sa_StringMap = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_StringMap, /*tp_as_number*/ - &__pyx_tp_as_sequence_StringMap, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_StringMap, /*tp_as_mapping*/ + &__pyx_tp_as_number_FloatList, /*tp_as_number*/ + &__pyx_tp_as_sequence_FloatList, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_FloatList, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_StringMap, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_FloatList, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ @@ -54009,7 +54140,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_StringMap = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_StringMap, /*tp_methods*/ + __pyx_methods_3_sa_FloatList, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -54019,7 +54150,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_StringMap = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_StringMap, /*tp_new*/ + __pyx_tp_new_3_sa_FloatList, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -54032,93 +54163,66 @@ static PyTypeObject __pyx_type_8_cdec_sa_StringMap = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_DataArray __pyx_vtable_8_cdec_sa_DataArray; +static struct __pyx_vtabstruct_3_sa_IntList __pyx_vtable_3_sa_IntList; -static PyObject *__pyx_tp_new_8_cdec_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_DataArray *p; +static PyObject *__pyx_tp_new_3_sa_IntList(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_IntList *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_DataArray *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_DataArray; - p->word2id = Py_None; Py_INCREF(Py_None); - p->id2word = Py_None; Py_INCREF(Py_None); - p->data = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_id = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_9DataArray_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_IntList *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_IntList; + if (__pyx_pw_3_sa_7IntList_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_DataArray(PyObject *o) { - struct __pyx_obj_8_cdec_sa_DataArray *p = (struct __pyx_obj_8_cdec_sa_DataArray *)o; - Py_XDECREF(p->word2id); - Py_XDECREF(p->id2word); - Py_XDECREF(((PyObject *)p->data)); - Py_XDECREF(((PyObject *)p->sent_id)); - Py_XDECREF(((PyObject *)p->sent_index)); +static void __pyx_tp_dealloc_3_sa_IntList(PyObject *o) { + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_3_sa_7IntList_15__dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } (*Py_TYPE(o)->tp_free)(o); } +static PyObject *__pyx_sq_item_3_sa_IntList(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} -static int __pyx_tp_traverse_8_cdec_sa_DataArray(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_8_cdec_sa_DataArray *p = (struct __pyx_obj_8_cdec_sa_DataArray *)o; - if (p->word2id) { - e = (*v)(p->word2id, a); if (e) return e; - } - if (p->id2word) { - e = (*v)(p->id2word, a); if (e) return e; - } - if (p->data) { - e = (*v)(((PyObject*)p->data), a); if (e) return e; - } - if (p->sent_id) { - e = (*v)(((PyObject*)p->sent_id), a); if (e) return e; +static int __pyx_mp_ass_subscript_3_sa_IntList(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_pw_3_sa_7IntList_19__setitem__(o, i, v); } - if (p->sent_index) { - e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); + return -1; } - return 0; } -static int __pyx_tp_clear_8_cdec_sa_DataArray(PyObject *o) { - struct __pyx_obj_8_cdec_sa_DataArray *p = (struct __pyx_obj_8_cdec_sa_DataArray *)o; - PyObject* tmp; - tmp = ((PyObject*)p->word2id); - p->word2id = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->id2word); - p->id2word = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->data); - p->data = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_id); - p->sent_id = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_index); - p->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_8_cdec_sa_DataArray[] = { - {__Pyx_NAMESTR("getSentId"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_5getSentId, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getSent"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_7getSent, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getSentPos"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_9getSentPos, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_11get_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_word"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_13get_word, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_17read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_19read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_21write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_23write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_8_cdec_sa_9DataArray_25write_enhanced, METH_O, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_IntList[] = { + {__Pyx_NAMESTR("index"), (PyCFunction)__pyx_pw_3_sa_7IntList_5index, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("partition"), (PyCFunction)__pyx_pw_3_sa_7IntList_7partition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_doquicksort"), (PyCFunction)__pyx_pw_3_sa_7IntList_9_doquicksort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("sort"), (PyCFunction)__pyx_pw_3_sa_7IntList_11sort, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_3_sa_7IntList_13reset, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getSize"), (PyCFunction)__pyx_pw_3_sa_7IntList_23getSize, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_3_sa_7IntList_25append, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pw_3_sa_7IntList_27extend, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_3_sa_7IntList_29write, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_3_sa_7IntList_31read, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_DataArray = { +static PyNumberMethods __pyx_tp_as_number_IntList = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -54176,11 +54280,11 @@ static PyNumberMethods __pyx_tp_as_number_DataArray = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_DataArray = { - __pyx_pw_8_cdec_sa_9DataArray_3__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_IntList = { + __pyx_pw_3_sa_7IntList_21__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - 0, /*sq_item*/ + __pyx_sq_item_3_sa_IntList, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -54189,13 +54293,13 @@ static PySequenceMethods __pyx_tp_as_sequence_DataArray = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_DataArray = { - __pyx_pw_8_cdec_sa_9DataArray_3__len__, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_IntList = { + __pyx_pw_3_sa_7IntList_21__len__, /*mp_length*/ + __pyx_pw_3_sa_7IntList_17__getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_3_sa_IntList, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_DataArray = { +static PyBufferProcs __pyx_tp_as_buffer_IntList = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -54216,12 +54320,12 @@ static PyBufferProcs __pyx_tp_as_buffer_DataArray = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_DataArray = { +static PyTypeObject __pyx_type_3_sa_IntList = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.DataArray"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_DataArray), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.IntList"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_IntList), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_DataArray, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_IntList, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -54231,24 +54335,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_DataArray = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_DataArray, /*tp_as_number*/ - &__pyx_tp_as_sequence_DataArray, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_DataArray, /*tp_as_mapping*/ + &__pyx_tp_as_number_IntList, /*tp_as_number*/ + &__pyx_tp_as_sequence_IntList, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_IntList, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_pw_3_sa_7IntList_3__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_DataArray, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + &__pyx_tp_as_buffer_IntList, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_DataArray, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_DataArray, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_DataArray, /*tp_methods*/ + __pyx_methods_3_sa_IntList, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -54258,7 +54362,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_DataArray = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_DataArray, /*tp_new*/ + __pyx_tp_new_3_sa_IntList, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -54271,66 +54375,38 @@ static PyTypeObject __pyx_type_8_cdec_sa_DataArray = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_Alignment __pyx_vtable_8_cdec_sa_Alignment; +static struct __pyx_vtabstruct_3_sa_StringMap __pyx_vtable_3_sa_StringMap; -static PyObject *__pyx_tp_new_8_cdec_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Alignment *p; +static PyObject *__pyx_tp_new_3_sa_StringMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa_StringMap *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Alignment *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_Alignment; - p->links = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_9Alignment_5__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_StringMap *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_StringMap; + if (__pyx_pw_3_sa_9StringMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Alignment(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Alignment *p = (struct __pyx_obj_8_cdec_sa_Alignment *)o; - Py_XDECREF(((PyObject *)p->links)); - Py_XDECREF(((PyObject *)p->sent_index)); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_8_cdec_sa_Alignment(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_8_cdec_sa_Alignment *p = (struct __pyx_obj_8_cdec_sa_Alignment *)o; - if (p->links) { - e = (*v)(((PyObject*)p->links), a); if (e) return e; - } - if (p->sent_index) { - e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; +static void __pyx_tp_dealloc_3_sa_StringMap(PyObject *o) { + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_3_sa_9StringMap_3__dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); } - return 0; -} - -static int __pyx_tp_clear_8_cdec_sa_Alignment(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Alignment *p = (struct __pyx_obj_8_cdec_sa_Alignment *)o; - PyObject* tmp; - tmp = ((PyObject*)p->links); - p->links = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->sent_index); - p->sent_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_Alignment[] = { - {__Pyx_NAMESTR("unlink"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_1unlink, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_9Alignment_unlink)}, - {__Pyx_NAMESTR("get_sent_links"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_3get_sent_links, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_7read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_9read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_11write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_13write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("alignment"), (PyCFunction)__pyx_pw_8_cdec_sa_9Alignment_17alignment, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_9Alignment_16alignment)}, +static PyMethodDef __pyx_methods_3_sa_StringMap[] = { {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_Alignment = { +static PyNumberMethods __pyx_tp_as_number_StringMap = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -54388,7 +54464,7 @@ static PyNumberMethods __pyx_tp_as_number_Alignment = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_Alignment = { +static PySequenceMethods __pyx_tp_as_sequence_StringMap = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -54401,13 +54477,13 @@ static PySequenceMethods __pyx_tp_as_sequence_Alignment = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_Alignment = { +static PyMappingMethods __pyx_tp_as_mapping_StringMap = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_Alignment = { +static PyBufferProcs __pyx_tp_as_buffer_StringMap = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -54428,12 +54504,12 @@ static PyBufferProcs __pyx_tp_as_buffer_Alignment = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Alignment = { +static PyTypeObject __pyx_type_3_sa_StringMap = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Alignment"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Alignment), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.StringMap"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_StringMap), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Alignment, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_StringMap, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -54443,24 +54519,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alignment = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_Alignment, /*tp_as_number*/ - &__pyx_tp_as_sequence_Alignment, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Alignment, /*tp_as_mapping*/ + &__pyx_tp_as_number_StringMap, /*tp_as_number*/ + &__pyx_tp_as_sequence_StringMap, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_StringMap, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Alignment, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + &__pyx_tp_as_buffer_StringMap, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_Alignment, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_Alignment, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Alignment, /*tp_methods*/ + __pyx_methods_3_sa_StringMap, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -54470,7 +54546,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alignment = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Alignment, /*tp_new*/ + __pyx_tp_new_3_sa_StringMap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -54483,114 +54559,93 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alignment = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_BiLex __pyx_vtable_8_cdec_sa_BiLex; +static struct __pyx_vtabstruct_3_sa_DataArray __pyx_vtable_3_sa_DataArray; -static PyObject *__pyx_tp_new_8_cdec_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_BiLex *p; +static PyObject *__pyx_tp_new_3_sa_DataArray(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_DataArray *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_BiLex *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_BiLex; - p->col1 = ((struct __pyx_obj_8_cdec_sa_FloatList *)Py_None); Py_INCREF(Py_None); - p->col2 = ((struct __pyx_obj_8_cdec_sa_FloatList *)Py_None); Py_INCREF(Py_None); - p->f_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->e_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->id2eword = Py_None; Py_INCREF(Py_None); - p->id2fword = Py_None; Py_INCREF(Py_None); - p->eword2id = Py_None; Py_INCREF(Py_None); - p->fword2id = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_5BiLex_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_DataArray *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_DataArray; + p->word2id = Py_None; Py_INCREF(Py_None); + p->id2word = Py_None; Py_INCREF(Py_None); + p->data = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_id = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_9DataArray_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_BiLex(PyObject *o) { - struct __pyx_obj_8_cdec_sa_BiLex *p = (struct __pyx_obj_8_cdec_sa_BiLex *)o; - Py_XDECREF(((PyObject *)p->col1)); - Py_XDECREF(((PyObject *)p->col2)); - Py_XDECREF(((PyObject *)p->f_index)); - Py_XDECREF(((PyObject *)p->e_index)); - Py_XDECREF(p->id2eword); - Py_XDECREF(p->id2fword); - Py_XDECREF(p->eword2id); - Py_XDECREF(p->fword2id); +static void __pyx_tp_dealloc_3_sa_DataArray(PyObject *o) { + struct __pyx_obj_3_sa_DataArray *p = (struct __pyx_obj_3_sa_DataArray *)o; + Py_XDECREF(p->word2id); + Py_XDECREF(p->id2word); + Py_XDECREF(((PyObject *)p->data)); + Py_XDECREF(((PyObject *)p->sent_id)); + Py_XDECREF(((PyObject *)p->sent_index)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_BiLex(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_DataArray(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_BiLex *p = (struct __pyx_obj_8_cdec_sa_BiLex *)o; - if (p->col1) { - e = (*v)(((PyObject*)p->col1), a); if (e) return e; - } - if (p->col2) { - e = (*v)(((PyObject*)p->col2), a); if (e) return e; - } - if (p->f_index) { - e = (*v)(((PyObject*)p->f_index), a); if (e) return e; - } - if (p->e_index) { - e = (*v)(((PyObject*)p->e_index), a); if (e) return e; + struct __pyx_obj_3_sa_DataArray *p = (struct __pyx_obj_3_sa_DataArray *)o; + if (p->word2id) { + e = (*v)(p->word2id, a); if (e) return e; } - if (p->id2eword) { - e = (*v)(p->id2eword, a); if (e) return e; + if (p->id2word) { + e = (*v)(p->id2word, a); if (e) return e; } - if (p->id2fword) { - e = (*v)(p->id2fword, a); if (e) return e; + if (p->data) { + e = (*v)(((PyObject*)p->data), a); if (e) return e; } - if (p->eword2id) { - e = (*v)(p->eword2id, a); if (e) return e; + if (p->sent_id) { + e = (*v)(((PyObject*)p->sent_id), a); if (e) return e; } - if (p->fword2id) { - e = (*v)(p->fword2id, a); if (e) return e; + if (p->sent_index) { + e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_BiLex(PyObject *o) { - struct __pyx_obj_8_cdec_sa_BiLex *p = (struct __pyx_obj_8_cdec_sa_BiLex *)o; +static int __pyx_tp_clear_3_sa_DataArray(PyObject *o) { + struct __pyx_obj_3_sa_DataArray *p = (struct __pyx_obj_3_sa_DataArray *)o; PyObject* tmp; - tmp = ((PyObject*)p->col1); - p->col1 = ((struct __pyx_obj_8_cdec_sa_FloatList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->col2); - p->col2 = ((struct __pyx_obj_8_cdec_sa_FloatList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->f_index); - p->f_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->e_index); - p->e_index = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->word2id); + p->word2id = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->id2eword); - p->id2eword = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->id2word); + p->id2word = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->id2fword); - p->id2fword = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->data); + p->data = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->eword2id); - p->eword2id = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->sent_id); + p->sent_id = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->fword2id); - p->fword2id = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->sent_index); + p->sent_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_BiLex[] = { - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_3write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_5read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_e_id"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_7get_e_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_f_id"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_9get_f_id, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_11read_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_13write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_score"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_15get_score, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_8_cdec_sa_5BiLex_17write_text, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_5BiLex_16write_text)}, +static PyMethodDef __pyx_methods_3_sa_DataArray[] = { + {__Pyx_NAMESTR("getSentId"), (PyCFunction)__pyx_pw_3_sa_9DataArray_5getSentId, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getSent"), (PyCFunction)__pyx_pw_3_sa_9DataArray_7getSent, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getSentPos"), (PyCFunction)__pyx_pw_3_sa_9DataArray_9getSentPos, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_id"), (PyCFunction)__pyx_pw_3_sa_9DataArray_11get_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_word"), (PyCFunction)__pyx_pw_3_sa_9DataArray_13get_word, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_9DataArray_17read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_19read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_9DataArray_21write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced_handle"), (PyCFunction)__pyx_pw_3_sa_9DataArray_23write_enhanced_handle, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_9DataArray_25write_enhanced, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_BiLex = { +static PyNumberMethods __pyx_tp_as_number_DataArray = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -54648,8 +54703,8 @@ static PyNumberMethods __pyx_tp_as_number_BiLex = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_BiLex = { - 0, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_DataArray = { + __pyx_pw_3_sa_9DataArray_3__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ @@ -54661,13 +54716,13 @@ static PySequenceMethods __pyx_tp_as_sequence_BiLex = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_BiLex = { - 0, /*mp_length*/ +static PyMappingMethods __pyx_tp_as_mapping_DataArray = { + __pyx_pw_3_sa_9DataArray_3__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_BiLex = { +static PyBufferProcs __pyx_tp_as_buffer_DataArray = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -54688,12 +54743,12 @@ static PyBufferProcs __pyx_tp_as_buffer_BiLex = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_BiLex = { +static PyTypeObject __pyx_type_3_sa_DataArray = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.BiLex"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_BiLex), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.DataArray"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_DataArray), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_BiLex, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_DataArray, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -54703,24 +54758,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_BiLex = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_BiLex, /*tp_as_number*/ - &__pyx_tp_as_sequence_BiLex, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_BiLex, /*tp_as_mapping*/ + &__pyx_tp_as_number_DataArray, /*tp_as_number*/ + &__pyx_tp_as_sequence_DataArray, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_DataArray, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_BiLex, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_DataArray, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_BiLex, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_BiLex, /*tp_clear*/ + __pyx_tp_traverse_3_sa_DataArray, /*tp_traverse*/ + __pyx_tp_clear_3_sa_DataArray, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_BiLex, /*tp_methods*/ + __pyx_methods_3_sa_DataArray, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -54730,7 +54785,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_BiLex = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_BiLex, /*tp_new*/ + __pyx_tp_new_3_sa_DataArray, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -54743,23 +54798,66 @@ static PyTypeObject __pyx_type_8_cdec_sa_BiLex = { 0, /*tp_version_tag*/ #endif }; +static struct __pyx_vtabstruct_3_sa_Alignment __pyx_vtable_3_sa_Alignment; -static PyObject *__pyx_tp_new_8_cdec_sa_BitSetIterator(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_Alignment(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_Alignment *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; + p = ((struct __pyx_obj_3_sa_Alignment *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_Alignment; + p->links = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sent_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_9Alignment_5__cinit__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_BitSetIterator(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_Alignment(PyObject *o) { + struct __pyx_obj_3_sa_Alignment *p = (struct __pyx_obj_3_sa_Alignment *)o; + Py_XDECREF(((PyObject *)p->links)); + Py_XDECREF(((PyObject *)p->sent_index)); (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_BitSetIterator[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_8_cdec_sa_14BitSetIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, +static int __pyx_tp_traverse_3_sa_Alignment(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3_sa_Alignment *p = (struct __pyx_obj_3_sa_Alignment *)o; + if (p->links) { + e = (*v)(((PyObject*)p->links), a); if (e) return e; + } + if (p->sent_index) { + e = (*v)(((PyObject*)p->sent_index), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3_sa_Alignment(PyObject *o) { + struct __pyx_obj_3_sa_Alignment *p = (struct __pyx_obj_3_sa_Alignment *)o; + PyObject* tmp; + tmp = ((PyObject*)p->links); + p->links = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->sent_index); + p->sent_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_3_sa_Alignment[] = { + {__Pyx_NAMESTR("unlink"), (PyCFunction)__pyx_pw_3_sa_9Alignment_1unlink, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_9Alignment_unlink)}, + {__Pyx_NAMESTR("get_sent_links"), (PyCFunction)__pyx_pw_3_sa_9Alignment_3get_sent_links, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_9Alignment_7read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_9Alignment_9read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_9Alignment_11write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_9Alignment_13write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_9Alignment_15write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("alignment"), (PyCFunction)__pyx_pw_3_sa_9Alignment_17alignment, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_9Alignment_16alignment)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_BitSetIterator = { +static PyNumberMethods __pyx_tp_as_number_Alignment = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -54817,7 +54915,7 @@ static PyNumberMethods __pyx_tp_as_number_BitSetIterator = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_BitSetIterator = { +static PySequenceMethods __pyx_tp_as_sequence_Alignment = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -54830,13 +54928,13 @@ static PySequenceMethods __pyx_tp_as_sequence_BitSetIterator = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_BitSetIterator = { +static PyMappingMethods __pyx_tp_as_mapping_Alignment = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_BitSetIterator = { +static PyBufferProcs __pyx_tp_as_buffer_Alignment = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -54857,12 +54955,12 @@ static PyBufferProcs __pyx_tp_as_buffer_BitSetIterator = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_BitSetIterator = { +static PyTypeObject __pyx_type_3_sa_Alignment = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.BitSetIterator"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_BitSetIterator), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Alignment"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Alignment), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_BitSetIterator, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Alignment, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -54872,24 +54970,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSetIterator = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_BitSetIterator, /*tp_as_number*/ - &__pyx_tp_as_sequence_BitSetIterator, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_BitSetIterator, /*tp_as_mapping*/ + &__pyx_tp_as_number_Alignment, /*tp_as_number*/ + &__pyx_tp_as_sequence_Alignment, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Alignment, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_BitSetIterator, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + &__pyx_tp_as_buffer_Alignment, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_3_sa_Alignment, /*tp_traverse*/ + __pyx_tp_clear_3_sa_Alignment, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - __pyx_pw_8_cdec_sa_14BitSetIterator_1__next__, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_BitSetIterator, /*tp_methods*/ + 0, /*tp_iternext*/ + __pyx_methods_3_sa_Alignment, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -54899,7 +54997,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSetIterator = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_BitSetIterator, /*tp_new*/ + __pyx_tp_new_3_sa_Alignment, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -54912,38 +55010,114 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSetIterator = { 0, /*tp_version_tag*/ #endif }; +static struct __pyx_vtabstruct_3_sa_BiLex __pyx_vtable_3_sa_BiLex; -static PyObject *__pyx_tp_new_8_cdec_sa_BitSet(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BiLex(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_BiLex *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - if (__pyx_pw_8_cdec_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { + p = ((struct __pyx_obj_3_sa_BiLex *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_BiLex; + p->col1 = ((struct __pyx_obj_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + p->col2 = ((struct __pyx_obj_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + p->f_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->e_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->id2eword = Py_None; Py_INCREF(Py_None); + p->id2fword = Py_None; Py_INCREF(Py_None); + p->eword2id = Py_None; Py_INCREF(Py_None); + p->fword2id = Py_None; Py_INCREF(Py_None); + if (__pyx_pw_3_sa_5BiLex_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_BitSet(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_6BitSet_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } +static void __pyx_tp_dealloc_3_sa_BiLex(PyObject *o) { + struct __pyx_obj_3_sa_BiLex *p = (struct __pyx_obj_3_sa_BiLex *)o; + Py_XDECREF(((PyObject *)p->col1)); + Py_XDECREF(((PyObject *)p->col2)); + Py_XDECREF(((PyObject *)p->f_index)); + Py_XDECREF(((PyObject *)p->e_index)); + Py_XDECREF(p->id2eword); + Py_XDECREF(p->id2fword); + Py_XDECREF(p->eword2id); + Py_XDECREF(p->fword2id); (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_BitSet[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_8_cdec_sa_6BitSet_7insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_8_cdec_sa_6BitSet_9findsucc, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_8_cdec_sa_6BitSet_13min, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_8_cdec_sa_6BitSet_15max, METH_NOARGS, __Pyx_DOCSTR(0)}, +static int __pyx_tp_traverse_3_sa_BiLex(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3_sa_BiLex *p = (struct __pyx_obj_3_sa_BiLex *)o; + if (p->col1) { + e = (*v)(((PyObject*)p->col1), a); if (e) return e; + } + if (p->col2) { + e = (*v)(((PyObject*)p->col2), a); if (e) return e; + } + if (p->f_index) { + e = (*v)(((PyObject*)p->f_index), a); if (e) return e; + } + if (p->e_index) { + e = (*v)(((PyObject*)p->e_index), a); if (e) return e; + } + if (p->id2eword) { + e = (*v)(p->id2eword, a); if (e) return e; + } + if (p->id2fword) { + e = (*v)(p->id2fword, a); if (e) return e; + } + if (p->eword2id) { + e = (*v)(p->eword2id, a); if (e) return e; + } + if (p->fword2id) { + e = (*v)(p->fword2id, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3_sa_BiLex(PyObject *o) { + struct __pyx_obj_3_sa_BiLex *p = (struct __pyx_obj_3_sa_BiLex *)o; + PyObject* tmp; + tmp = ((PyObject*)p->col1); + p->col1 = ((struct __pyx_obj_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->col2); + p->col2 = ((struct __pyx_obj_3_sa_FloatList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f_index); + p->f_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->e_index); + p->e_index = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->id2eword); + p->id2eword = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->id2fword); + p->id2fword = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->eword2id); + p->eword2id = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->fword2id); + p->fword2id = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_3_sa_BiLex[] = { + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_5BiLex_3write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_5BiLex_5read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_e_id"), (PyCFunction)__pyx_pw_3_sa_5BiLex_7get_e_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_f_id"), (PyCFunction)__pyx_pw_3_sa_5BiLex_9get_f_id, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_5BiLex_11read_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_5BiLex_13write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_score"), (PyCFunction)__pyx_pw_3_sa_5BiLex_15get_score, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_5BiLex_17write_text, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_5BiLex_16write_text)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_BitSet = { +static PyNumberMethods __pyx_tp_as_number_BiLex = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55001,26 +55175,26 @@ static PyNumberMethods __pyx_tp_as_number_BitSet = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_BitSet = { - __pyx_pw_8_cdec_sa_6BitSet_17__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_BiLex = { + 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ - __pyx_pw_8_cdec_sa_6BitSet_19__contains__, /*sq_contains*/ + 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_BitSet = { - __pyx_pw_8_cdec_sa_6BitSet_17__len__, /*mp_length*/ +static PyMappingMethods __pyx_tp_as_mapping_BiLex = { + 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_BitSet = { +static PyBufferProcs __pyx_tp_as_buffer_BiLex = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -55041,12 +55215,12 @@ static PyBufferProcs __pyx_tp_as_buffer_BitSet = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_BitSet = { +static PyTypeObject __pyx_type_3_sa_BiLex = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.BitSet"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_BitSet), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.BiLex"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_BiLex), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_BitSet, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_BiLex, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -55056,24 +55230,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSet = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_BitSet, /*tp_as_number*/ - &__pyx_tp_as_sequence_BitSet, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_BitSet, /*tp_as_mapping*/ + &__pyx_tp_as_number_BiLex, /*tp_as_number*/ + &__pyx_tp_as_sequence_BiLex, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_BiLex, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_8_cdec_sa_6BitSet_11__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_BitSet, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + &__pyx_tp_as_buffer_BiLex, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_3_sa_BiLex, /*tp_traverse*/ + __pyx_tp_clear_3_sa_BiLex, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_8_cdec_sa_6BitSet_5__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_BitSet, /*tp_methods*/ + __pyx_methods_3_sa_BiLex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -55083,7 +55257,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSet = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_BitSet, /*tp_new*/ + __pyx_tp_new_3_sa_BiLex, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -55097,22 +55271,22 @@ static PyTypeObject __pyx_type_8_cdec_sa_BitSet = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_VEBIterator(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3_sa_BitSetIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; } -static void __pyx_tp_dealloc_8_cdec_sa_VEBIterator(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_BitSetIterator(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_VEBIterator[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_8_cdec_sa_11VEBIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_BitSetIterator[] = { + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_3_sa_14BitSetIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_VEBIterator = { +static PyNumberMethods __pyx_tp_as_number_BitSetIterator = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55170,7 +55344,7 @@ static PyNumberMethods __pyx_tp_as_number_VEBIterator = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_VEBIterator = { +static PySequenceMethods __pyx_tp_as_sequence_BitSetIterator = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -55183,13 +55357,13 @@ static PySequenceMethods __pyx_tp_as_sequence_VEBIterator = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_VEBIterator = { +static PyMappingMethods __pyx_tp_as_mapping_BitSetIterator = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_VEBIterator = { +static PyBufferProcs __pyx_tp_as_buffer_BitSetIterator = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -55210,12 +55384,12 @@ static PyBufferProcs __pyx_tp_as_buffer_VEBIterator = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_VEBIterator = { +static PyTypeObject __pyx_type_3_sa_BitSetIterator = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.VEBIterator"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_VEBIterator), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.BitSetIterator"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_BitSetIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_VEBIterator, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_BitSetIterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -55225,15 +55399,15 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEBIterator = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_VEBIterator, /*tp_as_number*/ - &__pyx_tp_as_sequence_VEBIterator, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_VEBIterator, /*tp_as_mapping*/ + &__pyx_tp_as_number_BitSetIterator, /*tp_as_number*/ + &__pyx_tp_as_sequence_BitSetIterator, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_BitSetIterator, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_VEBIterator, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_BitSetIterator, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ @@ -55241,8 +55415,8 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEBIterator = { 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - __pyx_pw_8_cdec_sa_11VEBIterator_1__next__, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_VEBIterator, /*tp_methods*/ + __pyx_pw_3_sa_14BitSetIterator_1__next__, /*tp_iternext*/ + __pyx_methods_3_sa_BitSetIterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -55252,7 +55426,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEBIterator = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_VEBIterator, /*tp_new*/ + __pyx_tp_new_3_sa_BitSetIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -55265,26 +55439,22 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEBIterator = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_VEB __pyx_vtable_8_cdec_sa_VEB; -static PyObject *__pyx_tp_new_8_cdec_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_VEB *p; +static PyObject *__pyx_tp_new_3_sa_BitSet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_VEB *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_VEB; - if (__pyx_pw_8_cdec_sa_3VEB_1__cinit__(o, a, k) < 0) { + if (__pyx_pw_3_sa_6BitSet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_VEB(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_BitSet(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_3VEB_3__dealloc__(o); + __pyx_pw_3_sa_6BitSet_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); @@ -55292,13 +55462,15 @@ static void __pyx_tp_dealloc_8_cdec_sa_VEB(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_VEB[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_8_cdec_sa_3VEB_7insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_8_cdec_sa_3VEB_9findsucc, METH_O, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_BitSet[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_3_sa_6BitSet_7insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_3_sa_6BitSet_9findsucc, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_3_sa_6BitSet_13min, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_3_sa_6BitSet_15max, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_VEB = { +static PyNumberMethods __pyx_tp_as_number_BitSet = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55356,26 +55528,26 @@ static PyNumberMethods __pyx_tp_as_number_VEB = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_VEB = { - __pyx_pw_8_cdec_sa_3VEB_11__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_BitSet = { + __pyx_pw_3_sa_6BitSet_17__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ - __pyx_pw_8_cdec_sa_3VEB_13__contains__, /*sq_contains*/ + __pyx_pw_3_sa_6BitSet_19__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_VEB = { - __pyx_pw_8_cdec_sa_3VEB_11__len__, /*mp_length*/ +static PyMappingMethods __pyx_tp_as_mapping_BitSet = { + __pyx_pw_3_sa_6BitSet_17__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_VEB = { +static PyBufferProcs __pyx_tp_as_buffer_BitSet = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -55396,12 +55568,12 @@ static PyBufferProcs __pyx_tp_as_buffer_VEB = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_VEB = { +static PyTypeObject __pyx_type_3_sa_BitSet = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.VEB"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_VEB), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.BitSet"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_BitSet), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_VEB, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_BitSet, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -55411,24 +55583,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEB = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_VEB, /*tp_as_number*/ - &__pyx_tp_as_sequence_VEB, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_VEB, /*tp_as_mapping*/ + &__pyx_tp_as_number_BitSet, /*tp_as_number*/ + &__pyx_tp_as_sequence_BitSet, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_BitSet, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_pw_3_sa_6BitSet_11__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_VEB, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_BitSet, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_8_cdec_sa_3VEB_5__iter__, /*tp_iter*/ + __pyx_pw_3_sa_6BitSet_5__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_VEB, /*tp_methods*/ + __pyx_methods_3_sa_BitSet, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -55438,7 +55610,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEB = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_VEB, /*tp_new*/ + __pyx_tp_new_3_sa_BitSet, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -55452,56 +55624,22 @@ static PyTypeObject __pyx_type_8_cdec_sa_VEB = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_LCP *p; +static PyObject *__pyx_tp_new_3_sa_VEBIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_LCP *)o); - p->sa = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); - p->lcp = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_3LCP_1__cinit__(o, a, k) < 0) { - Py_DECREF(o); o = 0; - } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_LCP(PyObject *o) { - struct __pyx_obj_8_cdec_sa_LCP *p = (struct __pyx_obj_8_cdec_sa_LCP *)o; - Py_XDECREF(((PyObject *)p->sa)); - Py_XDECREF(((PyObject *)p->lcp)); +static void __pyx_tp_dealloc_3_sa_VEBIterator(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_LCP(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_8_cdec_sa_LCP *p = (struct __pyx_obj_8_cdec_sa_LCP *)o; - if (p->sa) { - e = (*v)(((PyObject*)p->sa), a); if (e) return e; - } - if (p->lcp) { - e = (*v)(((PyObject*)p->lcp), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_8_cdec_sa_LCP(PyObject *o) { - struct __pyx_obj_8_cdec_sa_LCP *p = (struct __pyx_obj_8_cdec_sa_LCP *)o; - PyObject* tmp; - tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->lcp); - p->lcp = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_8_cdec_sa_LCP[] = { - {__Pyx_NAMESTR("compute_stats"), (PyCFunction)__pyx_pw_8_cdec_sa_3LCP_3compute_stats, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_3LCP_2compute_stats)}, +static PyMethodDef __pyx_methods_3_sa_VEBIterator[] = { + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_3_sa_11VEBIterator_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_LCP = { +static PyNumberMethods __pyx_tp_as_number_VEBIterator = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55559,7 +55697,7 @@ static PyNumberMethods __pyx_tp_as_number_LCP = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_LCP = { +static PySequenceMethods __pyx_tp_as_sequence_VEBIterator = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -55572,13 +55710,13 @@ static PySequenceMethods __pyx_tp_as_sequence_LCP = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_LCP = { +static PyMappingMethods __pyx_tp_as_mapping_VEBIterator = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_LCP = { +static PyBufferProcs __pyx_tp_as_buffer_VEBIterator = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -55599,12 +55737,12 @@ static PyBufferProcs __pyx_tp_as_buffer_LCP = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_LCP = { +static PyTypeObject __pyx_type_3_sa_VEBIterator = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.LCP"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_LCP), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.VEBIterator"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_VEBIterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_LCP, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_VEBIterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -55614,24 +55752,24 @@ static PyTypeObject __pyx_type_8_cdec_sa_LCP = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_LCP, /*tp_as_number*/ - &__pyx_tp_as_sequence_LCP, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_LCP, /*tp_as_mapping*/ + &__pyx_tp_as_number_VEBIterator, /*tp_as_number*/ + &__pyx_tp_as_sequence_VEBIterator, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_VEBIterator, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_LCP, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + &__pyx_tp_as_buffer_VEBIterator, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_LCP, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_LCP, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_LCP, /*tp_methods*/ + __pyx_pw_3_sa_11VEBIterator_1__next__, /*tp_iternext*/ + __pyx_methods_3_sa_VEBIterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -55641,7 +55779,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_LCP = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_LCP, /*tp_new*/ + __pyx_tp_new_3_sa_VEBIterator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -55654,89 +55792,40 @@ static PyTypeObject __pyx_type_8_cdec_sa_LCP = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_Alphabet __pyx_vtable_8_cdec_sa_Alphabet; +static struct __pyx_vtabstruct_3_sa_VEB __pyx_vtable_3_sa_VEB; -static PyObject *__pyx_tp_new_8_cdec_sa_Alphabet(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Alphabet *p; +static PyObject *__pyx_tp_new_3_sa_VEB(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_VEB *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Alphabet *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_Alphabet; - p->terminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)Py_None); Py_INCREF(Py_None); - p->nonterminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)Py_None); Py_INCREF(Py_None); - p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_8Alphabet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { + p = ((struct __pyx_obj_3_sa_VEB *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_VEB; + if (__pyx_pw_3_sa_3VEB_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Alphabet(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Alphabet *p = (struct __pyx_obj_8_cdec_sa_Alphabet *)o; +static void __pyx_tp_dealloc_3_sa_VEB(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_8Alphabet_3__dealloc__(o); + __pyx_pw_3_sa_3VEB_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } - Py_XDECREF(((PyObject *)p->terminals)); - Py_XDECREF(((PyObject *)p->nonterminals)); - Py_XDECREF(((PyObject *)p->id2sym)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_Alphabet(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_8_cdec_sa_Alphabet *p = (struct __pyx_obj_8_cdec_sa_Alphabet *)o; - if (p->terminals) { - e = (*v)(((PyObject*)p->terminals), a); if (e) return e; - } - if (p->nonterminals) { - e = (*v)(((PyObject*)p->nonterminals), a); if (e) return e; - } - if (p->id2sym) { - e = (*v)(p->id2sym, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_8_cdec_sa_Alphabet(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Alphabet *p = (struct __pyx_obj_8_cdec_sa_Alphabet *)o; - PyObject* tmp; - tmp = ((PyObject*)p->terminals); - p->terminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->nonterminals); - p->nonterminals = ((struct __pyx_obj_8_cdec_sa_StringMap *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->id2sym); - p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_8_cdec_sa_8Alphabet_terminals(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_8Alphabet_9terminals_1__get__(o); -} - -static PyObject *__pyx_getprop_8_cdec_sa_8Alphabet_nonterminals(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_8Alphabet_12nonterminals_1__get__(o); -} - -static PyMethodDef __pyx_methods_8_cdec_sa_Alphabet[] = { +static PyMethodDef __pyx_methods_3_sa_VEB[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_3_sa_3VEB_7insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("findsucc"), (PyCFunction)__pyx_pw_3_sa_3VEB_9findsucc, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_8_cdec_sa_Alphabet[] = { - {(char *)"terminals", __pyx_getprop_8_cdec_sa_8Alphabet_terminals, 0, 0, 0}, - {(char *)"nonterminals", __pyx_getprop_8_cdec_sa_8Alphabet_nonterminals, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Alphabet = { +static PyNumberMethods __pyx_tp_as_number_VEB = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55794,26 +55883,26 @@ static PyNumberMethods __pyx_tp_as_number_Alphabet = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_Alphabet = { - 0, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_VEB = { + __pyx_pw_3_sa_3VEB_11__len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ + __pyx_pw_3_sa_3VEB_13__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_Alphabet = { - 0, /*mp_length*/ +static PyMappingMethods __pyx_tp_as_mapping_VEB = { + __pyx_pw_3_sa_3VEB_11__len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_Alphabet = { +static PyBufferProcs __pyx_tp_as_buffer_VEB = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -55834,12 +55923,12 @@ static PyBufferProcs __pyx_tp_as_buffer_Alphabet = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Alphabet = { +static PyTypeObject __pyx_type_3_sa_VEB = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Alphabet"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Alphabet), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.VEB"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_VEB), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Alphabet, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_VEB, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -55849,26 +55938,26 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alphabet = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_Alphabet, /*tp_as_number*/ - &__pyx_tp_as_sequence_Alphabet, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Alphabet, /*tp_as_mapping*/ + &__pyx_tp_as_number_VEB, /*tp_as_number*/ + &__pyx_tp_as_sequence_VEB, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_VEB, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Alphabet, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + &__pyx_tp_as_buffer_VEB, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_Alphabet, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_Alphabet, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ + __pyx_pw_3_sa_3VEB_5__iter__, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Alphabet, /*tp_methods*/ + __pyx_methods_3_sa_VEB, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_8_cdec_sa_Alphabet, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -55876,7 +55965,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alphabet = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Alphabet, /*tp_new*/ + __pyx_tp_new_3_sa_VEB, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -55889,53 +55978,57 @@ static PyTypeObject __pyx_type_8_cdec_sa_Alphabet = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_Phrase __pyx_vtable_8_cdec_sa_Phrase; -static PyObject *__pyx_tp_new_8_cdec_sa_Phrase(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Phrase *p; +static PyObject *__pyx_tp_new_3_sa_LCP(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_LCP *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Phrase *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_Phrase; - if (__pyx_pw_8_cdec_sa_6Phrase_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_LCP *)o); + p->sa = ((struct __pyx_obj_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + p->lcp = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_3LCP_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Phrase(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_6Phrase_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } +static void __pyx_tp_dealloc_3_sa_LCP(PyObject *o) { + struct __pyx_obj_3_sa_LCP *p = (struct __pyx_obj_3_sa_LCP *)o; + Py_XDECREF(((PyObject *)p->sa)); + Py_XDECREF(((PyObject *)p->lcp)); (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_8_cdec_sa_Phrase(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; + +static int __pyx_tp_traverse_3_sa_LCP(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3_sa_LCP *p = (struct __pyx_obj_3_sa_LCP *)o; + if (p->sa) { + e = (*v)(((PyObject*)p->sa), a); if (e) return e; + } + if (p->lcp) { + e = (*v)(((PyObject*)p->lcp), a); if (e) return e; + } + return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_Phrase[] = { - {__Pyx_NAMESTR("handle"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_7handle, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_6Phrase_6handle)}, - {__Pyx_NAMESTR("strhandle"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_9strhandle, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_11arity, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getvarpos"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_13getvarpos, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getvar"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_15getvar, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("clen"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_17clen, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getchunk"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_19getchunk, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("subst"), (PyCFunction)__pyx_pw_8_cdec_sa_6Phrase_31subst, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static int __pyx_tp_clear_3_sa_LCP(PyObject *o) { + struct __pyx_obj_3_sa_LCP *p = (struct __pyx_obj_3_sa_LCP *)o; + PyObject* tmp; + tmp = ((PyObject*)p->sa); + p->sa = ((struct __pyx_obj_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->lcp); + p->lcp = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_3_sa_LCP[] = { + {__Pyx_NAMESTR("compute_stats"), (PyCFunction)__pyx_pw_3_sa_3LCP_3compute_stats, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_3LCP_2compute_stats)}, {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_Phrase = { +static PyNumberMethods __pyx_tp_as_number_LCP = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -55993,11 +56086,11 @@ static PyNumberMethods __pyx_tp_as_number_Phrase = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_Phrase = { - __pyx_pw_8_cdec_sa_6Phrase_25__len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_LCP = { + 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_8_cdec_sa_Phrase, /*sq_item*/ + 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -56006,13 +56099,13 @@ static PySequenceMethods __pyx_tp_as_sequence_Phrase = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_Phrase = { - __pyx_pw_8_cdec_sa_6Phrase_25__len__, /*mp_length*/ - __pyx_pw_8_cdec_sa_6Phrase_27__getitem__, /*mp_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_LCP = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_Phrase = { +static PyBufferProcs __pyx_tp_as_buffer_LCP = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -56033,39 +56126,39 @@ static PyBufferProcs __pyx_tp_as_buffer_Phrase = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Phrase = { +static PyTypeObject __pyx_type_3_sa_LCP = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Phrase"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Phrase), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.LCP"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_LCP), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Phrase, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_LCP, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - __pyx_pw_8_cdec_sa_6Phrase_21__cmp__, /*tp_compare*/ + 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_Phrase, /*tp_as_number*/ - &__pyx_tp_as_sequence_Phrase, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Phrase, /*tp_as_mapping*/ - __pyx_pw_8_cdec_sa_6Phrase_23__hash__, /*tp_hash*/ + &__pyx_tp_as_number_LCP, /*tp_as_number*/ + &__pyx_tp_as_sequence_LCP, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_LCP, /*tp_as_mapping*/ + 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_8_cdec_sa_6Phrase_5__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Phrase, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + &__pyx_tp_as_buffer_LCP, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_3_sa_LCP, /*tp_traverse*/ + __pyx_tp_clear_3_sa_LCP, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pw_8_cdec_sa_6Phrase_29__iter__, /*tp_iter*/ + 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Phrase, /*tp_methods*/ + __pyx_methods_3_sa_LCP, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -56075,7 +56168,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Phrase = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Phrase, /*tp_new*/ + __pyx_tp_new_3_sa_LCP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -56088,133 +56181,89 @@ static PyTypeObject __pyx_type_8_cdec_sa_Phrase = { 0, /*tp_version_tag*/ #endif }; +static struct __pyx_vtabstruct_3_sa_Alphabet __pyx_vtable_3_sa_Alphabet; -static PyObject *__pyx_tp_new_8_cdec_sa_Rule(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Rule *p; +static PyObject *__pyx_tp_new_3_sa_Alphabet(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa_Alphabet *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Rule *)o); - p->f = ((struct __pyx_obj_8_cdec_sa_Phrase *)Py_None); Py_INCREF(Py_None); - p->e = ((struct __pyx_obj_8_cdec_sa_Phrase *)Py_None); Py_INCREF(Py_None); - p->word_alignments = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_4Rule_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_Alphabet *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_Alphabet; + p->terminals = ((struct __pyx_obj_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); + p->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); + p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_8Alphabet_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Rule(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Rule *p = (struct __pyx_obj_8_cdec_sa_Rule *)o; +static void __pyx_tp_dealloc_3_sa_Alphabet(PyObject *o) { + struct __pyx_obj_3_sa_Alphabet *p = (struct __pyx_obj_3_sa_Alphabet *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_4Rule_3__dealloc__(o); + __pyx_pw_3_sa_8Alphabet_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } - Py_XDECREF(((PyObject *)p->f)); - Py_XDECREF(((PyObject *)p->e)); - Py_XDECREF(p->word_alignments); + Py_XDECREF(((PyObject *)p->terminals)); + Py_XDECREF(((PyObject *)p->nonterminals)); + Py_XDECREF(((PyObject *)p->id2sym)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_Rule(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_Alphabet(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_Rule *p = (struct __pyx_obj_8_cdec_sa_Rule *)o; - if (p->f) { - e = (*v)(((PyObject*)p->f), a); if (e) return e; + struct __pyx_obj_3_sa_Alphabet *p = (struct __pyx_obj_3_sa_Alphabet *)o; + if (p->terminals) { + e = (*v)(((PyObject*)p->terminals), a); if (e) return e; } - if (p->e) { - e = (*v)(((PyObject*)p->e), a); if (e) return e; + if (p->nonterminals) { + e = (*v)(((PyObject*)p->nonterminals), a); if (e) return e; } - if (p->word_alignments) { - e = (*v)(p->word_alignments, a); if (e) return e; + if (p->id2sym) { + e = (*v)(p->id2sym, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_Rule(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Rule *p = (struct __pyx_obj_8_cdec_sa_Rule *)o; +static int __pyx_tp_clear_3_sa_Alphabet(PyObject *o) { + struct __pyx_obj_3_sa_Alphabet *p = (struct __pyx_obj_3_sa_Alphabet *)o; PyObject* tmp; - tmp = ((PyObject*)p->f); - p->f = ((struct __pyx_obj_8_cdec_sa_Phrase *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->terminals); + p->terminals = ((struct __pyx_obj_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->e); - p->e = ((struct __pyx_obj_8_cdec_sa_Phrase *)Py_None); Py_INCREF(Py_None); + tmp = ((PyObject*)p->nonterminals); + p->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->word_alignments); - p->word_alignments = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->id2sym); + p->id2sym = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyObject *__pyx_getprop_8_cdec_sa_4Rule_scores(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_4Rule_6scores_1__get__(o); -} - -static int __pyx_setprop_8_cdec_sa_4Rule_scores(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pw_8_cdec_sa_4Rule_6scores_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_8_cdec_sa_4Rule_lhs(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_4Rule_3lhs_1__get__(o); -} - -static int __pyx_setprop_8_cdec_sa_4Rule_lhs(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pw_8_cdec_sa_4Rule_3lhs_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_8_cdec_sa_4Rule_f(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_4Rule_1f_1__get__(o); -} - -static PyObject *__pyx_getprop_8_cdec_sa_4Rule_e(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_4Rule_1e_1__get__(o); +static PyObject *__pyx_getprop_3_sa_8Alphabet_terminals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_8Alphabet_9terminals_1__get__(o); } -static PyObject *__pyx_getprop_8_cdec_sa_4Rule_word_alignments(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_4Rule_15word_alignments_1__get__(o); +static PyObject *__pyx_getprop_3_sa_8Alphabet_nonterminals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_8Alphabet_12nonterminals_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_4Rule_word_alignments(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pw_8_cdec_sa_4Rule_15word_alignments_3__set__(o, v); - } - else { - return __pyx_pw_8_cdec_sa_4Rule_15word_alignments_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_8_cdec_sa_Rule[] = { - {__Pyx_NAMESTR("fmerge"), (PyCFunction)__pyx_pw_8_cdec_sa_4Rule_11fmerge, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("arity"), (PyCFunction)__pyx_pw_8_cdec_sa_4Rule_13arity, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_Alphabet[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_8_cdec_sa_Rule[] = { - {(char *)"scores", __pyx_getprop_8_cdec_sa_4Rule_scores, __pyx_setprop_8_cdec_sa_4Rule_scores, 0, 0}, - {(char *)"lhs", __pyx_getprop_8_cdec_sa_4Rule_lhs, __pyx_setprop_8_cdec_sa_4Rule_lhs, 0, 0}, - {(char *)"f", __pyx_getprop_8_cdec_sa_4Rule_f, 0, 0, 0}, - {(char *)"e", __pyx_getprop_8_cdec_sa_4Rule_e, 0, 0, 0}, - {(char *)"word_alignments", __pyx_getprop_8_cdec_sa_4Rule_word_alignments, __pyx_setprop_8_cdec_sa_4Rule_word_alignments, 0, 0}, +static struct PyGetSetDef __pyx_getsets_3_sa_Alphabet[] = { + {(char *)"terminals", __pyx_getprop_3_sa_8Alphabet_terminals, 0, 0, 0}, + {(char *)"nonterminals", __pyx_getprop_3_sa_8Alphabet_nonterminals, 0, 0, 0}, {0, 0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number_Rule = { +static PyNumberMethods __pyx_tp_as_number_Alphabet = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -56250,7 +56299,7 @@ static PyNumberMethods __pyx_tp_as_number_Rule = { #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif - __pyx_pw_8_cdec_sa_4Rule_9__iadd__, /*nb_inplace_add*/ + 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 @@ -56272,7 +56321,7 @@ static PyNumberMethods __pyx_tp_as_number_Rule = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence_Rule = { +static PySequenceMethods __pyx_tp_as_sequence_Alphabet = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -56285,13 +56334,13 @@ static PySequenceMethods __pyx_tp_as_sequence_Rule = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_Rule = { +static PyMappingMethods __pyx_tp_as_mapping_Alphabet = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_Rule = { +static PyBufferProcs __pyx_tp_as_buffer_Alphabet = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -56312,41 +56361,41 @@ static PyBufferProcs __pyx_tp_as_buffer_Rule = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Rule = { +static PyTypeObject __pyx_type_3_sa_Alphabet = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Rule"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Rule), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Alphabet"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Alphabet), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Rule, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Alphabet, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 - __pyx_pw_8_cdec_sa_4Rule_7__cmp__, /*tp_compare*/ + 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number_Rule, /*tp_as_number*/ - &__pyx_tp_as_sequence_Rule, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Rule, /*tp_as_mapping*/ - __pyx_pw_8_cdec_sa_4Rule_5__hash__, /*tp_hash*/ + &__pyx_tp_as_number_Alphabet, /*tp_as_number*/ + &__pyx_tp_as_sequence_Alphabet, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Alphabet, /*tp_as_mapping*/ + 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_8_cdec_sa_4Rule_15__str__, /*tp_str*/ + 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Rule, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_Alphabet, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_Rule, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_Rule, /*tp_clear*/ + __pyx_tp_traverse_3_sa_Alphabet, /*tp_traverse*/ + __pyx_tp_clear_3_sa_Alphabet, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Rule, /*tp_methods*/ + __pyx_methods_3_sa_Alphabet, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_8_cdec_sa_Rule, /*tp_getset*/ + __pyx_getsets_3_sa_Alphabet, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -56354,7 +56403,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Rule = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Rule, /*tp_new*/ + __pyx_tp_new_3_sa_Alphabet, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -56367,26 +56416,26 @@ static PyTypeObject __pyx_type_8_cdec_sa_Rule = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_TrieMap __pyx_vtable_8_cdec_sa_TrieMap; +static struct __pyx_vtabstruct_3_sa_TrieMap __pyx_vtable_3_sa_TrieMap; -static PyObject *__pyx_tp_new_8_cdec_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_TrieMap *p; +static PyObject *__pyx_tp_new_3_sa_TrieMap(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_TrieMap *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_TrieMap *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_TrieMap; - if (__pyx_pw_8_cdec_sa_7TrieMap_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_TrieMap *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_TrieMap; + if (__pyx_pw_3_sa_7TrieMap_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_TrieMap(PyObject *o) { +static void __pyx_tp_dealloc_3_sa_TrieMap(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pw_8_cdec_sa_7TrieMap_3__dealloc__(o); + __pyx_pw_3_sa_7TrieMap_3__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); @@ -56394,10 +56443,10 @@ static void __pyx_tp_dealloc_8_cdec_sa_TrieMap(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static PyMethodDef __pyx_methods_8_cdec_sa_TrieMap[] = { - {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_8_cdec_sa_7TrieMap_5insert, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_8_cdec_sa_7TrieMap_7contains, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("toMap"), (PyCFunction)__pyx_pw_8_cdec_sa_7TrieMap_9toMap, METH_O, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_TrieMap[] = { + {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pw_3_sa_7TrieMap_5insert, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_3_sa_7TrieMap_7contains, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("toMap"), (PyCFunction)__pyx_pw_3_sa_7TrieMap_9toMap, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -56499,12 +56548,12 @@ static PyBufferProcs __pyx_tp_as_buffer_TrieMap = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_TrieMap = { +static PyTypeObject __pyx_type_3_sa_TrieMap = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.TrieMap"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_TrieMap), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.TrieMap"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_TrieMap), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_TrieMap, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_TrieMap, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -56531,7 +56580,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieMap = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_TrieMap, /*tp_methods*/ + __pyx_methods_3_sa_TrieMap, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -56541,7 +56590,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieMap = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_TrieMap, /*tp_new*/ + __pyx_tp_new_3_sa_TrieMap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -56554,32 +56603,32 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieMap = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_Precomputation __pyx_vtable_8_cdec_sa_Precomputation; +static struct __pyx_vtabstruct_3_sa_Precomputation __pyx_vtable_3_sa_Precomputation; -static PyObject *__pyx_tp_new_8_cdec_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Precomputation *p; +static PyObject *__pyx_tp_new_3_sa_Precomputation(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_Precomputation *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Precomputation *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_Precomputation; + p = ((struct __pyx_obj_3_sa_Precomputation *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_Precomputation; p->precomputed_index = Py_None; Py_INCREF(Py_None); p->precomputed_collocations = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_14Precomputation_1__cinit__(o, a, k) < 0) { + if (__pyx_pw_3_sa_14Precomputation_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Precomputation(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Precomputation *p = (struct __pyx_obj_8_cdec_sa_Precomputation *)o; +static void __pyx_tp_dealloc_3_sa_Precomputation(PyObject *o) { + struct __pyx_obj_3_sa_Precomputation *p = (struct __pyx_obj_3_sa_Precomputation *)o; Py_XDECREF(p->precomputed_index); Py_XDECREF(p->precomputed_collocations); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_Precomputation(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_Precomputation(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_Precomputation *p = (struct __pyx_obj_8_cdec_sa_Precomputation *)o; + struct __pyx_obj_3_sa_Precomputation *p = (struct __pyx_obj_3_sa_Precomputation *)o; if (p->precomputed_index) { e = (*v)(p->precomputed_index, a); if (e) return e; } @@ -56589,8 +56638,8 @@ static int __pyx_tp_traverse_8_cdec_sa_Precomputation(PyObject *o, visitproc v, return 0; } -static int __pyx_tp_clear_8_cdec_sa_Precomputation(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Precomputation *p = (struct __pyx_obj_8_cdec_sa_Precomputation *)o; +static int __pyx_tp_clear_3_sa_Precomputation(PyObject *o) { + struct __pyx_obj_3_sa_Precomputation *p = (struct __pyx_obj_3_sa_Precomputation *)o; PyObject* tmp; tmp = ((PyObject*)p->precomputed_index); p->precomputed_index = Py_None; Py_INCREF(Py_None); @@ -56601,10 +56650,10 @@ static int __pyx_tp_clear_8_cdec_sa_Precomputation(PyObject *o) { return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_Precomputation[] = { - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_14Precomputation_3read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_14Precomputation_5write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_8_cdec_sa_14Precomputation_7precompute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_Precomputation[] = { + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_14Precomputation_3read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_14Precomputation_5write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_3_sa_14Precomputation_7precompute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -56706,12 +56755,12 @@ static PyBufferProcs __pyx_tp_as_buffer_Precomputation = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Precomputation = { +static PyTypeObject __pyx_type_3_sa_Precomputation = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Precomputation"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Precomputation), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Precomputation"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Precomputation), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Precomputation, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Precomputation, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -56732,13 +56781,13 @@ static PyTypeObject __pyx_type_8_cdec_sa_Precomputation = { &__pyx_tp_as_buffer_Precomputation, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_Precomputation, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_Precomputation, /*tp_clear*/ + __pyx_tp_traverse_3_sa_Precomputation, /*tp_traverse*/ + __pyx_tp_clear_3_sa_Precomputation, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Precomputation, /*tp_methods*/ + __pyx_methods_3_sa_Precomputation, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -56748,7 +56797,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Precomputation = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Precomputation, /*tp_new*/ + __pyx_tp_new_3_sa_Precomputation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -56761,34 +56810,34 @@ static PyTypeObject __pyx_type_8_cdec_sa_Precomputation = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_SuffixArray __pyx_vtable_8_cdec_sa_SuffixArray; +static struct __pyx_vtabstruct_3_sa_SuffixArray __pyx_vtable_3_sa_SuffixArray; -static PyObject *__pyx_tp_new_8_cdec_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_SuffixArray *p; +static PyObject *__pyx_tp_new_3_sa_SuffixArray(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_SuffixArray *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_SuffixArray; - p->darray = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->ha = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_11SuffixArray_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_SuffixArray *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_SuffixArray; + p->darray = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->sa = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->ha = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_11SuffixArray_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_SuffixArray(PyObject *o) { - struct __pyx_obj_8_cdec_sa_SuffixArray *p = (struct __pyx_obj_8_cdec_sa_SuffixArray *)o; +static void __pyx_tp_dealloc_3_sa_SuffixArray(PyObject *o) { + struct __pyx_obj_3_sa_SuffixArray *p = (struct __pyx_obj_3_sa_SuffixArray *)o; Py_XDECREF(((PyObject *)p->darray)); Py_XDECREF(((PyObject *)p->sa)); Py_XDECREF(((PyObject *)p->ha)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_SuffixArray(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_SuffixArray(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_SuffixArray *p = (struct __pyx_obj_8_cdec_sa_SuffixArray *)o; + struct __pyx_obj_3_sa_SuffixArray *p = (struct __pyx_obj_3_sa_SuffixArray *)o; if (p->darray) { e = (*v)(((PyObject*)p->darray), a); if (e) return e; } @@ -56801,21 +56850,21 @@ static int __pyx_tp_traverse_8_cdec_sa_SuffixArray(PyObject *o, visitproc v, voi return 0; } -static int __pyx_tp_clear_8_cdec_sa_SuffixArray(PyObject *o) { - struct __pyx_obj_8_cdec_sa_SuffixArray *p = (struct __pyx_obj_8_cdec_sa_SuffixArray *)o; +static int __pyx_tp_clear_3_sa_SuffixArray(PyObject *o) { + struct __pyx_obj_3_sa_SuffixArray *p = (struct __pyx_obj_3_sa_SuffixArray *)o; PyObject* tmp; tmp = ((PyObject*)p->darray); - p->darray = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->darray = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sa = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->ha); - p->ha = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->ha = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyObject *__pyx_sq_item_8_cdec_sa_SuffixArray(PyObject *o, Py_ssize_t i) { +static PyObject *__pyx_sq_item_3_sa_SuffixArray(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); @@ -56823,17 +56872,17 @@ static PyObject *__pyx_sq_item_8_cdec_sa_SuffixArray(PyObject *o, Py_ssize_t i) return r; } -static PyMethodDef __pyx_methods_8_cdec_sa_SuffixArray[] = { - {__Pyx_NAMESTR("getSentId"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_5getSentId, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getSent"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_7getSent, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("getSentPos"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_9getSentPos, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_11read_text, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_11SuffixArray_10read_text)}, - {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_13q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_11SuffixArray_12q3sort)}, - {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_17read_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_19write_binary, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_21write_enhanced, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_8_cdec_sa_11SuffixArray_23lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_3_sa_SuffixArray[] = { + {__Pyx_NAMESTR("getSentId"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_5getSentId, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getSent"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_7getSent, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("getSentPos"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_9getSentPos, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_11read_text, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_10read_text)}, + {__Pyx_NAMESTR("q3sort"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_13q3sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_11SuffixArray_12q3sort)}, + {__Pyx_NAMESTR("write_text"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_15write_text, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("read_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_17read_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_binary"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_19write_binary, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("write_enhanced"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_21write_enhanced, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pw_3_sa_11SuffixArray_23lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -56899,7 +56948,7 @@ static PySequenceMethods __pyx_tp_as_sequence_SuffixArray = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_8_cdec_sa_SuffixArray, /*sq_item*/ + __pyx_sq_item_3_sa_SuffixArray, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -56910,7 +56959,7 @@ static PySequenceMethods __pyx_tp_as_sequence_SuffixArray = { static PyMappingMethods __pyx_tp_as_mapping_SuffixArray = { 0, /*mp_length*/ - __pyx_pw_8_cdec_sa_11SuffixArray_3__getitem__, /*mp_subscript*/ + __pyx_pw_3_sa_11SuffixArray_3__getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; @@ -56935,12 +56984,12 @@ static PyBufferProcs __pyx_tp_as_buffer_SuffixArray = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_SuffixArray = { +static PyTypeObject __pyx_type_3_sa_SuffixArray = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.SuffixArray"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_SuffixArray), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.SuffixArray"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_SuffixArray), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_SuffixArray, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_SuffixArray, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -56961,13 +57010,13 @@ static PyTypeObject __pyx_type_8_cdec_sa_SuffixArray = { &__pyx_tp_as_buffer_SuffixArray, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_SuffixArray, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_SuffixArray, /*tp_clear*/ + __pyx_tp_traverse_3_sa_SuffixArray, /*tp_traverse*/ + __pyx_tp_clear_3_sa_SuffixArray, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_SuffixArray, /*tp_methods*/ + __pyx_methods_3_sa_SuffixArray, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -56977,7 +57026,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_SuffixArray = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_SuffixArray, /*tp_new*/ + __pyx_tp_new_3_sa_SuffixArray, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -56991,35 +57040,35 @@ static PyTypeObject __pyx_type_8_cdec_sa_SuffixArray = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_TrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_TrieNode *p; +static PyObject *__pyx_tp_new_3_sa_TrieNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa_TrieNode *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_TrieNode *)o); + p = ((struct __pyx_obj_3_sa_TrieNode *)o); p->children = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_8TrieNode_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { + if (__pyx_pw_3_sa_8TrieNode_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_TrieNode(PyObject *o) { - struct __pyx_obj_8_cdec_sa_TrieNode *p = (struct __pyx_obj_8_cdec_sa_TrieNode *)o; +static void __pyx_tp_dealloc_3_sa_TrieNode(PyObject *o) { + struct __pyx_obj_3_sa_TrieNode *p = (struct __pyx_obj_3_sa_TrieNode *)o; Py_XDECREF(p->children); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_TrieNode(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_TrieNode(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_TrieNode *p = (struct __pyx_obj_8_cdec_sa_TrieNode *)o; + struct __pyx_obj_3_sa_TrieNode *p = (struct __pyx_obj_3_sa_TrieNode *)o; if (p->children) { e = (*v)(p->children, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_TrieNode(PyObject *o) { - struct __pyx_obj_8_cdec_sa_TrieNode *p = (struct __pyx_obj_8_cdec_sa_TrieNode *)o; +static int __pyx_tp_clear_3_sa_TrieNode(PyObject *o) { + struct __pyx_obj_3_sa_TrieNode *p = (struct __pyx_obj_3_sa_TrieNode *)o; PyObject* tmp; tmp = ((PyObject*)p->children); p->children = Py_None; Py_INCREF(Py_None); @@ -57027,25 +57076,25 @@ static int __pyx_tp_clear_8_cdec_sa_TrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_8_cdec_sa_8TrieNode_children(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_8TrieNode_8children_1__get__(o); +static PyObject *__pyx_getprop_3_sa_8TrieNode_children(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_8TrieNode_8children_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_8TrieNode_children(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_8TrieNode_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_8TrieNode_8children_3__set__(o, v); + return __pyx_pw_3_sa_8TrieNode_8children_3__set__(o, v); } else { - return __pyx_pw_8_cdec_sa_8TrieNode_8children_5__del__(o); + return __pyx_pw_3_sa_8TrieNode_8children_5__del__(o); } } -static PyMethodDef __pyx_methods_8_cdec_sa_TrieNode[] = { +static PyMethodDef __pyx_methods_3_sa_TrieNode[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_8_cdec_sa_TrieNode[] = { - {(char *)"children", __pyx_getprop_8_cdec_sa_8TrieNode_children, __pyx_setprop_8_cdec_sa_8TrieNode_children, 0, 0}, +static struct PyGetSetDef __pyx_getsets_3_sa_TrieNode[] = { + {(char *)"children", __pyx_getprop_3_sa_8TrieNode_children, __pyx_setprop_3_sa_8TrieNode_children, 0, 0}, {0, 0, 0, 0, 0} }; @@ -57147,12 +57196,12 @@ static PyBufferProcs __pyx_tp_as_buffer_TrieNode = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_TrieNode = { +static PyTypeObject __pyx_type_3_sa_TrieNode = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.TrieNode"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_TrieNode), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.TrieNode"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_TrieNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_TrieNode, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_TrieNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -57173,15 +57222,15 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieNode = { &__pyx_tp_as_buffer_TrieNode, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_TrieNode, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_TrieNode, /*tp_clear*/ + __pyx_tp_traverse_3_sa_TrieNode, /*tp_traverse*/ + __pyx_tp_clear_3_sa_TrieNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_TrieNode, /*tp_methods*/ + __pyx_methods_3_sa_TrieNode, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_8_cdec_sa_TrieNode, /*tp_getset*/ + __pyx_getsets_3_sa_TrieNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -57189,7 +57238,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieNode = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_TrieNode, /*tp_new*/ + __pyx_tp_new_3_sa_TrieNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -57203,32 +57252,32 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieNode = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *p; - PyObject *o = __pyx_tp_new_8_cdec_sa_TrieNode(t, a, k); +static PyObject *__pyx_tp_new_3_sa_ExtendedTrieNode(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_ExtendedTrieNode *p; + PyObject *o = __pyx_tp_new_3_sa_TrieNode(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)o); + p = ((struct __pyx_obj_3_sa_ExtendedTrieNode *)o); p->phrase = Py_None; Py_INCREF(Py_None); p->phrase_location = Py_None; Py_INCREF(Py_None); p->suffix_link = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_16ExtendedTrieNode_1__cinit__(o, a, k) < 0) { + if (__pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_ExtendedTrieNode(PyObject *o) { - struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *p = (struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)o; +static void __pyx_tp_dealloc_3_sa_ExtendedTrieNode(PyObject *o) { + struct __pyx_obj_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_3_sa_ExtendedTrieNode *)o; Py_XDECREF(p->phrase); Py_XDECREF(p->phrase_location); Py_XDECREF(p->suffix_link); - __pyx_tp_dealloc_8_cdec_sa_TrieNode(o); + __pyx_tp_dealloc_3_sa_TrieNode(o); } -static int __pyx_tp_traverse_8_cdec_sa_ExtendedTrieNode(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_ExtendedTrieNode(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *p = (struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)o; - e = __pyx_tp_traverse_8_cdec_sa_TrieNode(o, v, a); if (e) return e; + struct __pyx_obj_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_3_sa_ExtendedTrieNode *)o; + e = __pyx_tp_traverse_3_sa_TrieNode(o, v, a); if (e) return e; if (p->phrase) { e = (*v)(p->phrase, a); if (e) return e; } @@ -57241,10 +57290,10 @@ static int __pyx_tp_traverse_8_cdec_sa_ExtendedTrieNode(PyObject *o, visitproc v return 0; } -static int __pyx_tp_clear_8_cdec_sa_ExtendedTrieNode(PyObject *o) { - struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *p = (struct __pyx_obj_8_cdec_sa_ExtendedTrieNode *)o; +static int __pyx_tp_clear_3_sa_ExtendedTrieNode(PyObject *o) { + struct __pyx_obj_3_sa_ExtendedTrieNode *p = (struct __pyx_obj_3_sa_ExtendedTrieNode *)o; PyObject* tmp; - __pyx_tp_clear_8_cdec_sa_TrieNode(o); + __pyx_tp_clear_3_sa_TrieNode(o); tmp = ((PyObject*)p->phrase); p->phrase = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -57257,53 +57306,53 @@ static int __pyx_tp_clear_8_cdec_sa_ExtendedTrieNode(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_8_cdec_sa_16ExtendedTrieNode_phrase(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_1__get__(o); +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); + return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_3__set__(o, v); } else { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_6phrase_5__del__(o); + return __pyx_pw_3_sa_16ExtendedTrieNode_6phrase_5__del__(o); } } -static PyObject *__pyx_getprop_8_cdec_sa_16ExtendedTrieNode_phrase_location(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); + return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_3__set__(o, v); } else { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_15phrase_location_5__del__(o); + return __pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_5__del__(o); } } -static PyObject *__pyx_getprop_8_cdec_sa_16ExtendedTrieNode_suffix_link(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); +static PyObject *__pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); + return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_3__set__(o, v); } else { - return __pyx_pw_8_cdec_sa_16ExtendedTrieNode_11suffix_link_5__del__(o); + return __pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_5__del__(o); } } -static PyMethodDef __pyx_methods_8_cdec_sa_ExtendedTrieNode[] = { +static PyMethodDef __pyx_methods_3_sa_ExtendedTrieNode[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_8_cdec_sa_ExtendedTrieNode[] = { - {(char *)"phrase", __pyx_getprop_8_cdec_sa_16ExtendedTrieNode_phrase, __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_phrase, 0, 0}, - {(char *)"phrase_location", __pyx_getprop_8_cdec_sa_16ExtendedTrieNode_phrase_location, __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_phrase_location, 0, 0}, - {(char *)"suffix_link", __pyx_getprop_8_cdec_sa_16ExtendedTrieNode_suffix_link, __pyx_setprop_8_cdec_sa_16ExtendedTrieNode_suffix_link, 0, 0}, +static struct PyGetSetDef __pyx_getsets_3_sa_ExtendedTrieNode[] = { + {(char *)"phrase", __pyx_getprop_3_sa_16ExtendedTrieNode_phrase, __pyx_setprop_3_sa_16ExtendedTrieNode_phrase, 0, 0}, + {(char *)"phrase_location", __pyx_getprop_3_sa_16ExtendedTrieNode_phrase_location, __pyx_setprop_3_sa_16ExtendedTrieNode_phrase_location, 0, 0}, + {(char *)"suffix_link", __pyx_getprop_3_sa_16ExtendedTrieNode_suffix_link, __pyx_setprop_3_sa_16ExtendedTrieNode_suffix_link, 0, 0}, {0, 0, 0, 0, 0} }; @@ -57405,12 +57454,12 @@ static PyBufferProcs __pyx_tp_as_buffer_ExtendedTrieNode = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_ExtendedTrieNode = { +static PyTypeObject __pyx_type_3_sa_ExtendedTrieNode = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.ExtendedTrieNode"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_ExtendedTrieNode), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.ExtendedTrieNode"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_ExtendedTrieNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_ExtendedTrieNode, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_ExtendedTrieNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -57431,15 +57480,15 @@ static PyTypeObject __pyx_type_8_cdec_sa_ExtendedTrieNode = { &__pyx_tp_as_buffer_ExtendedTrieNode, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_ExtendedTrieNode, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_ExtendedTrieNode, /*tp_clear*/ + __pyx_tp_traverse_3_sa_ExtendedTrieNode, /*tp_traverse*/ + __pyx_tp_clear_3_sa_ExtendedTrieNode, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_ExtendedTrieNode, /*tp_methods*/ + __pyx_methods_3_sa_ExtendedTrieNode, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_8_cdec_sa_ExtendedTrieNode, /*tp_getset*/ + __pyx_getsets_3_sa_ExtendedTrieNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -57447,7 +57496,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_ExtendedTrieNode = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_ExtendedTrieNode, /*tp_new*/ + __pyx_tp_new_3_sa_ExtendedTrieNode, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -57461,35 +57510,35 @@ static PyTypeObject __pyx_type_8_cdec_sa_ExtendedTrieNode = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_TrieTable *p; +static PyObject *__pyx_tp_new_3_sa_TrieTable(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_TrieTable *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_TrieTable *)o); + p = ((struct __pyx_obj_3_sa_TrieTable *)o); p->root = Py_None; Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_9TrieTable_1__cinit__(o, a, k) < 0) { + if (__pyx_pw_3_sa_9TrieTable_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_TrieTable(PyObject *o) { - struct __pyx_obj_8_cdec_sa_TrieTable *p = (struct __pyx_obj_8_cdec_sa_TrieTable *)o; +static void __pyx_tp_dealloc_3_sa_TrieTable(PyObject *o) { + struct __pyx_obj_3_sa_TrieTable *p = (struct __pyx_obj_3_sa_TrieTable *)o; Py_XDECREF(p->root); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_TrieTable(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_TrieTable(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_TrieTable *p = (struct __pyx_obj_8_cdec_sa_TrieTable *)o; + struct __pyx_obj_3_sa_TrieTable *p = (struct __pyx_obj_3_sa_TrieTable *)o; if (p->root) { e = (*v)(p->root, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_TrieTable(PyObject *o) { - struct __pyx_obj_8_cdec_sa_TrieTable *p = (struct __pyx_obj_8_cdec_sa_TrieTable *)o; +static int __pyx_tp_clear_3_sa_TrieTable(PyObject *o) { + struct __pyx_obj_3_sa_TrieTable *p = (struct __pyx_obj_3_sa_TrieTable *)o; PyObject* tmp; tmp = ((PyObject*)p->root); p->root = Py_None; Py_INCREF(Py_None); @@ -57497,13 +57546,13 @@ static int __pyx_tp_clear_8_cdec_sa_TrieTable(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_8_cdec_sa_9TrieTable_extended(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_9TrieTable_8extended_1__get__(o); +static PyObject *__pyx_getprop_3_sa_9TrieTable_extended(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_9TrieTable_8extended_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_9TrieTable_extended(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_extended(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_9TrieTable_8extended_3__set__(o, v); + return __pyx_pw_3_sa_9TrieTable_8extended_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -57511,13 +57560,13 @@ static int __pyx_setprop_8_cdec_sa_9TrieTable_extended(PyObject *o, PyObject *v, } } -static PyObject *__pyx_getprop_8_cdec_sa_9TrieTable_count(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_9TrieTable_5count_1__get__(o); +static PyObject *__pyx_getprop_3_sa_9TrieTable_count(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_9TrieTable_5count_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_9TrieTable_count(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_9TrieTable_5count_3__set__(o, v); + return __pyx_pw_3_sa_9TrieTable_5count_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -57525,27 +57574,27 @@ static int __pyx_setprop_8_cdec_sa_9TrieTable_count(PyObject *o, PyObject *v, vo } } -static PyObject *__pyx_getprop_8_cdec_sa_9TrieTable_root(PyObject *o, void *x) { - return __pyx_pw_8_cdec_sa_9TrieTable_4root_1__get__(o); +static PyObject *__pyx_getprop_3_sa_9TrieTable_root(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3_sa_9TrieTable_4root_1__get__(o); } -static int __pyx_setprop_8_cdec_sa_9TrieTable_root(PyObject *o, PyObject *v, void *x) { +static int __pyx_setprop_3_sa_9TrieTable_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { - return __pyx_pw_8_cdec_sa_9TrieTable_4root_3__set__(o, v); + return __pyx_pw_3_sa_9TrieTable_4root_3__set__(o, v); } else { - return __pyx_pw_8_cdec_sa_9TrieTable_4root_5__del__(o); + return __pyx_pw_3_sa_9TrieTable_4root_5__del__(o); } } -static PyMethodDef __pyx_methods_8_cdec_sa_TrieTable[] = { +static PyMethodDef __pyx_methods_3_sa_TrieTable[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_8_cdec_sa_TrieTable[] = { - {(char *)"extended", __pyx_getprop_8_cdec_sa_9TrieTable_extended, __pyx_setprop_8_cdec_sa_9TrieTable_extended, 0, 0}, - {(char *)"count", __pyx_getprop_8_cdec_sa_9TrieTable_count, __pyx_setprop_8_cdec_sa_9TrieTable_count, 0, 0}, - {(char *)"root", __pyx_getprop_8_cdec_sa_9TrieTable_root, __pyx_setprop_8_cdec_sa_9TrieTable_root, 0, 0}, +static struct PyGetSetDef __pyx_getsets_3_sa_TrieTable[] = { + {(char *)"extended", __pyx_getprop_3_sa_9TrieTable_extended, __pyx_setprop_3_sa_9TrieTable_extended, 0, 0}, + {(char *)"count", __pyx_getprop_3_sa_9TrieTable_count, __pyx_setprop_3_sa_9TrieTable_count, 0, 0}, + {(char *)"root", __pyx_getprop_3_sa_9TrieTable_root, __pyx_setprop_3_sa_9TrieTable_root, 0, 0}, {0, 0, 0, 0, 0} }; @@ -57647,12 +57696,12 @@ static PyBufferProcs __pyx_tp_as_buffer_TrieTable = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_TrieTable = { +static PyTypeObject __pyx_type_3_sa_TrieTable = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.TrieTable"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_TrieTable), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.TrieTable"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_TrieTable), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_TrieTable, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_TrieTable, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -57673,15 +57722,15 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieTable = { &__pyx_tp_as_buffer_TrieTable, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_TrieTable, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_TrieTable, /*tp_clear*/ + __pyx_tp_traverse_3_sa_TrieTable, /*tp_traverse*/ + __pyx_tp_clear_3_sa_TrieTable, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_TrieTable, /*tp_methods*/ + __pyx_methods_3_sa_TrieTable, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_8_cdec_sa_TrieTable, /*tp_getset*/ + __pyx_getsets_3_sa_TrieTable, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -57689,7 +57738,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieTable = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_TrieTable, /*tp_new*/ + __pyx_tp_new_3_sa_TrieTable, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -57702,46 +57751,46 @@ static PyTypeObject __pyx_type_8_cdec_sa_TrieTable = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_PhraseLocation __pyx_vtable_8_cdec_sa_PhraseLocation; +static struct __pyx_vtabstruct_3_sa_PhraseLocation __pyx_vtable_3_sa_PhraseLocation; -static PyObject *__pyx_tp_new_8_cdec_sa_PhraseLocation(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_PhraseLocation *p; +static PyObject *__pyx_tp_new_3_sa_PhraseLocation(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_PhraseLocation *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_PhraseLocation; - p->arr = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_14PhraseLocation_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_PhraseLocation *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_PhraseLocation; + p->arr = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_14PhraseLocation_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_PhraseLocation(PyObject *o) { - struct __pyx_obj_8_cdec_sa_PhraseLocation *p = (struct __pyx_obj_8_cdec_sa_PhraseLocation *)o; +static void __pyx_tp_dealloc_3_sa_PhraseLocation(PyObject *o) { + struct __pyx_obj_3_sa_PhraseLocation *p = (struct __pyx_obj_3_sa_PhraseLocation *)o; Py_XDECREF(((PyObject *)p->arr)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_PhraseLocation(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_PhraseLocation(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_PhraseLocation *p = (struct __pyx_obj_8_cdec_sa_PhraseLocation *)o; + struct __pyx_obj_3_sa_PhraseLocation *p = (struct __pyx_obj_3_sa_PhraseLocation *)o; if (p->arr) { e = (*v)(((PyObject*)p->arr), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_PhraseLocation(PyObject *o) { - struct __pyx_obj_8_cdec_sa_PhraseLocation *p = (struct __pyx_obj_8_cdec_sa_PhraseLocation *)o; +static int __pyx_tp_clear_3_sa_PhraseLocation(PyObject *o) { + struct __pyx_obj_3_sa_PhraseLocation *p = (struct __pyx_obj_3_sa_PhraseLocation *)o; PyObject* tmp; tmp = ((PyObject*)p->arr); - p->arr = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->arr = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_PhraseLocation[] = { +static PyMethodDef __pyx_methods_3_sa_PhraseLocation[] = { {0, 0, 0, 0} }; @@ -57843,12 +57892,12 @@ static PyBufferProcs __pyx_tp_as_buffer_PhraseLocation = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_PhraseLocation = { +static PyTypeObject __pyx_type_3_sa_PhraseLocation = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.PhraseLocation"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_PhraseLocation), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.PhraseLocation"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_PhraseLocation), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_PhraseLocation, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_PhraseLocation, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -57869,13 +57918,13 @@ static PyTypeObject __pyx_type_8_cdec_sa_PhraseLocation = { &__pyx_tp_as_buffer_PhraseLocation, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_PhraseLocation, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_PhraseLocation, /*tp_clear*/ + __pyx_tp_traverse_3_sa_PhraseLocation, /*tp_traverse*/ + __pyx_tp_clear_3_sa_PhraseLocation, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_PhraseLocation, /*tp_methods*/ + __pyx_methods_3_sa_PhraseLocation, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -57885,7 +57934,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_PhraseLocation = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_PhraseLocation, /*tp_new*/ + __pyx_tp_new_3_sa_PhraseLocation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -57899,44 +57948,44 @@ static PyTypeObject __pyx_type_8_cdec_sa_PhraseLocation = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa_Sampler(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_Sampler *p; +static PyObject *__pyx_tp_new_3_sa_Sampler(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_Sampler *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_Sampler *)o); - p->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_7Sampler_1__cinit__(o, a, k) < 0) { + p = ((struct __pyx_obj_3_sa_Sampler *)o); + p->sa = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_7Sampler_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_Sampler(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Sampler *p = (struct __pyx_obj_8_cdec_sa_Sampler *)o; +static void __pyx_tp_dealloc_3_sa_Sampler(PyObject *o) { + struct __pyx_obj_3_sa_Sampler *p = (struct __pyx_obj_3_sa_Sampler *)o; Py_XDECREF(((PyObject *)p->sa)); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_Sampler(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_Sampler(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_Sampler *p = (struct __pyx_obj_8_cdec_sa_Sampler *)o; + struct __pyx_obj_3_sa_Sampler *p = (struct __pyx_obj_3_sa_Sampler *)o; if (p->sa) { e = (*v)(((PyObject*)p->sa), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_8_cdec_sa_Sampler(PyObject *o) { - struct __pyx_obj_8_cdec_sa_Sampler *p = (struct __pyx_obj_8_cdec_sa_Sampler *)o; +static int __pyx_tp_clear_3_sa_Sampler(PyObject *o) { + struct __pyx_obj_3_sa_Sampler *p = (struct __pyx_obj_3_sa_Sampler *)o; PyObject* tmp; tmp = ((PyObject*)p->sa); - p->sa = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->sa = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_Sampler[] = { - {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_8_cdec_sa_7Sampler_3sample, METH_O, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_7Sampler_2sample)}, +static PyMethodDef __pyx_methods_3_sa_Sampler[] = { + {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_3_sa_7Sampler_3sample, METH_O, __Pyx_DOCSTR(__pyx_doc_3_sa_7Sampler_2sample)}, {0, 0, 0, 0} }; @@ -58038,12 +58087,12 @@ static PyBufferProcs __pyx_tp_as_buffer_Sampler = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_Sampler = { +static PyTypeObject __pyx_type_3_sa_Sampler = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.Sampler"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_Sampler), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.Sampler"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_Sampler), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_Sampler, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_Sampler, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -58064,13 +58113,13 @@ static PyTypeObject __pyx_type_8_cdec_sa_Sampler = { &__pyx_tp_as_buffer_Sampler, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("A Sampler implements a logic for choosing\n samples from a population range"), /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_Sampler, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_Sampler, /*tp_clear*/ + __pyx_tp_traverse_3_sa_Sampler, /*tp_traverse*/ + __pyx_tp_clear_3_sa_Sampler, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_Sampler, /*tp_methods*/ + __pyx_methods_3_sa_Sampler, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -58080,7 +58129,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_Sampler = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_Sampler, /*tp_new*/ + __pyx_tp_new_3_sa_Sampler, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -58093,37 +58142,37 @@ static PyTypeObject __pyx_type_8_cdec_sa_Sampler = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_8_cdec_sa_HieroCachingRuleFactory __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory; +static struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory __pyx_vtable_3_sa_HieroCachingRuleFactory; -static PyObject *__pyx_tp_new_8_cdec_sa_HieroCachingRuleFactory(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *p; +static PyObject *__pyx_tp_new_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_3_sa_HieroCachingRuleFactory *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)o); - p->__pyx_vtab = __pyx_vtabptr_8_cdec_sa_HieroCachingRuleFactory; - p->rules = ((struct __pyx_obj_8_cdec_sa_TrieTable *)Py_None); Py_INCREF(Py_None); - p->sampler = ((struct __pyx_obj_8_cdec_sa_Sampler *)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o); + p->__pyx_vtab = __pyx_vtabptr_3_sa_HieroCachingRuleFactory; + p->rules = ((struct __pyx_obj_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); + p->sampler = ((struct __pyx_obj_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); p->precomputed_index = Py_None; Py_INCREF(Py_None); p->precomputed_collocations = Py_None; Py_INCREF(Py_None); p->precompute_file = Py_None; Py_INCREF(Py_None); p->max_rank = Py_None; Py_INCREF(Py_None); p->prev_norm_prefix = Py_None; Py_INCREF(Py_None); - p->fsa = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); - p->fda = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->eda = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); - p->alignment = ((struct __pyx_obj_8_cdec_sa_Alignment *)Py_None); Py_INCREF(Py_None); - p->eid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->fid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->findexes = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - p->findexes1 = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); - if (__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_1__cinit__(o, a, k) < 0) { + p->fsa = ((struct __pyx_obj_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + p->fda = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->eda = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->alignment = ((struct __pyx_obj_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); + p->eid2symid = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->fid2symid = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes1 = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); + if (__pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(o, a, k) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_8_cdec_sa_HieroCachingRuleFactory(PyObject *o) { - struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)o; +static void __pyx_tp_dealloc_3_sa_HieroCachingRuleFactory(PyObject *o) { + struct __pyx_obj_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o; Py_XDECREF(((PyObject *)p->rules)); Py_XDECREF(((PyObject *)p->sampler)); Py_XDECREF(p->precomputed_index); @@ -58142,9 +58191,9 @@ static void __pyx_tp_dealloc_8_cdec_sa_HieroCachingRuleFactory(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa_HieroCachingRuleFactory(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa_HieroCachingRuleFactory(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)o; + struct __pyx_obj_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o; if (p->rules) { e = (*v)(((PyObject*)p->rules), a); if (e) return e; } @@ -58193,14 +58242,14 @@ static int __pyx_tp_traverse_8_cdec_sa_HieroCachingRuleFactory(PyObject *o, visi return 0; } -static int __pyx_tp_clear_8_cdec_sa_HieroCachingRuleFactory(PyObject *o) { - struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)o; +static int __pyx_tp_clear_3_sa_HieroCachingRuleFactory(PyObject *o) { + struct __pyx_obj_3_sa_HieroCachingRuleFactory *p = (struct __pyx_obj_3_sa_HieroCachingRuleFactory *)o; PyObject* tmp; tmp = ((PyObject*)p->rules); - p->rules = ((struct __pyx_obj_8_cdec_sa_TrieTable *)Py_None); Py_INCREF(Py_None); + p->rules = ((struct __pyx_obj_3_sa_TrieTable *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->sampler); - p->sampler = ((struct __pyx_obj_8_cdec_sa_Sampler *)Py_None); Py_INCREF(Py_None); + p->sampler = ((struct __pyx_obj_3_sa_Sampler *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->precomputed_index); p->precomputed_index = Py_None; Py_INCREF(Py_None); @@ -58218,44 +58267,44 @@ static int __pyx_tp_clear_8_cdec_sa_HieroCachingRuleFactory(PyObject *o) { p->prev_norm_prefix = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->fsa); - p->fsa = ((struct __pyx_obj_8_cdec_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); + p->fsa = ((struct __pyx_obj_3_sa_SuffixArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->fda); - p->fda = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->fda = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->eda); - p->eda = ((struct __pyx_obj_8_cdec_sa_DataArray *)Py_None); Py_INCREF(Py_None); + p->eda = ((struct __pyx_obj_3_sa_DataArray *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->alignment); - p->alignment = ((struct __pyx_obj_8_cdec_sa_Alignment *)Py_None); Py_INCREF(Py_None); + p->alignment = ((struct __pyx_obj_3_sa_Alignment *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->eid2symid); - p->eid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->eid2symid = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->fid2symid); - p->fid2symid = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->fid2symid = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->findexes); - p->findexes = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->findexes1); - p->findexes1 = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->findexes1 = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa_HieroCachingRuleFactory[] = { - {__Pyx_NAMESTR("configure"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_3configure, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_23HieroCachingRuleFactory_2configure)}, - {__Pyx_NAMESTR("pattern2phrase"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_5pattern2phrase, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("pattern2phrase_plus"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_7pattern2phrase_plus, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_9precompute, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_precomputed_collocation"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_11get_precomputed_collocation, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_13advance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_all_nodes_isteps_away"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("reachable"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_17reachable, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("shortest"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_19shortest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get_next_states"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_21get_next_states, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("input"), (PyCFunction)__pyx_pw_8_cdec_sa_23HieroCachingRuleFactory_23input, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8_cdec_sa_23HieroCachingRuleFactory_22input)}, +static PyMethodDef __pyx_methods_3_sa_HieroCachingRuleFactory[] = { + {__Pyx_NAMESTR("configure"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_23HieroCachingRuleFactory_2configure)}, + {__Pyx_NAMESTR("pattern2phrase"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("pattern2phrase_plus"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("precompute"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_precomputed_collocation"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collocation, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_all_nodes_isteps_away"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_away, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("reachable"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("shortest"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("get_next_states"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("input"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_23input, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3_sa_23HieroCachingRuleFactory_22input)}, {0, 0, 0, 0} }; @@ -58357,12 +58406,12 @@ static PyBufferProcs __pyx_tp_as_buffer_HieroCachingRuleFactory = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa_HieroCachingRuleFactory = { +static PyTypeObject __pyx_type_3_sa_HieroCachingRuleFactory = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.HieroCachingRuleFactory"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.HieroCachingRuleFactory"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa_HieroCachingRuleFactory), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa_HieroCachingRuleFactory, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa_HieroCachingRuleFactory, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -58383,13 +58432,13 @@ static PyTypeObject __pyx_type_8_cdec_sa_HieroCachingRuleFactory = { &__pyx_tp_as_buffer_HieroCachingRuleFactory, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("This RuleFactory implements a caching \n method using TrieTable, which makes phrase\n generation somewhat speedier -- phrases only\n need to be extracted once (however, it is\n quite possible they need to be scored \n for each input sentence, for contextual models)"), /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa_HieroCachingRuleFactory, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa_HieroCachingRuleFactory, /*tp_clear*/ + __pyx_tp_traverse_3_sa_HieroCachingRuleFactory, /*tp_traverse*/ + __pyx_tp_clear_3_sa_HieroCachingRuleFactory, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa_HieroCachingRuleFactory, /*tp_methods*/ + __pyx_methods_3_sa_HieroCachingRuleFactory, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -58399,7 +58448,7 @@ static PyTypeObject __pyx_type_8_cdec_sa_HieroCachingRuleFactory = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa_HieroCachingRuleFactory, /*tp_new*/ + __pyx_tp_new_3_sa_HieroCachingRuleFactory, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -58413,11 +58462,11 @@ static PyTypeObject __pyx_type_8_cdec_sa_HieroCachingRuleFactory = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa___pyx_scope_struct__compute_stats(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *p; +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct__compute_stats(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)o); + p = ((struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)o); p->__pyx_v_ngram = 0; p->__pyx_v_ngram_start = 0; p->__pyx_v_ngram_starts = 0; @@ -58427,8 +58476,8 @@ static PyObject *__pyx_tp_new_8_cdec_sa___pyx_scope_struct__compute_stats(PyType return o; } -static void __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct__compute_stats(PyObject *o) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)o; +static void __pyx_tp_dealloc_3_sa___pyx_scope_struct__compute_stats(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)o; Py_XDECREF(((PyObject *)p->__pyx_v_ngram)); Py_XDECREF(((PyObject *)p->__pyx_v_ngram_start)); Py_XDECREF(((PyObject *)p->__pyx_v_ngram_starts)); @@ -58438,9 +58487,9 @@ static void __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct__compute_stats(PyObjec (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct__compute_stats(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa___pyx_scope_struct__compute_stats(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)o; + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)o; if (p->__pyx_v_ngram) { e = (*v)(p->__pyx_v_ngram, a); if (e) return e; } @@ -58462,31 +58511,31 @@ static int __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct__compute_stats(PyObjec return 0; } -static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct__compute_stats(PyObject *o) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats *)o; +static int __pyx_tp_clear_3_sa___pyx_scope_struct__compute_stats(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *p = (struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats *)o; PyObject* tmp; tmp = ((PyObject*)p->__pyx_v_ngram); p->__pyx_v_ngram = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_ngram_start); - p->__pyx_v_ngram_start = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_ngram_starts); p->__pyx_v_ngram_starts = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_run_start); - p->__pyx_v_run_start = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_run_start = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_8_cdec_sa_LCP *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_3_sa_LCP *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_veb); - p->__pyx_v_veb = ((struct __pyx_obj_8_cdec_sa_VEB *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa___pyx_scope_struct__compute_stats[] = { +static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct__compute_stats[] = { {0, 0, 0, 0} }; @@ -58588,12 +58637,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__compute_stats = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats = { +static PyTypeObject __pyx_type_3_sa___pyx_scope_struct__compute_stats = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.__pyx_scope_struct__compute_stats"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa___pyx_scope_struct__compute_stats), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.__pyx_scope_struct__compute_stats"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa___pyx_scope_struct__compute_stats), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct__compute_stats, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa___pyx_scope_struct__compute_stats, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -58614,13 +58663,204 @@ static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats = { &__pyx_tp_as_buffer___pyx_scope_struct__compute_stats, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct__compute_stats, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa___pyx_scope_struct__compute_stats, /*tp_clear*/ + __pyx_tp_traverse_3_sa___pyx_scope_struct__compute_stats, /*tp_traverse*/ + __pyx_tp_clear_3_sa___pyx_scope_struct__compute_stats, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3_sa___pyx_scope_struct__compute_stats, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3_sa___pyx_scope_struct__compute_stats, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif +}; + +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *p; + PyObject *o = (*t->tp_alloc)(t, 0); + if (!o) return 0; + p = ((struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)o); + p->__pyx_v_self = 0; + return o; +} + +static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_1___iter__(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)o; + Py_XDECREF(((PyObject *)p->__pyx_v_self)); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_3_sa___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)o; + if (p->__pyx_v_self) { + e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3_sa___pyx_scope_struct_1___iter__(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__ *)o; + PyObject* tmp; + tmp = ((PyObject*)p->__pyx_v_self); + p->__pyx_v_self = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_1___iter__[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1___iter__ = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + #if PY_VERSION_HEX >= 0x02050000 + 0, /*nb_index*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1___iter__ = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_1___iter__ = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1___iter__ = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_1___iter__ = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("_sa.__pyx_scope_struct_1___iter__"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_1___iter__), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3_sa___pyx_scope_struct_1___iter__, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + &__pyx_tp_as_number___pyx_scope_struct_1___iter__, /*tp_as_number*/ + &__pyx_tp_as_sequence___pyx_scope_struct_1___iter__, /*tp_as_sequence*/ + &__pyx_tp_as_mapping___pyx_scope_struct_1___iter__, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer___pyx_scope_struct_1___iter__, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3_sa___pyx_scope_struct_1___iter__, /*tp_traverse*/ + __pyx_tp_clear_3_sa___pyx_scope_struct_1___iter__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa___pyx_scope_struct__compute_stats, /*tp_methods*/ + __pyx_methods_3_sa___pyx_scope_struct_1___iter__, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -58630,7 +58870,7 @@ static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa___pyx_scope_struct__compute_stats, /*tp_new*/ + __pyx_tp_new_3_sa___pyx_scope_struct_1___iter__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -58644,11 +58884,11 @@ static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats = { #endif }; -static PyObject *__pyx_tp_new_8_cdec_sa___pyx_scope_struct_1_input(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *p; +static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_2_input(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)o); + p = ((struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)o); p->__pyx_v_alignment = 0; p->__pyx_v_als = 0; p->__pyx_v_alslist = 0; @@ -58690,21 +58930,20 @@ static PyObject *__pyx_tp_new_8_cdec_sa___pyx_scope_struct_1_input(PyTypeObject p->__pyx_v_self = 0; p->__pyx_v_spanlen = 0; p->__pyx_v_stop_time = 0; - p->__pyx_v_str_phrase = 0; p->__pyx_v_suffix_link = 0; p->__pyx_v_suffix_link_xcat_index = 0; p->__pyx_v_word_id = 0; p->__pyx_v_xcat_index = 0; p->__pyx_v_xnode = 0; p->__pyx_v_xroot = 0; - p->__pyx_t_2 = 0; - p->__pyx_t_3 = 0; + p->__pyx_t_1 = 0; p->__pyx_t_4 = 0; + p->__pyx_t_5 = 0; return o; } -static void __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)o; +static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_2_input(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *p = (struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)o; Py_XDECREF(p->__pyx_v_alignment); Py_XDECREF(p->__pyx_v_als); Py_XDECREF(p->__pyx_v_alslist); @@ -58746,22 +58985,21 @@ static void __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { Py_XDECREF(((PyObject *)p->__pyx_v_self)); Py_XDECREF(p->__pyx_v_spanlen); Py_XDECREF(p->__pyx_v_stop_time); - Py_XDECREF(p->__pyx_v_str_phrase); Py_XDECREF(p->__pyx_v_suffix_link); Py_XDECREF(p->__pyx_v_suffix_link_xcat_index); Py_XDECREF(p->__pyx_v_word_id); Py_XDECREF(p->__pyx_v_xcat_index); Py_XDECREF(p->__pyx_v_xnode); Py_XDECREF(p->__pyx_v_xroot); - Py_XDECREF(p->__pyx_t_2); - Py_XDECREF(p->__pyx_t_3); + Py_XDECREF(p->__pyx_t_1); Py_XDECREF(p->__pyx_t_4); + Py_XDECREF(p->__pyx_t_5); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_3_sa___pyx_scope_struct_2_input(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)o; + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *p = (struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)o; if (p->__pyx_v_alignment) { e = (*v)(p->__pyx_v_alignment, a); if (e) return e; } @@ -58885,9 +59123,6 @@ static int __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o, v if (p->__pyx_v_stop_time) { e = (*v)(p->__pyx_v_stop_time, a); if (e) return e; } - if (p->__pyx_v_str_phrase) { - e = (*v)(p->__pyx_v_str_phrase, a); if (e) return e; - } if (p->__pyx_v_suffix_link) { e = (*v)(p->__pyx_v_suffix_link, a); if (e) return e; } @@ -58906,20 +59141,20 @@ static int __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o, v if (p->__pyx_v_xroot) { e = (*v)(p->__pyx_v_xroot, a); if (e) return e; } - if (p->__pyx_t_2) { - e = (*v)(p->__pyx_t_2, a); if (e) return e; - } - if (p->__pyx_t_3) { - e = (*v)(p->__pyx_t_3, a); if (e) return e; + if (p->__pyx_t_1) { + e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } + if (p->__pyx_t_5) { + e = (*v)(p->__pyx_t_5, a); if (e) return e; + } return 0; } -static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { - struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *p = (struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input *)o; +static int __pyx_tp_clear_3_sa___pyx_scope_struct_2_input(PyObject *o) { + struct __pyx_obj_3_sa___pyx_scope_struct_2_input *p = (struct __pyx_obj_3_sa___pyx_scope_struct_2_input *)o; PyObject* tmp; tmp = ((PyObject*)p->__pyx_v_alignment); p->__pyx_v_alignment = Py_None; Py_INCREF(Py_None); @@ -58931,7 +59166,7 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { p->__pyx_v_alslist = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_chunklen); - p->__pyx_v_chunklen = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_count); p->__pyx_v_count = Py_None; Py_INCREF(Py_None); @@ -58982,7 +59217,7 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { p->__pyx_v_fwords = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_hiero_phrase); - p->__pyx_v_hiero_phrase = ((struct __pyx_obj_8_cdec_sa_Phrase *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_is_shadow_path); p->__pyx_v_is_shadow_path = Py_None; Py_INCREF(Py_None); @@ -59018,7 +59253,7 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { p->__pyx_v_phrase = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_phrase_location); - p->__pyx_v_phrase_location = ((struct __pyx_obj_8_cdec_sa_PhraseLocation *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_prefix); p->__pyx_v_prefix = Py_None; Py_INCREF(Py_None); @@ -59030,13 +59265,13 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { p->__pyx_v_sa_range = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_sample); - p->__pyx_v_sample = ((struct __pyx_obj_8_cdec_sa_IntList *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_scores); p->__pyx_v_scores = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); - p->__pyx_v_self = ((struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); + p->__pyx_v_self = ((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_spanlen); p->__pyx_v_spanlen = Py_None; Py_INCREF(Py_None); @@ -59044,9 +59279,6 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { tmp = ((PyObject*)p->__pyx_v_stop_time); p->__pyx_v_stop_time = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_str_phrase); - p->__pyx_v_str_phrase = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_suffix_link); p->__pyx_v_suffix_link = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -59065,23 +59297,23 @@ static int __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input(PyObject *o) { tmp = ((PyObject*)p->__pyx_v_xroot); p->__pyx_v_xroot = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_2); - p->__pyx_t_2 = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_t_3); - p->__pyx_t_3 = Py_None; Py_INCREF(Py_None); + tmp = ((PyObject*)p->__pyx_t_1); + p->__pyx_t_1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_t_4); p->__pyx_t_4 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_t_5); + p->__pyx_t_5 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_8_cdec_sa___pyx_scope_struct_1_input[] = { +static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_2_input[] = { {0, 0, 0, 0} }; -static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_input = { +static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_2_input = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ @@ -59139,7 +59371,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_input = { #endif }; -static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_input = { +static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_2_input = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ @@ -59152,13 +59384,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_input = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_1_input = { +static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_2_input = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_input = { +static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_2_input = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -59179,12 +59411,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_input = { #endif }; -static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct_1_input = { +static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_2_input = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("_cdec_sa.__pyx_scope_struct_1_input"), /*tp_name*/ - sizeof(struct __pyx_obj_8_cdec_sa___pyx_scope_struct_1_input), /*tp_basicsize*/ + __Pyx_NAMESTR("_sa.__pyx_scope_struct_2_input"), /*tp_name*/ + sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_2_input), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_8_cdec_sa___pyx_scope_struct_1_input, /*tp_dealloc*/ + __pyx_tp_dealloc_3_sa___pyx_scope_struct_2_input, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -59194,24 +59426,24 @@ static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct_1_input = { 0, /*reserved*/ #endif 0, /*tp_repr*/ - &__pyx_tp_as_number___pyx_scope_struct_1_input, /*tp_as_number*/ - &__pyx_tp_as_sequence___pyx_scope_struct_1_input, /*tp_as_sequence*/ - &__pyx_tp_as_mapping___pyx_scope_struct_1_input, /*tp_as_mapping*/ + &__pyx_tp_as_number___pyx_scope_struct_2_input, /*tp_as_number*/ + &__pyx_tp_as_sequence___pyx_scope_struct_2_input, /*tp_as_sequence*/ + &__pyx_tp_as_mapping___pyx_scope_struct_2_input, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer___pyx_scope_struct_1_input, /*tp_as_buffer*/ + &__pyx_tp_as_buffer___pyx_scope_struct_2_input, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_8_cdec_sa___pyx_scope_struct_1_input, /*tp_traverse*/ - __pyx_tp_clear_8_cdec_sa___pyx_scope_struct_1_input, /*tp_clear*/ + __pyx_tp_traverse_3_sa___pyx_scope_struct_2_input, /*tp_traverse*/ + __pyx_tp_clear_3_sa___pyx_scope_struct_2_input, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_8_cdec_sa___pyx_scope_struct_1_input, /*tp_methods*/ + __pyx_methods_3_sa___pyx_scope_struct_2_input, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -59221,7 +59453,7 @@ static PyTypeObject __pyx_type_8_cdec_sa___pyx_scope_struct_1_input = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_8_cdec_sa___pyx_scope_struct_1_input, /*tp_new*/ + __pyx_tp_new_3_sa___pyx_scope_struct_2_input, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -59242,7 +59474,7 @@ static PyMethodDef __pyx_methods[] = { #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_cdec_sa"), + __Pyx_NAMESTR("_sa"), 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, @@ -59288,7 +59520,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0}, {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0}, {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0}, + {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0}, {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, @@ -59356,9 +59588,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s____exit__, __pyx_k____exit__, sizeof(__pyx_k____exit__), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___cdec_sa, __pyx_k___cdec_sa, sizeof(__pyx_k___cdec_sa), 0, 0, 1, 1}, {&__pyx_n_s___columns, __pyx_k___columns, sizeof(__pyx_k___columns), 0, 0, 1, 1}, {&__pyx_n_s___doquicksort, __pyx_k___doquicksort, sizeof(__pyx_k___doquicksort), 0, 0, 1, 1}, + {&__pyx_n_s___sa, __pyx_k___sa, sizeof(__pyx_k___sa), 0, 0, 1, 1}, {&__pyx_n_s__advance, __pyx_k__advance, sizeof(__pyx_k__advance), 0, 0, 1, 1}, {&__pyx_n_s__alignment, __pyx_k__alignment, sizeof(__pyx_k__alignment), 0, 0, 1, 1}, {&__pyx_n_s__alphabet_size, __pyx_k__alphabet_size, sizeof(__pyx_k__alphabet_size), 0, 0, 1, 1}, @@ -59484,10 +59716,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1}, {&__pyx_n_s__string, __pyx_k__string, sizeof(__pyx_k__string), 0, 0, 1, 1}, {&__pyx_n_s__suffix_link, __pyx_k__suffix_link, sizeof(__pyx_k__suffix_link), 0, 0, 1, 1}, - {&__pyx_n_s__sym, __pyx_k__sym, sizeof(__pyx_k__sym), 0, 0, 1, 1}, {&__pyx_n_s__sym_fromstring, __pyx_k__sym_fromstring, sizeof(__pyx_k__sym_fromstring), 0, 0, 1, 1}, - {&__pyx_n_s__sym_isvar, __pyx_k__sym_isvar, sizeof(__pyx_k__sym_isvar), 0, 0, 1, 1}, - {&__pyx_n_s__sym_tostring, __pyx_k__sym_tostring, sizeof(__pyx_k__sym_tostring), 0, 0, 1, 1}, {&__pyx_n_s__terminal, __pyx_k__terminal, sizeof(__pyx_k__terminal), 0, 0, 1, 1}, {&__pyx_n_s__tight_phrases, __pyx_k__tight_phrases, sizeof(__pyx_k__tight_phrases), 0, 0, 1, 1}, {&__pyx_n_s__toMap, __pyx_k__toMap, sizeof(__pyx_k__toMap), 0, 0, 1, 1}, @@ -59517,8 +59746,8 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; __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[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -60052,7 +60281,7 @@ static int __Pyx_InitCachedConstants(void) { * cdef float start_time = monitor_cpu() * */ - __pyx_k_tuple_71 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_71 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_71); __Pyx_INCREF(((PyObject *)__pyx_kp_s_70)); PyTuple_SET_ITEM(__pyx_k_tuple_71, 0, ((PyObject *)__pyx_kp_s_70)); @@ -60066,7 +60295,7 @@ static int __Pyx_InitCachedConstants(void) { * N = len(data) * for i from 0 <= i < N: */ - __pyx_k_tuple_73 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_73 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_73); __Pyx_INCREF(((PyObject *)__pyx_kp_s_72)); PyTuple_SET_ITEM(__pyx_k_tuple_73, 0, ((PyObject *)__pyx_kp_s_72)); @@ -60080,7 +60309,7 @@ static int __Pyx_InitCachedConstants(void) { * N = len(queue) * ptr1 = 0 */ - __pyx_k_tuple_75 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_75 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_75); __Pyx_INCREF(((PyObject *)__pyx_kp_s_74)); PyTuple_SET_ITEM(__pyx_k_tuple_75, 0, ((PyObject *)__pyx_kp_s_74)); @@ -60094,7 +60323,7 @@ static int __Pyx_InitCachedConstants(void) { * J2_set.add(combined_pattern) * */ - __pyx_k_tuple_77 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_77 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_77); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_k_tuple_77, 0, __pyx_int_neg_1); @@ -60108,7 +60337,7 @@ static int __Pyx_InitCachedConstants(void) { * IJ_set.add(combined_pattern) * */ - __pyx_k_tuple_78 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_78 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_78); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_k_tuple_78, 0, __pyx_int_neg_1); @@ -60122,7 +60351,7 @@ static int __Pyx_InitCachedConstants(void) { * IJ_set.add(combined_pattern) * combined_pattern = pattern2 + (-1,) + pattern1 */ - __pyx_k_tuple_79 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_79 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_79); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_k_tuple_79, 0, __pyx_int_neg_1); @@ -60136,7 +60365,7 @@ static int __Pyx_InitCachedConstants(void) { * IJ_set.add(combined_pattern) * */ - __pyx_k_tuple_80 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_80 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_80); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_k_tuple_80, 0, __pyx_int_neg_1); @@ -60150,7 +60379,7 @@ static int __Pyx_InitCachedConstants(void) { * for i from 0 <= i < N: * j = isa.arr[i] */ - __pyx_k_tuple_91 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_91 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_91); __Pyx_INCREF(((PyObject *)__pyx_kp_s_90)); PyTuple_SET_ITEM(__pyx_k_tuple_91, 0, ((PyObject *)__pyx_kp_s_90)); @@ -60164,7 +60393,7 @@ static int __Pyx_InitCachedConstants(void) { * for w_i in self.ha: * f.write("%d " % w_i) */ - __pyx_k_tuple_94 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_94 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_94); __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); PyTuple_SET_ITEM(__pyx_k_tuple_94, 0, ((PyObject *)__pyx_kp_s_14)); @@ -60178,7 +60407,7 @@ static int __Pyx_InitCachedConstants(void) { * * cdef int __search_high(self, int word_id, int offset, int low, int high): */ - __pyx_k_tuple_95 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_95 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_95); __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); PyTuple_SET_ITEM(__pyx_k_tuple_95, 0, ((PyObject *)__pyx_kp_s_14)); @@ -60192,7 +60421,7 @@ static int __Pyx_InitCachedConstants(void) { * self.darray.write_enhanced_handle(f) * for a_i in self.sa: */ - __pyx_k_tuple_96 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_96 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_96); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_k_tuple_96, 0, Py_None); @@ -60233,21 +60462,21 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_104)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1005 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":1004 * else: * #ERROR: We never get here * raise Exception("Keyword trie error") # <<<<<<<<<<<<<< * # checking whether lookup_required * if lookup_required: */ - __pyx_k_tuple_120 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_120 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_120); __Pyx_INCREF(((PyObject *)__pyx_kp_s_119)); PyTuple_SET_ITEM(__pyx_k_tuple_120, 0, ((PyObject *)__pyx_kp_s_119)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_119)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120)); - /* "_cdec_sa.pyx":9 + /* "_sa.pyx":9 * resource.getrusage(resource.RUSAGE_SELF).ru_stime) * * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< @@ -60265,7 +60494,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132)); __pyx_k_codeobj_133 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_134, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "_cdec_sa.pyx":15 + /* "_sa.pyx":15 * return open(filename) * * logger = logging.getLogger('cdec.sa') # <<<<<<<<<<<<<< @@ -60279,59 +60508,22 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_135)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136)); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":91 - * cdef Alphabet ALPHABET = Alphabet() - * - * def sym_tostring(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.tostring(sym) - * - */ - __pyx_k_tuple_137 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_137); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sym)); - PyTuple_SET_ITEM(__pyx_k_tuple_137, 0, ((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sym)); - PyTuple_SET_ITEM(__pyx_k_tuple_137, 1, ((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137)); - __pyx_k_codeobj_138 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_139, __pyx_n_s__sym_tostring, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_138)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":94 - * return ALPHABET.tostring(sym) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":104 + * return ALPHABET.setindex(sym, id) * * def sym_fromstring(bytes string, bint terminal): # <<<<<<<<<<<<<< * return ALPHABET.fromstring(string, terminal) - * */ - __pyx_k_tuple_140 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_140); + __pyx_k_tuple_137 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_k_tuple_137); __Pyx_INCREF(((PyObject *)__pyx_n_s__string)); - PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_n_s__string)); + PyTuple_SET_ITEM(__pyx_k_tuple_137, 0, ((PyObject *)__pyx_n_s__string)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__string)); __Pyx_INCREF(((PyObject *)__pyx_n_s__terminal)); - PyTuple_SET_ITEM(__pyx_k_tuple_140, 1, ((PyObject *)__pyx_n_s__terminal)); + PyTuple_SET_ITEM(__pyx_k_tuple_137, 1, ((PyObject *)__pyx_n_s__terminal)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__terminal)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140)); - __pyx_k_codeobj_141 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_139, __pyx_n_s__sym_fromstring, 94, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_141)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":97 - * return ALPHABET.fromstring(string, terminal) - * - * def sym_isvar(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.isvar(sym) - * - */ - __pyx_k_tuple_142 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_142); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sym)); - PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sym)); - PyTuple_SET_ITEM(__pyx_k_tuple_142, 1, ((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142)); - __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_139, __pyx_n_s__sym_isvar, 97, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137)); + __pyx_k_codeobj_138 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_139, __pyx_n_s__sym_fromstring, 104, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_138)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -60356,11 +60548,11 @@ static int __Pyx_InitGlobals(void) { } #if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_cdec_sa(void); /*proto*/ -PyMODINIT_FUNC init_cdec_sa(void) +PyMODINIT_FUNC init_sa(void); /*proto*/ +PyMODINIT_FUNC init_sa(void) #else -PyMODINIT_FUNC PyInit__cdec_sa(void); /*proto*/ -PyMODINIT_FUNC PyInit__cdec_sa(void) +PyMODINIT_FUNC PyInit__sa(void); /*proto*/ +PyMODINIT_FUNC PyInit__sa(void) #endif { PyObject *__pyx_t_1 = NULL; @@ -60377,7 +60569,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__cdec_sa(void)", 0); + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__sa(void)", 0); if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -60399,7 +60591,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_cdec_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sa"), __pyx_methods, 0, 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -60409,10 +60601,13 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) #endif __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main__cdec_sa) { + if (__pyx_module_is_main__sa) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ @@ -60420,180 +60615,186 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ - __pyx_v_8_cdec_sa_ALPHABET = ((struct __pyx_obj_8_cdec_sa_Alphabet *)Py_None); Py_INCREF(Py_None); + __pyx_v_3_sa_ALPHABET = ((struct __pyx_obj_3_sa_Alphabet *)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ + if (__Pyx_ExportFunction("sym_tostring", (void (*)(void))__pyx_f_3_sa_sym_tostring, "char *(int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("sym_tocat", (void (*)(void))__pyx_f_3_sa_sym_tocat, "char *(int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("sym_isvar", (void (*)(void))__pyx_f_3_sa_sym_isvar, "int (int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_ExportFunction("sym_getindex", (void (*)(void))__pyx_f_3_sa_sym_getindex, "int (int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Type init code ---*/ - __pyx_vtabptr_8_cdec_sa_FloatList = &__pyx_vtable_8_cdec_sa_FloatList; - __pyx_vtable_8_cdec_sa_FloatList.set = (void (*)(struct __pyx_obj_8_cdec_sa_FloatList *, int, float))__pyx_f_8_cdec_sa_9FloatList_set; - __pyx_vtable_8_cdec_sa_FloatList.write_handle = (void (*)(struct __pyx_obj_8_cdec_sa_FloatList *, FILE *))__pyx_f_8_cdec_sa_9FloatList_write_handle; - __pyx_vtable_8_cdec_sa_FloatList.read_handle = (void (*)(struct __pyx_obj_8_cdec_sa_FloatList *, FILE *))__pyx_f_8_cdec_sa_9FloatList_read_handle; - if (PyType_Ready(&__pyx_type_8_cdec_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_FloatList.tp_dict, __pyx_vtabptr_8_cdec_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "FloatList", (PyObject *)&__pyx_type_8_cdec_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_FloatList = &__pyx_type_8_cdec_sa_FloatList; - __pyx_vtabptr_8_cdec_sa_IntList = &__pyx_vtable_8_cdec_sa_IntList; - __pyx_vtable_8_cdec_sa_IntList.set = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, int, int))__pyx_f_8_cdec_sa_7IntList_set; - __pyx_vtable_8_cdec_sa_IntList._append = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, int))__pyx_f_8_cdec_sa_7IntList__append; - __pyx_vtable_8_cdec_sa_IntList._extend = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, struct __pyx_obj_8_cdec_sa_IntList *))__pyx_f_8_cdec_sa_7IntList__extend; - __pyx_vtable_8_cdec_sa_IntList._extend_arr = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, int *, int))__pyx_f_8_cdec_sa_7IntList__extend_arr; - __pyx_vtable_8_cdec_sa_IntList._clear = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *))__pyx_f_8_cdec_sa_7IntList__clear; - __pyx_vtable_8_cdec_sa_IntList.write_handle = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, FILE *))__pyx_f_8_cdec_sa_7IntList_write_handle; - __pyx_vtable_8_cdec_sa_IntList.read_handle = (void (*)(struct __pyx_obj_8_cdec_sa_IntList *, FILE *))__pyx_f_8_cdec_sa_7IntList_read_handle; - if (PyType_Ready(&__pyx_type_8_cdec_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_IntList.tp_dict, __pyx_vtabptr_8_cdec_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "IntList", (PyObject *)&__pyx_type_8_cdec_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_IntList = &__pyx_type_8_cdec_sa_IntList; - __pyx_vtabptr_8_cdec_sa_StringMap = &__pyx_vtable_8_cdec_sa_StringMap; - __pyx_vtable_8_cdec_sa_StringMap.word = (char *(*)(struct __pyx_obj_8_cdec_sa_StringMap *, int))__pyx_f_8_cdec_sa_9StringMap_word; - __pyx_vtable_8_cdec_sa_StringMap.index = (int (*)(struct __pyx_obj_8_cdec_sa_StringMap *, char *))__pyx_f_8_cdec_sa_9StringMap_index; - if (PyType_Ready(&__pyx_type_8_cdec_sa_StringMap) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_StringMap.tp_dict, __pyx_vtabptr_8_cdec_sa_StringMap) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "StringMap", (PyObject *)&__pyx_type_8_cdec_sa_StringMap) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_StringMap = &__pyx_type_8_cdec_sa_StringMap; - __pyx_vtabptr_8_cdec_sa_DataArray = &__pyx_vtable_8_cdec_sa_DataArray; - __pyx_vtable_8_cdec_sa_DataArray.read_handle = (void (*)(struct __pyx_obj_8_cdec_sa_DataArray *, FILE *))__pyx_f_8_cdec_sa_9DataArray_read_handle; - __pyx_vtable_8_cdec_sa_DataArray.write_handle = (void (*)(struct __pyx_obj_8_cdec_sa_DataArray *, FILE *))__pyx_f_8_cdec_sa_9DataArray_write_handle; - if (PyType_Ready(&__pyx_type_8_cdec_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_DataArray.tp_dict, __pyx_vtabptr_8_cdec_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "DataArray", (PyObject *)&__pyx_type_8_cdec_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_DataArray = &__pyx_type_8_cdec_sa_DataArray; - __pyx_vtabptr_8_cdec_sa_Alignment = &__pyx_vtable_8_cdec_sa_Alignment; - __pyx_vtable_8_cdec_sa_Alignment.link = (int (*)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int))__pyx_f_8_cdec_sa_9Alignment_link; - __pyx_vtable_8_cdec_sa_Alignment._unlink = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int *, int *))__pyx_f_8_cdec_sa_9Alignment__unlink; - __pyx_vtable_8_cdec_sa_Alignment._get_sent_links = (int *(*)(struct __pyx_obj_8_cdec_sa_Alignment *, int, int *))__pyx_f_8_cdec_sa_9Alignment__get_sent_links; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_Alignment.tp_dict, __pyx_vtabptr_8_cdec_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Alignment", (PyObject *)&__pyx_type_8_cdec_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Alignment = &__pyx_type_8_cdec_sa_Alignment; - __pyx_vtabptr_8_cdec_sa_BiLex = &__pyx_vtable_8_cdec_sa_BiLex; - __pyx_vtable_8_cdec_sa_BiLex.compute_from_data = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, struct __pyx_obj_8_cdec_sa_SuffixArray *, struct __pyx_obj_8_cdec_sa_DataArray *, struct __pyx_obj_8_cdec_sa_Alignment *))__pyx_f_8_cdec_sa_5BiLex_compute_from_data; - __pyx_vtable_8_cdec_sa_BiLex._add_node = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, struct __pyx_t_8_cdec_sa__node *, int *, float, int *))__pyx_f_8_cdec_sa_5BiLex__add_node; - __pyx_vtable_8_cdec_sa_BiLex.write_wordlist = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, PyObject *, FILE *))__pyx_f_8_cdec_sa_5BiLex_write_wordlist; - __pyx_vtable_8_cdec_sa_BiLex.read_wordlist = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, PyObject *, PyObject *, FILE *))__pyx_f_8_cdec_sa_5BiLex_read_wordlist; - __pyx_vtable_8_cdec_sa_BiLex.swap = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, int, int))__pyx_f_8_cdec_sa_5BiLex_swap; - __pyx_vtable_8_cdec_sa_BiLex.qsort = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_BiLex *, int, int, PyObject *))__pyx_f_8_cdec_sa_5BiLex_qsort; - if (PyType_Ready(&__pyx_type_8_cdec_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_BiLex.tp_dict, __pyx_vtabptr_8_cdec_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BiLex", (PyObject *)&__pyx_type_8_cdec_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_BiLex = &__pyx_type_8_cdec_sa_BiLex; - if (PyType_Ready(&__pyx_type_8_cdec_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BitSetIterator", (PyObject *)&__pyx_type_8_cdec_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_BitSetIterator = &__pyx_type_8_cdec_sa_BitSetIterator; - if (PyType_Ready(&__pyx_type_8_cdec_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BitSet", (PyObject *)&__pyx_type_8_cdec_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_BitSet = &__pyx_type_8_cdec_sa_BitSet; - if (PyType_Ready(&__pyx_type_8_cdec_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "VEBIterator", (PyObject *)&__pyx_type_8_cdec_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_VEBIterator = &__pyx_type_8_cdec_sa_VEBIterator; - __pyx_vtabptr_8_cdec_sa_VEB = &__pyx_vtable_8_cdec_sa_VEB; - __pyx_vtable_8_cdec_sa_VEB._findsucc = (int (*)(struct __pyx_obj_8_cdec_sa_VEB *, int))__pyx_f_8_cdec_sa_3VEB__findsucc; - __pyx_vtable_8_cdec_sa_VEB._insert = (int (*)(struct __pyx_obj_8_cdec_sa_VEB *, int))__pyx_f_8_cdec_sa_3VEB__insert; - __pyx_vtable_8_cdec_sa_VEB._first = (int (*)(struct __pyx_obj_8_cdec_sa_VEB *))__pyx_f_8_cdec_sa_3VEB__first; - if (PyType_Ready(&__pyx_type_8_cdec_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_VEB.tp_dict, __pyx_vtabptr_8_cdec_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "VEB", (PyObject *)&__pyx_type_8_cdec_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_VEB = &__pyx_type_8_cdec_sa_VEB; - if (PyType_Ready(&__pyx_type_8_cdec_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "LCP", (PyObject *)&__pyx_type_8_cdec_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_LCP = &__pyx_type_8_cdec_sa_LCP; - __pyx_vtabptr_8_cdec_sa_Alphabet = &__pyx_vtable_8_cdec_sa_Alphabet; - __pyx_vtable_8_cdec_sa_Alphabet.isvar = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_isvar; - __pyx_vtable_8_cdec_sa_Alphabet.isword = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_isword; - __pyx_vtable_8_cdec_sa_Alphabet.getindex = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_getindex; - __pyx_vtable_8_cdec_sa_Alphabet.setindex = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int, int))__pyx_f_8_cdec_sa_8Alphabet_setindex; - __pyx_vtable_8_cdec_sa_Alphabet.clearindex = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_clearindex; - __pyx_vtable_8_cdec_sa_Alphabet.match = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int, int))__pyx_f_8_cdec_sa_8Alphabet_match; - __pyx_vtable_8_cdec_sa_Alphabet.tocat = (char *(*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_tocat; - __pyx_vtable_8_cdec_sa_Alphabet.fromcat = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, char *))__pyx_f_8_cdec_sa_8Alphabet_fromcat; - __pyx_vtable_8_cdec_sa_Alphabet.tostring = (char *(*)(struct __pyx_obj_8_cdec_sa_Alphabet *, int))__pyx_f_8_cdec_sa_8Alphabet_tostring; - __pyx_vtable_8_cdec_sa_Alphabet.fromstring = (int (*)(struct __pyx_obj_8_cdec_sa_Alphabet *, char *, int))__pyx_f_8_cdec_sa_8Alphabet_fromstring; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_Alphabet.tp_dict, __pyx_vtabptr_8_cdec_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Alphabet", (PyObject *)&__pyx_type_8_cdec_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Alphabet = &__pyx_type_8_cdec_sa_Alphabet; - __pyx_vtabptr_8_cdec_sa_Phrase = &__pyx_vtable_8_cdec_sa_Phrase; - __pyx_vtable_8_cdec_sa_Phrase.chunkpos = (int (*)(struct __pyx_obj_8_cdec_sa_Phrase *, int))__pyx_f_8_cdec_sa_6Phrase_chunkpos; - __pyx_vtable_8_cdec_sa_Phrase.chunklen = (int (*)(struct __pyx_obj_8_cdec_sa_Phrase *, int))__pyx_f_8_cdec_sa_6Phrase_chunklen; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_Phrase.tp_dict, __pyx_vtabptr_8_cdec_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Phrase", (PyObject *)&__pyx_type_8_cdec_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Phrase = &__pyx_type_8_cdec_sa_Phrase; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_8_cdec_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Rule = &__pyx_type_8_cdec_sa_Rule; - __pyx_vtabptr_8_cdec_sa_TrieMap = &__pyx_vtable_8_cdec_sa_TrieMap; - __pyx_vtable_8_cdec_sa_TrieMap._insert = (struct __pyx_t_8_cdec_sa__Trie_Node *(*)(struct __pyx_obj_8_cdec_sa_TrieMap *, int *, int))__pyx_f_8_cdec_sa_7TrieMap__insert; - __pyx_vtable_8_cdec_sa_TrieMap._contains = (struct __pyx_t_8_cdec_sa__Trie_Node *(*)(struct __pyx_obj_8_cdec_sa_TrieMap *, int *, int))__pyx_f_8_cdec_sa_7TrieMap__contains; - if (PyType_Ready(&__pyx_type_8_cdec_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_TrieMap.tp_dict, __pyx_vtabptr_8_cdec_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieMap", (PyObject *)&__pyx_type_8_cdec_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_TrieMap = &__pyx_type_8_cdec_sa_TrieMap; - __pyx_vtabptr_8_cdec_sa_Precomputation = &__pyx_vtable_8_cdec_sa_Precomputation; - __pyx_vtable_8_cdec_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_Precomputation *, FILE *))__pyx_f_8_cdec_sa_14Precomputation_read_map; - __pyx_vtable_8_cdec_sa_Precomputation.write_map = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_Precomputation *, PyObject *, FILE *))__pyx_f_8_cdec_sa_14Precomputation_write_map; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_Precomputation.tp_dict, __pyx_vtabptr_8_cdec_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Precomputation", (PyObject *)&__pyx_type_8_cdec_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Precomputation = &__pyx_type_8_cdec_sa_Precomputation; - __pyx_vtabptr_8_cdec_sa_SuffixArray = &__pyx_vtable_8_cdec_sa_SuffixArray; - __pyx_vtable_8_cdec_sa_SuffixArray.__pyx___search_high = (int (*)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int))__pyx_f_8_cdec_sa_11SuffixArray___search_high; - __pyx_vtable_8_cdec_sa_SuffixArray.__pyx___search_low = (int (*)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int))__pyx_f_8_cdec_sa_11SuffixArray___search_low; - __pyx_vtable_8_cdec_sa_SuffixArray.__pyx___get_range = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int, int))__pyx_f_8_cdec_sa_11SuffixArray___get_range; - __pyx_vtable_8_cdec_sa_SuffixArray.__pyx___lookup_helper = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_SuffixArray *, int, int, int, int))__pyx_f_8_cdec_sa_11SuffixArray___lookup_helper; - if (PyType_Ready(&__pyx_type_8_cdec_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_SuffixArray.tp_dict, __pyx_vtabptr_8_cdec_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "SuffixArray", (PyObject *)&__pyx_type_8_cdec_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_SuffixArray = &__pyx_type_8_cdec_sa_SuffixArray; - if (PyType_Ready(&__pyx_type_8_cdec_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_8_cdec_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_TrieNode = &__pyx_type_8_cdec_sa_TrieNode; - __pyx_type_8_cdec_sa_ExtendedTrieNode.tp_base = __pyx_ptype_8_cdec_sa_TrieNode; - if (PyType_Ready(&__pyx_type_8_cdec_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_8_cdec_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_ExtendedTrieNode = &__pyx_type_8_cdec_sa_ExtendedTrieNode; - if (PyType_Ready(&__pyx_type_8_cdec_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_8_cdec_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_TrieTable = &__pyx_type_8_cdec_sa_TrieTable; - __pyx_vtabptr_8_cdec_sa_PhraseLocation = &__pyx_vtable_8_cdec_sa_PhraseLocation; - __pyx_vtable_8_cdec_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_8_cdec_sa_PhraseLocation *, int))__pyx_f_8_cdec_sa_14PhraseLocation_contains; - if (PyType_Ready(&__pyx_type_8_cdec_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_PhraseLocation.tp_dict, __pyx_vtabptr_8_cdec_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_8_cdec_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_PhraseLocation = &__pyx_type_8_cdec_sa_PhraseLocation; - if (PyType_Ready(&__pyx_type_8_cdec_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_8_cdec_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_Sampler = &__pyx_type_8_cdec_sa_Sampler; - __pyx_vtabptr_8_cdec_sa_HieroCachingRuleFactory = &__pyx_vtable_8_cdec_sa_HieroCachingRuleFactory; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.set_idmap = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_DataArray *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_set_idmap; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.baeza_yates_helper = (int *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_baeza_yates_helper; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.compare_matchings_set = (long (*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, struct __pyx_t_8_cdec_sa_Matching *, int, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings_set; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.compare_matchings = (long (*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_t_8_cdec_sa_Matching *, struct __pyx_t_8_cdec_sa_Matching *, int, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_compare_matchings; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.merge_helper = (int *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_merge_helper; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.sort_phrase_loc = (void (*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_IntList *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, struct __pyx_obj_8_cdec_sa_Phrase *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_sort_phrase_loc; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.intersect_helper = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, struct __pyx_obj_8_cdec_sa_PhraseLocation *, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect_helper; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.loc2str = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_PhraseLocation *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_loc2str; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.intersect = (struct __pyx_obj_8_cdec_sa_PhraseLocation *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, PyObject *, PyObject *, struct __pyx_obj_8_cdec_sa_Phrase *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_intersect; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.find_fixpoint = (int (*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, PyObject *, int *, int *, int *, int *, int, int, int *, int *, int *, int *, int, int, int, int, int, int, int, int, int, int, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_fixpoint; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.find_projection = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_find_projection; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.int_arr_extend = (int *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int *, int *, int *, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_int_arr_extend; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract_phrases; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.create_alignments = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_create_alignments; - __pyx_vtable_8_cdec_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_8_cdec_sa_HieroCachingRuleFactory *, struct __pyx_obj_8_cdec_sa_Phrase *, struct __pyx_t_8_cdec_sa_Matching *, int *, int))__pyx_f_8_cdec_sa_23HieroCachingRuleFactory_extract; - if (PyType_Ready(&__pyx_type_8_cdec_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_8_cdec_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_8_cdec_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_8_cdec_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa_HieroCachingRuleFactory = &__pyx_type_8_cdec_sa_HieroCachingRuleFactory; - if (PyType_Ready(&__pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa___pyx_scope_struct__compute_stats = &__pyx_type_8_cdec_sa___pyx_scope_struct__compute_stats; - if (PyType_Ready(&__pyx_type_8_cdec_sa___pyx_scope_struct_1_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_8_cdec_sa___pyx_scope_struct_1_input = &__pyx_type_8_cdec_sa___pyx_scope_struct_1_input; + __pyx_vtabptr_3_sa_Phrase = &__pyx_vtable_3_sa_Phrase; + __pyx_vtable_3_sa_Phrase.chunkpos = (int (*)(struct __pyx_obj_3_sa_Phrase *, int))__pyx_f_3_sa_6Phrase_chunkpos; + __pyx_vtable_3_sa_Phrase.chunklen = (int (*)(struct __pyx_obj_3_sa_Phrase *, int))__pyx_f_3_sa_6Phrase_chunklen; + if (PyType_Ready(&__pyx_type_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_Phrase.tp_dict, __pyx_vtabptr_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Phrase", (PyObject *)&__pyx_type_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Phrase = &__pyx_type_3_sa_Phrase; + if (PyType_Ready(&__pyx_type_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Rule = &__pyx_type_3_sa_Rule; + __pyx_vtabptr_3_sa_FloatList = &__pyx_vtable_3_sa_FloatList; + __pyx_vtable_3_sa_FloatList.set = (void (*)(struct __pyx_obj_3_sa_FloatList *, int, float))__pyx_f_3_sa_9FloatList_set; + __pyx_vtable_3_sa_FloatList.write_handle = (void (*)(struct __pyx_obj_3_sa_FloatList *, FILE *))__pyx_f_3_sa_9FloatList_write_handle; + __pyx_vtable_3_sa_FloatList.read_handle = (void (*)(struct __pyx_obj_3_sa_FloatList *, FILE *))__pyx_f_3_sa_9FloatList_read_handle; + if (PyType_Ready(&__pyx_type_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_FloatList.tp_dict, __pyx_vtabptr_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "FloatList", (PyObject *)&__pyx_type_3_sa_FloatList) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_FloatList = &__pyx_type_3_sa_FloatList; + __pyx_vtabptr_3_sa_IntList = &__pyx_vtable_3_sa_IntList; + __pyx_vtable_3_sa_IntList.set = (void (*)(struct __pyx_obj_3_sa_IntList *, int, int))__pyx_f_3_sa_7IntList_set; + __pyx_vtable_3_sa_IntList._append = (void (*)(struct __pyx_obj_3_sa_IntList *, int))__pyx_f_3_sa_7IntList__append; + __pyx_vtable_3_sa_IntList._extend = (void (*)(struct __pyx_obj_3_sa_IntList *, struct __pyx_obj_3_sa_IntList *))__pyx_f_3_sa_7IntList__extend; + __pyx_vtable_3_sa_IntList._extend_arr = (void (*)(struct __pyx_obj_3_sa_IntList *, int *, int))__pyx_f_3_sa_7IntList__extend_arr; + __pyx_vtable_3_sa_IntList._clear = (void (*)(struct __pyx_obj_3_sa_IntList *))__pyx_f_3_sa_7IntList__clear; + __pyx_vtable_3_sa_IntList.write_handle = (void (*)(struct __pyx_obj_3_sa_IntList *, FILE *))__pyx_f_3_sa_7IntList_write_handle; + __pyx_vtable_3_sa_IntList.read_handle = (void (*)(struct __pyx_obj_3_sa_IntList *, FILE *))__pyx_f_3_sa_7IntList_read_handle; + if (PyType_Ready(&__pyx_type_3_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_IntList.tp_dict, __pyx_vtabptr_3_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "IntList", (PyObject *)&__pyx_type_3_sa_IntList) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_IntList = &__pyx_type_3_sa_IntList; + __pyx_vtabptr_3_sa_StringMap = &__pyx_vtable_3_sa_StringMap; + __pyx_vtable_3_sa_StringMap.word = (char *(*)(struct __pyx_obj_3_sa_StringMap *, int))__pyx_f_3_sa_9StringMap_word; + __pyx_vtable_3_sa_StringMap.index = (int (*)(struct __pyx_obj_3_sa_StringMap *, char *))__pyx_f_3_sa_9StringMap_index; + if (PyType_Ready(&__pyx_type_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_StringMap.tp_dict, __pyx_vtabptr_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "StringMap", (PyObject *)&__pyx_type_3_sa_StringMap) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_StringMap = &__pyx_type_3_sa_StringMap; + __pyx_vtabptr_3_sa_DataArray = &__pyx_vtable_3_sa_DataArray; + __pyx_vtable_3_sa_DataArray.read_handle = (void (*)(struct __pyx_obj_3_sa_DataArray *, FILE *))__pyx_f_3_sa_9DataArray_read_handle; + __pyx_vtable_3_sa_DataArray.write_handle = (void (*)(struct __pyx_obj_3_sa_DataArray *, FILE *))__pyx_f_3_sa_9DataArray_write_handle; + if (PyType_Ready(&__pyx_type_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_DataArray.tp_dict, __pyx_vtabptr_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DataArray", (PyObject *)&__pyx_type_3_sa_DataArray) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_DataArray = &__pyx_type_3_sa_DataArray; + __pyx_vtabptr_3_sa_Alignment = &__pyx_vtable_3_sa_Alignment; + __pyx_vtable_3_sa_Alignment.link = (int (*)(struct __pyx_obj_3_sa_Alignment *, int, int))__pyx_f_3_sa_9Alignment_link; + __pyx_vtable_3_sa_Alignment._unlink = (PyObject *(*)(struct __pyx_obj_3_sa_Alignment *, int, int *, int *))__pyx_f_3_sa_9Alignment__unlink; + __pyx_vtable_3_sa_Alignment._get_sent_links = (int *(*)(struct __pyx_obj_3_sa_Alignment *, int, int *))__pyx_f_3_sa_9Alignment__get_sent_links; + if (PyType_Ready(&__pyx_type_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_Alignment.tp_dict, __pyx_vtabptr_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Alignment", (PyObject *)&__pyx_type_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Alignment = &__pyx_type_3_sa_Alignment; + __pyx_vtabptr_3_sa_BiLex = &__pyx_vtable_3_sa_BiLex; + __pyx_vtable_3_sa_BiLex.compute_from_data = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, struct __pyx_obj_3_sa_SuffixArray *, struct __pyx_obj_3_sa_DataArray *, struct __pyx_obj_3_sa_Alignment *))__pyx_f_3_sa_5BiLex_compute_from_data; + __pyx_vtable_3_sa_BiLex._add_node = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, struct __pyx_t_3_sa__node *, int *, float, int *))__pyx_f_3_sa_5BiLex__add_node; + __pyx_vtable_3_sa_BiLex.write_wordlist = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, PyObject *, FILE *))__pyx_f_3_sa_5BiLex_write_wordlist; + __pyx_vtable_3_sa_BiLex.read_wordlist = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, PyObject *, PyObject *, FILE *))__pyx_f_3_sa_5BiLex_read_wordlist; + __pyx_vtable_3_sa_BiLex.swap = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, int, int))__pyx_f_3_sa_5BiLex_swap; + __pyx_vtable_3_sa_BiLex.qsort = (PyObject *(*)(struct __pyx_obj_3_sa_BiLex *, int, int, PyObject *))__pyx_f_3_sa_5BiLex_qsort; + if (PyType_Ready(&__pyx_type_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_BiLex.tp_dict, __pyx_vtabptr_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BiLex", (PyObject *)&__pyx_type_3_sa_BiLex) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_BiLex = &__pyx_type_3_sa_BiLex; + if (PyType_Ready(&__pyx_type_3_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BitSetIterator", (PyObject *)&__pyx_type_3_sa_BitSetIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_BitSetIterator = &__pyx_type_3_sa_BitSetIterator; + if (PyType_Ready(&__pyx_type_3_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BitSet", (PyObject *)&__pyx_type_3_sa_BitSet) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_BitSet = &__pyx_type_3_sa_BitSet; + if (PyType_Ready(&__pyx_type_3_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "VEBIterator", (PyObject *)&__pyx_type_3_sa_VEBIterator) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_VEBIterator = &__pyx_type_3_sa_VEBIterator; + __pyx_vtabptr_3_sa_VEB = &__pyx_vtable_3_sa_VEB; + __pyx_vtable_3_sa_VEB._findsucc = (int (*)(struct __pyx_obj_3_sa_VEB *, int))__pyx_f_3_sa_3VEB__findsucc; + __pyx_vtable_3_sa_VEB._insert = (int (*)(struct __pyx_obj_3_sa_VEB *, int))__pyx_f_3_sa_3VEB__insert; + __pyx_vtable_3_sa_VEB._first = (int (*)(struct __pyx_obj_3_sa_VEB *))__pyx_f_3_sa_3VEB__first; + if (PyType_Ready(&__pyx_type_3_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_VEB.tp_dict, __pyx_vtabptr_3_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "VEB", (PyObject *)&__pyx_type_3_sa_VEB) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_VEB = &__pyx_type_3_sa_VEB; + if (PyType_Ready(&__pyx_type_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LCP", (PyObject *)&__pyx_type_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_LCP = &__pyx_type_3_sa_LCP; + __pyx_vtabptr_3_sa_Alphabet = &__pyx_vtable_3_sa_Alphabet; + __pyx_vtable_3_sa_Alphabet.isvar = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_isvar; + __pyx_vtable_3_sa_Alphabet.isword = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_isword; + __pyx_vtable_3_sa_Alphabet.getindex = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_getindex; + __pyx_vtable_3_sa_Alphabet.setindex = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int, int))__pyx_f_3_sa_8Alphabet_setindex; + __pyx_vtable_3_sa_Alphabet.clearindex = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_clearindex; + __pyx_vtable_3_sa_Alphabet.match = (int (*)(struct __pyx_obj_3_sa_Alphabet *, int, int))__pyx_f_3_sa_8Alphabet_match; + __pyx_vtable_3_sa_Alphabet.tocat = (char *(*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_tocat; + __pyx_vtable_3_sa_Alphabet.fromcat = (int (*)(struct __pyx_obj_3_sa_Alphabet *, char *))__pyx_f_3_sa_8Alphabet_fromcat; + __pyx_vtable_3_sa_Alphabet.tostring = (char *(*)(struct __pyx_obj_3_sa_Alphabet *, int))__pyx_f_3_sa_8Alphabet_tostring; + __pyx_vtable_3_sa_Alphabet.fromstring = (int (*)(struct __pyx_obj_3_sa_Alphabet *, char *, int))__pyx_f_3_sa_8Alphabet_fromstring; + if (PyType_Ready(&__pyx_type_3_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_Alphabet.tp_dict, __pyx_vtabptr_3_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Alphabet", (PyObject *)&__pyx_type_3_sa_Alphabet) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Alphabet = &__pyx_type_3_sa_Alphabet; + __pyx_vtabptr_3_sa_TrieMap = &__pyx_vtable_3_sa_TrieMap; + __pyx_vtable_3_sa_TrieMap._insert = (struct __pyx_t_3_sa__Trie_Node *(*)(struct __pyx_obj_3_sa_TrieMap *, int *, int))__pyx_f_3_sa_7TrieMap__insert; + __pyx_vtable_3_sa_TrieMap._contains = (struct __pyx_t_3_sa__Trie_Node *(*)(struct __pyx_obj_3_sa_TrieMap *, int *, int))__pyx_f_3_sa_7TrieMap__contains; + if (PyType_Ready(&__pyx_type_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_TrieMap.tp_dict, __pyx_vtabptr_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieMap", (PyObject *)&__pyx_type_3_sa_TrieMap) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_TrieMap = &__pyx_type_3_sa_TrieMap; + __pyx_vtabptr_3_sa_Precomputation = &__pyx_vtable_3_sa_Precomputation; + __pyx_vtable_3_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_3_sa_Precomputation *, FILE *))__pyx_f_3_sa_14Precomputation_read_map; + __pyx_vtable_3_sa_Precomputation.write_map = (PyObject *(*)(struct __pyx_obj_3_sa_Precomputation *, PyObject *, FILE *))__pyx_f_3_sa_14Precomputation_write_map; + if (PyType_Ready(&__pyx_type_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_Precomputation.tp_dict, __pyx_vtabptr_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Precomputation", (PyObject *)&__pyx_type_3_sa_Precomputation) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Precomputation = &__pyx_type_3_sa_Precomputation; + __pyx_vtabptr_3_sa_SuffixArray = &__pyx_vtable_3_sa_SuffixArray; + __pyx_vtable_3_sa_SuffixArray.__pyx___search_high = (int (*)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int))__pyx_f_3_sa_11SuffixArray___search_high; + __pyx_vtable_3_sa_SuffixArray.__pyx___search_low = (int (*)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int))__pyx_f_3_sa_11SuffixArray___search_low; + __pyx_vtable_3_sa_SuffixArray.__pyx___get_range = (PyObject *(*)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int, int))__pyx_f_3_sa_11SuffixArray___get_range; + __pyx_vtable_3_sa_SuffixArray.__pyx___lookup_helper = (PyObject *(*)(struct __pyx_obj_3_sa_SuffixArray *, int, int, int, int))__pyx_f_3_sa_11SuffixArray___lookup_helper; + if (PyType_Ready(&__pyx_type_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_SuffixArray.tp_dict, __pyx_vtabptr_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "SuffixArray", (PyObject *)&__pyx_type_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_SuffixArray = &__pyx_type_3_sa_SuffixArray; + if (PyType_Ready(&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_TrieNode = &__pyx_type_3_sa_TrieNode; + __pyx_type_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_3_sa_TrieNode; + if (PyType_Ready(&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_ExtendedTrieNode = &__pyx_type_3_sa_ExtendedTrieNode; + if (PyType_Ready(&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_TrieTable = &__pyx_type_3_sa_TrieTable; + __pyx_vtabptr_3_sa_PhraseLocation = &__pyx_vtable_3_sa_PhraseLocation; + __pyx_vtable_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_3_sa_PhraseLocation *, int))__pyx_f_3_sa_14PhraseLocation_contains; + if (PyType_Ready(&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_PhraseLocation = &__pyx_type_3_sa_PhraseLocation; + if (PyType_Ready(&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_Sampler = &__pyx_type_3_sa_Sampler; + __pyx_vtabptr_3_sa_HieroCachingRuleFactory = &__pyx_vtable_3_sa_HieroCachingRuleFactory; + __pyx_vtable_3_sa_HieroCachingRuleFactory.set_idmap = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_DataArray *))__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap; + __pyx_vtable_3_sa_HieroCachingRuleFactory.baeza_yates_helper = (int *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *))__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper; + __pyx_vtable_3_sa_HieroCachingRuleFactory.compare_matchings_set = (long (*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, struct __pyx_t_3_sa_Matching *, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set; + __pyx_vtable_3_sa_HieroCachingRuleFactory.compare_matchings = (long (*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_t_3_sa_Matching *, struct __pyx_t_3_sa_Matching *, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings; + __pyx_vtable_3_sa_HieroCachingRuleFactory.merge_helper = (int *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int, int, int, int *, int, int, int, int, int *))__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper; + __pyx_vtable_3_sa_HieroCachingRuleFactory.sort_phrase_loc = (void (*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_IntList *, struct __pyx_obj_3_sa_PhraseLocation *, struct __pyx_obj_3_sa_Phrase *))__pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc; + __pyx_vtable_3_sa_HieroCachingRuleFactory.intersect_helper = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_obj_3_sa_PhraseLocation *, struct __pyx_obj_3_sa_PhraseLocation *, int))__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper; + __pyx_vtable_3_sa_HieroCachingRuleFactory.loc2str = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_PhraseLocation *))__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str; + __pyx_vtable_3_sa_HieroCachingRuleFactory.intersect = (struct __pyx_obj_3_sa_PhraseLocation *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, PyObject *, PyObject *, struct __pyx_obj_3_sa_Phrase *))__pyx_f_3_sa_23HieroCachingRuleFactory_intersect; + __pyx_vtable_3_sa_HieroCachingRuleFactory.find_fixpoint = (int (*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, PyObject *, int *, int *, int *, int *, int, int, int *, int *, int *, int *, int, int, int, int, int, int, int, int, int, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint; + __pyx_vtable_3_sa_HieroCachingRuleFactory.find_projection = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int *))__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection; + __pyx_vtable_3_sa_HieroCachingRuleFactory.int_arr_extend = (int *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int *, int *, int))__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend; + __pyx_vtable_3_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases; + __pyx_vtable_3_sa_HieroCachingRuleFactory.create_alignments = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *))__pyx_f_3_sa_23HieroCachingRuleFactory_create_alignments; + __pyx_vtable_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_t_3_sa_Matching *, int *, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract; + if (PyType_Ready(&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa_HieroCachingRuleFactory = &__pyx_type_3_sa_HieroCachingRuleFactory; + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct__compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa___pyx_scope_struct__compute_stats = &__pyx_type_3_sa___pyx_scope_struct__compute_stats; + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_1___iter__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa___pyx_scope_struct_1___iter__ = &__pyx_type_3_sa___pyx_scope_struct_1___iter__; + if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_2_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_3_sa___pyx_scope_struct_2_input = &__pyx_type_3_sa___pyx_scope_struct_2_input; /*--- Type import code ---*/ /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "_cdec_sa.pyx":1 + /* "_sa.pyx":1 * import logging # <<<<<<<<<<<<<< * import resource * import gzip @@ -60603,7 +60804,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "_cdec_sa.pyx":2 + /* "_sa.pyx":2 * import logging * import resource # <<<<<<<<<<<<<< * import gzip @@ -60614,7 +60815,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__resource, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "_cdec_sa.pyx":3 + /* "_sa.pyx":3 * import logging * import resource * import gzip # <<<<<<<<<<<<<< @@ -60626,19 +60827,19 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gzip, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "_cdec_sa.pyx":9 + /* "_sa.pyx":9 * resource.getrusage(resource.RUSAGE_SELF).ru_stime) * * def gzip_or_text(char* filename): # <<<<<<<<<<<<<< * if filename.endswith('.gz'): * return gzip.GzipFile(filename) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8_cdec_sa_1gzip_or_text, NULL, __pyx_n_s___cdec_sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_1gzip_or_text, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gzip_or_text, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "_cdec_sa.pyx":15 + /* "_sa.pyx":15 * return open(filename) * * logger = logging.getLogger('cdec.sa') # <<<<<<<<<<<<<< @@ -60676,7 +60877,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * cdef int MIN_BOTTOM_BITS = 5 * cdef int LOWER_MASK[32] */ - __pyx_v_8_cdec_sa_MIN_BOTTOM_SIZE = 32; + __pyx_v_3_sa_MIN_BOTTOM_SIZE = 32; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":18 * @@ -60685,7 +60886,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * cdef int LOWER_MASK[32] * */ - __pyx_v_8_cdec_sa_MIN_BOTTOM_BITS = 5; + __pyx_v_3_sa_MIN_BOTTOM_BITS = 5; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/veb.pxi":28 * LOWER_MASK[i] = mask @@ -60694,7 +60895,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * * cdef struct _BitSet: */ - __pyx_f_8_cdec_sa__init_lower_mask(); + __pyx_f_3_sa__init_lower_mask(); /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":4 * from libc.stdlib cimport malloc, realloc, strtol @@ -60703,7 +60904,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 * */ - __pyx_v_8_cdec_sa_INDEX_SHIFT = 3; + __pyx_v_3_sa_INDEX_SHIFT = 3; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":5 * @@ -60712,57 +60913,32 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * * cdef class Alphabet: */ - __pyx_v_8_cdec_sa_INDEX_MASK = ((1 << __pyx_v_8_cdec_sa_INDEX_SHIFT) - 1); + __pyx_v_3_sa_INDEX_MASK = ((1 << __pyx_v_3_sa_INDEX_SHIFT) - 1); - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":89 + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":87 * return self.terminals.index(s) * * cdef Alphabet ALPHABET = Alphabet() # <<<<<<<<<<<<<< * - * def sym_tostring(int sym): + * cdef char* sym_tostring(int sym): */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8_cdec_sa_Alphabet)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Alphabet)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_XGOTREF(((PyObject *)__pyx_v_8_cdec_sa_ALPHABET)); - __Pyx_DECREF(((PyObject *)__pyx_v_8_cdec_sa_ALPHABET)); + __Pyx_XGOTREF(((PyObject *)__pyx_v_3_sa_ALPHABET)); + __Pyx_DECREF(((PyObject *)__pyx_v_3_sa_ALPHABET)); __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_8_cdec_sa_ALPHABET = ((struct __pyx_obj_8_cdec_sa_Alphabet *)__pyx_t_1); + __pyx_v_3_sa_ALPHABET = ((struct __pyx_obj_3_sa_Alphabet *)__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":91 - * cdef Alphabet ALPHABET = Alphabet() - * - * def sym_tostring(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.tostring(sym) - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8_cdec_sa_3sym_tostring, NULL, __pyx_n_s___cdec_sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sym_tostring, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":94 - * return ALPHABET.tostring(sym) + /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":104 + * return ALPHABET.setindex(sym, id) * * def sym_fromstring(bytes string, bint terminal): # <<<<<<<<<<<<<< * return ALPHABET.fromstring(string, terminal) - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8_cdec_sa_5sym_fromstring, NULL, __pyx_n_s___cdec_sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sym_fromstring, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "/Users/vchahun/Sandbox/cdec/python/src/sa/sym.pxi":97 - * return ALPHABET.fromstring(string, terminal) - * - * def sym_isvar(int sym): # <<<<<<<<<<<<<< - * return ALPHABET.isvar(sym) - * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8_cdec_sa_7sym_isvar, NULL, __pyx_n_s___cdec_sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_3sym_fromstring, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sym_isvar, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sym_fromstring, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":5 @@ -60784,7 +60960,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * cdef int MERGE = 1 * cdef int BAEZA_YATES = 2 */ - __pyx_v_8_cdec_sa_PRECOMPUTE = 0; + __pyx_v_3_sa_PRECOMPUTE = 0; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":12 * @@ -60793,7 +60969,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * cdef int BAEZA_YATES = 2 * */ - __pyx_v_8_cdec_sa_MERGE = 1; + __pyx_v_3_sa_MERGE = 1; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":13 * cdef int PRECOMPUTE = 0 @@ -60802,7 +60978,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) * * # NOTE: was encoded as a non-terminal in the previous version */ - __pyx_v_8_cdec_sa_BAEZA_YATES = 2; + __pyx_v_3_sa_BAEZA_YATES = 2; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":16 * @@ -60817,9 +60993,9 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_144)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_144)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_144)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_140)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_140)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140)); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -60829,7 +61005,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_8_cdec_sa_EPSILON = __pyx_t_4; + __pyx_v_3_sa_EPSILON = __pyx_t_4; /* "/Users/vchahun/Sandbox/cdec/python/src/sa/rulefactory.pxi":39 * cdef public int count @@ -60844,7 +61020,7 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "_cdec_sa.pyx":1 + /* "_sa.pyx":1 * import logging # <<<<<<<<<<<<<< * import resource * import gzip @@ -60859,10 +61035,10 @@ PyMODINIT_FUNC PyInit__cdec_sa(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init _cdec_sa", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init _sa", __pyx_clineno, __pyx_lineno, __pyx_filename); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init _cdec_sa"); + PyErr_SetString(PyExc_ImportError, "init _sa"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -61015,7 +61191,7 @@ static void __Pyx_RaiseArgtupleInvalid( more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, - "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)", + "%s() takes %s %" PY_FORMAT_SIZE_T "d positional argument%s (%" PY_FORMAT_SIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } @@ -61192,6 +61368,11 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings( { PyObject* key = 0; Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) @@ -61207,6 +61388,7 @@ invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); return 0; +#endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 @@ -61219,10 +61401,9 @@ invalid_keyword: return 0; } - - static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; @@ -61231,19 +61412,27 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif goto bad; #if PY_MAJOR_VERSION >= 3 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; #endif - *type = local_type; - *value = local_value; - *tb = local_tb; Py_INCREF(local_type); Py_INCREF(local_value); Py_INCREF(local_tb); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; @@ -61251,10 +61440,13 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->exc_value = local_value; tstate->exc_traceback = local_tb; /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ + these objects (DECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif return 0; bad: *type = 0; @@ -61279,23 +61471,40 @@ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { return r; } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, - "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", - index, (index == 1) ? "" : "s"); + "too many values to unpack (expected %" PY_FORMAT_SIZE_T "d)", expected); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected); + "need more than %" PY_FORMAT_SIZE_T "d value%s to unpack", + index, (index == 1) ? "" : "s"); } -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else if (PyErr_Occurred()) { +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; @@ -61304,12 +61513,25 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { } } return 0; +#endif } - +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; +#if CYTHON_COMPILING_IN_PYPY + float_value = PyNumber_Float(obj); +#else if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { return PyFloat_AsDouble(obj); } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { @@ -61326,6 +61548,7 @@ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } +#endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); @@ -61359,8 +61582,158 @@ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed return 0; } -static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable"); +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int is_tuple, int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + if (!is_tuple && unlikely(!PyTuple_Check(tuple))) { + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + } else { + if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) { + __Pyx_UnpackTupleError(tuple, 2); + goto bad; + } +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); + if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); + if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); + value2 = PyTuple_GET_ITEM(tuple, 1); + Py_INCREF(value1); + Py_INCREF(value2); +#endif + if (decref_tuple) { Py_DECREF(tuple); } + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; +#if !CYTHON_COMPILING_IN_PYPY + if (is_dict) { + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#endif + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = PyObject_CallMethodObjArgs(iterable, method_name, NULL); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; } static CYTHON_INLINE int __Pyx_div_int(int a, int b) { @@ -61371,6 +61744,7 @@ static CYTHON_INLINE int __Pyx_div_int(int a, int b) { } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -61378,8 +61752,12 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; @@ -61391,6 +61769,9 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) { @@ -61862,8 +62243,8 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* } } -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename) { +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); @@ -61883,6 +62264,7 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno, static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; @@ -61890,6 +62272,10 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; @@ -61899,9 +62285,70 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Generator_Close(PyObject *self); static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args); +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#if 1 || PY_VERSION_HEX < 0x030300B0 +static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (unlikely(et != PyExc_StopIteration) && + unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + if (likely(et == PyExc_StopIteration)) { + if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + ev = Py_None; + } + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = ev; + return 0; + } + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = PyObject_GetAttrString(ev, "args"); + Py_DECREF(ev); + if (likely(args)) { + value = PyObject_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +#endif static CYTHON_INLINE -void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) -{ +void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) { PyObject *exc_type = self->exc_type; PyObject *exc_value = self->exc_value; PyObject *exc_traceback = self->exc_traceback; @@ -61913,14 +62360,18 @@ void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) Py_XDECREF(exc_traceback); } static CYTHON_INLINE -PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) -{ - PyObject *retval; - if (unlikely(self->is_running)) { +int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) { + if (unlikely(gen->is_running)) { PyErr_SetString(PyExc_ValueError, "generator already executing"); - return NULL; + return 1; } + return 0; +} +static CYTHON_INLINE +PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { + PyObject *retval; + assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { PyErr_SetString(PyExc_TypeError, @@ -61933,81 +62384,240 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (value) - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); - else + if (value) { +#if CYTHON_COMPILING_IN_PYPY +#else + /* Generators always return to their most recent caller, not + * necessarily their creator. */ + if (self->exc_traceback) { + PyThreadState *tstate = PyThreadState_GET(); + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } +#endif + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); + } else { __Pyx_Generator_ExceptionClear(self); + } self->is_running = 1; retval = self->body((PyObject *) self, value); self->is_running = 0; - if (retval) - __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); - else + if (retval) { + __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, + &self->exc_traceback); +#if CYTHON_COMPILING_IN_PYPY +#else + /* Don't keep the reference to f_back any longer than necessary. It + * may keep a chain of frames alive or it could create a reference + * cycle. */ + if (self->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); + } +#endif + } else { __Pyx_Generator_ExceptionClear(self); + } return retval; } -static PyObject *__Pyx_Generator_Next(PyObject *self) -{ - return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, Py_None); +static CYTHON_INLINE +PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Generator_Undelegate(gen); + __Pyx_PyGen_FetchStopIterationValue(&val); + ret = __Pyx_Generator_SendEx(gen, val); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, Py_None); +} +static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Send(yf, value); + } else { + if (value == Py_None) + ret = PyIter_Next(yf); + else + ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Generator_FinishDelegation(gen); + } + return __Pyx_Generator_SendEx(gen, value); } -static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) -{ - return __Pyx_Generator_SendEx((__pyx_GeneratorObject *) self, value); +static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Generator_Close(yf); + if (!retval) + return -1; + } else { + PyObject *meth; + gen->is_running = 1; + meth = PyObject_GetAttrString(yf, "close"); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; } -static PyObject *__Pyx_Generator_Close(PyObject *self) -{ - __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; - PyObject *retval; +static PyObject *__Pyx_Generator_Close(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + Py_INCREF(yf); + err = __Pyx_Generator_CloseIter(gen, yf); + __Pyx_Generator_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) #if PY_VERSION_HEX < 0x02050000 - PyErr_SetNone(PyExc_StopIteration); + PyErr_SetNone(PyExc_StopIteration); #else - PyErr_SetNone(PyExc_GeneratorExit); + PyErr_SetNone(PyExc_GeneratorExit); #endif - retval = __Pyx_Generator_SendEx(generator, NULL); + retval = __Pyx_Generator_SendEx(gen, NULL); if (retval) { Py_DECREF(retval); PyErr_SetString(PyExc_RuntimeError, "generator ignored GeneratorExit"); return NULL; } -#if PY_VERSION_HEX < 0x02050000 - if (PyErr_ExceptionMatches(PyExc_StopIteration)) -#else - if (PyErr_ExceptionMatches(PyExc_StopIteration) - || PyErr_ExceptionMatches(PyExc_GeneratorExit)) + raised_exception = PyErr_Occurred(); + if (!raised_exception + || raised_exception == PyExc_StopIteration +#if PY_VERSION_HEX >= 0x02050000 + || raised_exception == PyExc_GeneratorExit + || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) #endif + || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) { - PyErr_Clear(); /* ignore these errors */ + if (raised_exception) PyErr_Clear(); /* ignore these errors */ Py_INCREF(Py_None); return Py_None; } return NULL; } -static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) -{ - __pyx_GeneratorObject *generator = (__pyx_GeneratorObject *) self; +static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; PyObject *typ; PyObject *tb = NULL; PyObject *val = NULL; + PyObject *yf = gen->yieldfrom; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; + if (unlikely(__Pyx_Generator_CheckRunning(gen))) + return NULL; + if (yf) { + PyObject *ret; + Py_INCREF(yf); +#if PY_VERSION_HEX >= 0x02050000 + if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) { + int err = __Pyx_Generator_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Generator_Undelegate(gen); + if (err < 0) + return __Pyx_Generator_SendEx(gen, NULL); + goto throw_here; + } +#endif + gen->is_running = 1; + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Throw(yf, args); + } else { + PyObject *meth = PyObject_GetAttrString(yf, "throw"); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Generator_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + ret = PyObject_CallObject(meth, args); + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Generator_FinishDelegation(gen); + } + return ret; + } +throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Generator_SendEx(generator, NULL); + return __Pyx_Generator_SendEx(gen, NULL); } -static int -__Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) -{ +static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) { __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; Py_VISIT(gen->closure); Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); Py_VISIT(gen->exc_type); Py_VISIT(gen->exc_value); Py_VISIT(gen->exc_traceback); return 0; } -static void -__Pyx_Generator_dealloc(PyObject *self) -{ +static int __Pyx_Generator_clear(PyObject *self) { + __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + Py_CLEAR(gen->exc_type); + Py_CLEAR(gen->exc_value); + Py_CLEAR(gen->exc_traceback); + return 0; +} +static void __Pyx_Generator_dealloc(PyObject *self) { __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) @@ -62019,16 +62629,10 @@ __Pyx_Generator_dealloc(PyObject *self) return; /* resurrected. :( */ } PyObject_GC_UnTrack(self); - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - Py_CLEAR(gen->exc_type); - Py_CLEAR(gen->exc_value); - Py_CLEAR(gen->exc_traceback); + __Pyx_Generator_clear(self); PyObject_GC_Del(gen); } -static void -__Pyx_Generator_del(PyObject *self) -{ +static void __Pyx_Generator_del(PyObject *self) { PyObject *res; PyObject *error_type, *error_value, *error_traceback; __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self; @@ -62057,11 +62661,13 @@ __Pyx_Generator_del(PyObject *self) _Py_NewReference(self); self->ob_refcnt = refcnt; } +#if CYTHON_COMPILING_FOR_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so * we need to undo that. */ _Py_DEC_REFTOTAL; +#endif /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object * chain, so no more to do there. * If COUNT_ALLOCS, the original decref bumped tp_frees, and @@ -62069,13 +62675,17 @@ __Pyx_Generator_del(PyObject *self) * undone. */ #ifdef COUNT_ALLOCS - --self->ob_type->tp_frees; - --self->ob_type->tp_allocs; + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; #endif } static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", +#if PY_VERSION_HEX >= 0x02060000 + T_BOOL, +#else T_INT, +#endif offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL}, @@ -62087,7 +62697,7 @@ static PyMethodDef __pyx_Generator_methods[] = { {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_GeneratorType = { +static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("generator"), /*tp_name*/ sizeof(__pyx_GeneratorObject), /*tp_basicsize*/ @@ -62108,7 +62718,7 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - PyObject_GenericGetAttr, /*tp_getattro*/ + 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ @@ -62117,7 +62727,7 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_clear*/ 0, /*tp_richcompare*/ offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */ - PyObject_SelfIter, /*tp_iter*/ + 0, /*tp_iter*/ (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ __pyx_Generator_methods, /*tp_methods*/ __pyx_Generator_memberlist, /*tp_members*/ @@ -62142,12 +62752,10 @@ static PyTypeObject __pyx_GeneratorType = { 0, /*tp_version_tag*/ #endif }; -static -__pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, - PyObject *closure) -{ +static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, + PyObject *closure) { __pyx_GeneratorObject *gen = - PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType); + PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type); if (gen == NULL) return NULL; gen->body = body; @@ -62156,6 +62764,7 @@ __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; + gen->yieldfrom = NULL; gen->exc_type = NULL; gen->exc_value = NULL; gen->exc_traceback = NULL; @@ -62163,9 +62772,14 @@ __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, PyObject_GC_Track(gen); return gen; } -static int __pyx_Generator_init(void) -{ - return PyType_Ready(&__pyx_GeneratorType); +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + if (PyType_Ready(&__pyx_GeneratorType_type)) { + return -1; + } + __pyx_GeneratorType = &__pyx_GeneratorType_type; + return 0; } static int __Pyx_check_binary_version(void) { @@ -62187,6 +62801,42 @@ static int __Pyx_check_binary_version(void) { return 0; } +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) PyObject *ob = PyCapsule_New(vtable, 0, 0); diff --git a/python/src/sa/_sa.pxd b/python/src/sa/_sa.pxd new file mode 100644 index 00000000..d390bfc5 --- /dev/null +++ b/python/src/sa/_sa.pxd @@ -0,0 +1,17 @@ +cdef class Phrase: + cdef int *syms + cdef int n, *varpos, n_vars + cdef public int chunkpos(self, int k) + cdef public int chunklen(self, int k) + +cdef class Rule: + cdef public int lhs + cdef readonly Phrase f, e + cdef float *cscores + cdef int n_scores + cdef public word_alignments + +cdef char* sym_tostring(int sym) +cdef char* sym_tocat(int sym) +cdef int sym_isvar(int sym) +cdef int sym_getindex(int sym) diff --git a/python/src/sa/_cdec_sa.pyx b/python/src/sa/_sa.pyx index 710f8cb4..710f8cb4 100644 --- a/python/src/sa/_cdec_sa.pyx +++ b/python/src/sa/_sa.pyx diff --git a/python/src/sa/rule.pxi b/python/src/sa/rule.pxi index 9c34f66d..bf1a83c6 100644 --- a/python/src/sa/rule.pxi +++ b/python/src/sa/rule.pxi @@ -2,8 +2,6 @@ from libc.stdlib cimport malloc, calloc, realloc, free, strtof, strtol from libc.string cimport strsep, strcpy, strlen cdef class Phrase: - cdef int *syms - cdef int n, *varpos, n_vars def __cinit__(self, words): cdef int i, j, n, n_vars @@ -12,14 +10,14 @@ cdef class Phrase: self.syms = <int *>malloc(n*sizeof(int)) for i from 0 <= i < n: self.syms[i] = words[i] - if ALPHABET.isvar(self.syms[i]): + if sym_isvar(self.syms[i]): n_vars += 1 self.n = n self.n_vars = n_vars self.varpos = <int *>malloc(n_vars*sizeof(int)) j = 0 for i from 0 <= i < n: - if ALPHABET.isvar(self.syms[i]): + if sym_isvar(self.syms[i]): self.varpos[j] = i j = j + 1 @@ -32,7 +30,7 @@ cdef class Phrase: cdef int i, s for i from 0 <= i < self.n: s = self.syms[i] - strs.append(ALPHABET.tostring(s)) + strs.append(sym_tostring(s)) return " ".join(strs) def handle(self): @@ -44,8 +42,8 @@ cdef class Phrase: j = 0 for j from 0 <= j < self.n: s = self.syms[j] - if ALPHABET.isvar(s): - s = ALPHABET.setindex(s,i) + if sym_isvar(s): + s = sym_setindex(s,i) i = i + 1 norm.append(s) return tuple(norm) @@ -58,10 +56,10 @@ cdef class Phrase: j = 0 for j from 0 <= j < self.n: s = self.syms[j] - if ALPHABET.isvar(s): - s = ALPHABET.setindex(s,i) + if sym_isvar(s): + s = sym_setindex(s,i) i = i + 1 - norm.append(ALPHABET.tostring(s)) + norm.append(sym_tostring(s)) return " ".join(norm) def arity(self): @@ -142,33 +140,30 @@ cdef class Phrase: def __iter__(self): cdef int i - l = [] for i from 0 <= i < self.n: - l.append(self.syms[i]) - return iter(l) + yield self.syms[i] def subst(self, start, children): cdef int i for i from 0 <= i < self.n: - if ALPHABET.isvar(self.syms[i]): - start = start + children[ALPHABET.getindex(self.syms[i])-1] + if sym_isvar(self.syms[i]): + start = start + children[sym_getindex(self.syms[i])-1] else: start = start + (self.syms[i],) return start + + property words: + def __get__(self): + return [sym_tostring(w) for w in self if not sym_isvar(w)] cdef class Rule: - cdef public int lhs - cdef readonly Phrase f, e - cdef float *cscores - cdef int n_scores - cdef public word_alignments def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): cdef int i, n cdef char *rest - if not ALPHABET.isvar(lhs): + if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) self.lhs = lhs @@ -214,7 +209,7 @@ cdef class Rule: scorestrs = [] for i from 0 <= i < self.n_scores: scorestrs.append(str(self.cscores[i])) - fields = [ALPHABET.tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] + fields = [sym_tostring(self.lhs), str(self.f), str(self.e), " ".join(scorestrs)] if self.word_alignments is not None: alignstr = [] for i from 0 <= i < len(self.word_alignments): diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi index 24bb680f..1c8d25a4 100644 --- a/python/src/sa/rulefactory.pxi +++ b/python/src/sa/rulefactory.pxi @@ -975,7 +975,6 @@ cdef class HieroCachingRuleFactory: continue phrase = prefix + (word_id,) - str_phrase = map(sym_tostring, phrase) hiero_phrase = Phrase(phrase) arity = hiero_phrase.arity() @@ -1019,7 +1018,7 @@ cdef class HieroCachingRuleFactory: else: # Suffix array search phrase_location = node.phrase_location - sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) + sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) if sa_range is not None: phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) else: diff --git a/python/src/sa/sym.pxi b/python/src/sa/sym.pxi index 3fd6c5a7..4b41886f 100644 --- a/python/src/sa/sym.pxi +++ b/python/src/sa/sym.pxi @@ -53,14 +53,12 @@ cdef class Alphabet: if self.isvar(sym): if sym in self.id2sym: return self.id2sym[sym] - ind = self.getindex(sym) if ind > 0: self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) else: self.id2sym[sym] = "[%s]" % self.tocat(sym) return self.id2sym[sym] - else: return self.terminals.word(sym) @@ -88,14 +86,20 @@ cdef class Alphabet: cdef Alphabet ALPHABET = Alphabet() -def sym_tostring(int sym): +cdef char* sym_tostring(int sym): return ALPHABET.tostring(sym) -def sym_fromstring(bytes string, bint terminal): - return ALPHABET.fromstring(string, terminal) +cdef char* sym_tocat(int sym): + return ALPHABET.tocat(sym) -def sym_isvar(int sym): +cdef int sym_isvar(int sym): return ALPHABET.isvar(sym) +cdef int sym_getindex(int sym): + return ALPHABET.getindex(sym) + cdef int sym_setindex(int sym, int id): return ALPHABET.setindex(sym, id) + +def sym_fromstring(bytes string, bint terminal): + return ALPHABET.fromstring(string, terminal) |